OLD | NEW |
1 | |
2 /* | 1 /* |
3 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
4 * | 3 * |
5 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 5 * found in the LICENSE file. |
7 */ | 6 */ |
8 | 7 |
9 | |
10 | |
11 #ifndef GrInOrderDrawBuffer_DEFINED | 8 #ifndef GrInOrderDrawBuffer_DEFINED |
12 #define GrInOrderDrawBuffer_DEFINED | 9 #define GrInOrderDrawBuffer_DEFINED |
13 | 10 |
14 #include "GrDrawTarget.h" | 11 #include "GrDrawTarget.h" |
15 #include "GrAllocPool.h" | 12 #include "GrAllocPool.h" |
16 #include "GrAllocator.h" | 13 #include "GrAllocator.h" |
17 #include "GrPath.h" | 14 #include "GrPath.h" |
18 | 15 |
19 #include "SkClipStack.h" | 16 #include "SkClipStack.h" |
20 #include "SkStrokeRec.h" | 17 #include "SkStrokeRec.h" |
21 #include "SkTemplates.h" | 18 #include "SkTemplates.h" |
| 19 #include "SkTypes.h" |
22 | 20 |
23 class GrGpu; | 21 class GrGpu; |
24 class GrIndexBufferAllocPool; | 22 class GrIndexBufferAllocPool; |
25 class GrVertexBufferAllocPool; | 23 class GrVertexBufferAllocPool; |
26 | 24 |
27 /** | 25 /** |
28 * GrInOrderDrawBuffer is an implementation of GrDrawTarget that queues up draws
for eventual | 26 * GrInOrderDrawBuffer is an implementation of GrDrawTarget that queues up draws
for eventual |
29 * playback into a GrGpu. In theory one draw buffer could playback into another.
When index or | 27 * playback into a GrGpu. In theory one draw buffer could playback into another.
When index or |
30 * vertex buffers are used as geometry sources it is the callers the draw buffer
only holds | 28 * vertex buffers are used as geometry sources it is the callers the draw buffer
only holds |
31 * references to the buffers. It is the callers responsibility to ensure that th
e data is still | 29 * references to the buffers. It is the callers responsibility to ensure that th
e data is still |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 kCopySurface_Cmd = 6, | 89 kCopySurface_Cmd = 6, |
92 }; | 90 }; |
93 | 91 |
94 class DrawRecord : public DrawInfo { | 92 class DrawRecord : public DrawInfo { |
95 public: | 93 public: |
96 DrawRecord(const DrawInfo& info) : DrawInfo(info) {} | 94 DrawRecord(const DrawInfo& info) : DrawInfo(info) {} |
97 const GrVertexBuffer* fVertexBuffer; | 95 const GrVertexBuffer* fVertexBuffer; |
98 const GrIndexBuffer* fIndexBuffer; | 96 const GrIndexBuffer* fIndexBuffer; |
99 }; | 97 }; |
100 | 98 |
101 struct StencilPath : GrNoncopyable { | 99 struct StencilPath : public ::SkNoncopyable { |
102 StencilPath(); | 100 StencilPath(); |
103 | 101 |
104 SkAutoTUnref<const GrPath> fPath; | 102 SkAutoTUnref<const GrPath> fPath; |
105 SkStrokeRec fStroke; | 103 SkStrokeRec fStroke; |
106 SkPath::FillType fFill; | 104 SkPath::FillType fFill; |
107 }; | 105 }; |
108 | 106 |
109 struct Clear : GrNoncopyable { | 107 struct Clear : public ::SkNoncopyable { |
110 Clear() : fRenderTarget(NULL) {} | 108 Clear() : fRenderTarget(NULL) {} |
111 ~Clear() { SkSafeUnref(fRenderTarget); } | 109 ~Clear() { SkSafeUnref(fRenderTarget); } |
112 | 110 |
113 SkIRect fRect; | 111 SkIRect fRect; |
114 GrColor fColor; | 112 GrColor fColor; |
115 GrRenderTarget* fRenderTarget; | 113 GrRenderTarget* fRenderTarget; |
116 }; | 114 }; |
117 | 115 |
118 struct CopySurface : GrNoncopyable { | 116 struct CopySurface : public ::SkNoncopyable { |
119 SkAutoTUnref<GrSurface> fDst; | 117 SkAutoTUnref<GrSurface> fDst; |
120 SkAutoTUnref<GrSurface> fSrc; | 118 SkAutoTUnref<GrSurface> fSrc; |
121 SkIRect fSrcRect; | 119 SkIRect fSrcRect; |
122 SkIPoint fDstPoint; | 120 SkIPoint fDstPoint; |
123 }; | 121 }; |
124 | 122 |
125 // overrides from GrDrawTarget | 123 // overrides from GrDrawTarget |
126 virtual void onDraw(const DrawInfo&) SK_OVERRIDE; | 124 virtual void onDraw(const DrawInfo&) SK_OVERRIDE; |
127 virtual void onDrawRect(const SkRect& rect, | 125 virtual void onDrawRect(const SkRect& rect, |
128 const SkMatrix* matrix, | 126 const SkMatrix* matrix, |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 | 224 |
227 virtual bool isIssued(uint32_t drawID) { return drawID != fDrawID; } | 225 virtual bool isIssued(uint32_t drawID) { return drawID != fDrawID; } |
228 | 226 |
229 bool fFlushing; | 227 bool fFlushing; |
230 uint32_t fDrawID; | 228 uint32_t fDrawID; |
231 | 229 |
232 typedef GrDrawTarget INHERITED; | 230 typedef GrDrawTarget INHERITED; |
233 }; | 231 }; |
234 | 232 |
235 #endif | 233 #endif |
OLD | NEW |