OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 | 10 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 void reset(); | 59 void reset(); |
60 | 60 |
61 /** | 61 /** |
62 * This plays the queued up draws to its GrGpu target. It also resets this o
bject (i.e. flushing | 62 * This plays the queued up draws to its GrGpu target. It also resets this o
bject (i.e. flushing |
63 * is destructive). This buffer must not have an active reserved vertex or i
ndex source. Any | 63 * is destructive). This buffer must not have an active reserved vertex or i
ndex source. Any |
64 * reserved geometry on the target will be finalized because it's geometry s
ource will be pushed | 64 * reserved geometry on the target will be finalized because it's geometry s
ource will be pushed |
65 * before flushing and popped afterwards. | 65 * before flushing and popped afterwards. |
66 */ | 66 */ |
67 void flush(); | 67 void flush(); |
68 | 68 |
| 69 // tracking for draws |
| 70 virtual DrawToken getCurrentDrawToken() { return DrawToken(this, fDrawID); } |
| 71 |
69 // overrides from GrDrawTarget | 72 // overrides from GrDrawTarget |
70 virtual bool geometryHints(int* vertexCount, | 73 virtual bool geometryHints(int* vertexCount, |
71 int* indexCount) const SK_OVERRIDE; | 74 int* indexCount) const SK_OVERRIDE; |
72 virtual void clear(const SkIRect* rect, | 75 virtual void clear(const SkIRect* rect, |
73 GrColor color, | 76 GrColor color, |
74 GrRenderTarget* renderTarget = NULL) SK_OVERRIDE; | 77 GrRenderTarget* renderTarget = NULL) SK_OVERRIDE; |
75 | 78 |
76 virtual void initCopySurfaceDstDesc(const GrSurface* src, GrTextureDesc* des
c) SK_OVERRIDE; | 79 virtual void initCopySurfaceDstDesc(const GrSurface* src, GrTextureDesc* des
c) SK_OVERRIDE; |
77 | 80 |
78 | |
79 protected: | 81 protected: |
80 virtual void clipWillBeSet(const GrClipData* newClip) SK_OVERRIDE; | 82 virtual void clipWillBeSet(const GrClipData* newClip) SK_OVERRIDE; |
81 | 83 |
82 private: | 84 private: |
83 enum Cmd { | 85 enum Cmd { |
84 kDraw_Cmd = 1, | 86 kDraw_Cmd = 1, |
85 kStencilPath_Cmd = 2, | 87 kStencilPath_Cmd = 2, |
86 kSetState_Cmd = 3, | 88 kSetState_Cmd = 3, |
87 kSetClip_Cmd = 4, | 89 kSetClip_Cmd = 4, |
88 kClear_Cmd = 5, | 90 kClear_Cmd = 5, |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 const GrIndexBuffer* fPoolIndexBuffer; | 217 const GrIndexBuffer* fPoolIndexBuffer; |
216 int fPoolStartIndex; | 218 int fPoolStartIndex; |
217 // caller may conservatively over reserve vertices / indices. | 219 // caller may conservatively over reserve vertices / indices. |
218 // we release unused space back to allocator if possible | 220 // we release unused space back to allocator if possible |
219 // can only do this if there isn't an intervening pushGeometrySource() | 221 // can only do this if there isn't an intervening pushGeometrySource() |
220 size_t fUsedPoolVertexBytes; | 222 size_t fUsedPoolVertexBytes; |
221 size_t fUsedPoolIndexBytes; | 223 size_t fUsedPoolIndexBytes; |
222 }; | 224 }; |
223 SkSTArray<kGeoPoolStatePreAllocCnt, GeometryPoolState> fGeoPoolStateStack; | 225 SkSTArray<kGeoPoolStatePreAllocCnt, GeometryPoolState> fGeoPoolStateStack; |
224 | 226 |
| 227 virtual bool isIssued(uint32_t drawID) { return drawID != fDrawID; } |
| 228 |
225 bool fFlushing; | 229 bool fFlushing; |
| 230 uint32_t fDrawID; |
226 | 231 |
227 typedef GrDrawTarget INHERITED; | 232 typedef GrDrawTarget INHERITED; |
228 }; | 233 }; |
229 | 234 |
230 #endif | 235 #endif |
OLD | NEW |