blob: 7b9a926cf40b376427ce8d01f52b940152ae92dc [file] [log] [blame]
reed@google.comac10a2d2010-12-22 21:39:39 +00001/*
epoger@google.comec3ed6a2011-07-28 14:26:00 +00002 * Copyright 2011 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
reed@google.comac10a2d2010-12-22 21:39:39 +00006 */
7
reed@google.comac10a2d2010-12-22 21:39:39 +00008#ifndef GrInOrderDrawBuffer_DEFINED
9#define GrInOrderDrawBuffer_DEFINED
10
11#include "GrDrawTarget.h"
12#include "GrAllocPool.h"
13#include "GrAllocator.h"
bsalomonb3e3a952014-09-19 11:10:40 -070014#include "GrIndexBuffer.h"
15#include "GrRenderTarget.h"
bsalomon@google.comded4f4b2012-06-28 18:48:06 +000016#include "GrPath.h"
bsalomonb3e3a952014-09-19 11:10:40 -070017#include "GrPathRange.h"
18#include "GrSurface.h"
cdalton6819df32014-10-15 13:43:48 -070019#include "GrTRecorder.h"
bsalomonb3e3a952014-09-19 11:10:40 -070020#include "GrVertexBuffer.h"
reed@google.comac10a2d2010-12-22 21:39:39 +000021
robertphillips@google.com641f8b12012-07-31 19:15:58 +000022#include "SkClipStack.h"
bsalomon@google.comded4f4b2012-06-28 18:48:06 +000023#include "SkTemplates.h"
commit-bot@chromium.orga0b40282013-09-18 13:00:55 +000024#include "SkTypes.h"
bsalomon@google.comded4f4b2012-06-28 18:48:06 +000025
bsalomon@google.com471d4712011-08-23 15:45:25 +000026class GrGpu;
bsalomon@google.com1c13c962011-02-14 16:51:21 +000027class GrIndexBufferAllocPool;
bsalomon@google.com471d4712011-08-23 15:45:25 +000028class GrVertexBufferAllocPool;
reed@google.comac10a2d2010-12-22 21:39:39 +000029
bsalomon@google.com1c13c962011-02-14 16:51:21 +000030/**
bsalomon@google.com55e4a202013-01-11 13:54:21 +000031 * GrInOrderDrawBuffer is an implementation of GrDrawTarget that queues up draws for eventual
32 * playback into a GrGpu. In theory one draw buffer could playback into another. When index or
33 * vertex buffers are used as geometry sources it is the callers the draw buffer only holds
34 * references to the buffers. It is the callers responsibility to ensure that the data is still
35 * valid when the draw buffer is played back into a GrGpu. Similarly, it is the caller's
36 * responsibility to ensure that all referenced textures, buffers, and render-targets are associated
37 * in the GrGpu object that the buffer is played back into. The buffer requires VB and IB pools to
38 * store geometry.
skia.committer@gmail.com07d3a652013-04-10 07:01:15 +000039 */
joshualitt6db519c2014-10-29 08:48:18 -070040class GrInOrderDrawBuffer : public GrClipTarget {
reed@google.comac10a2d2010-12-22 21:39:39 +000041public:
42
bsalomon@google.com86afc2a2011-02-16 16:12:19 +000043 /**
44 * Creates a GrInOrderDrawBuffer
45 *
bsalomon@google.com6e4e6502013-02-25 20:12:45 +000046 * @param gpu the gpu object that this draw buffer flushes to.
bsalomon@google.com86afc2a2011-02-16 16:12:19 +000047 * @param vertexPool pool where vertices for queued draws will be saved when
48 * the vertex source is either reserved or array.
49 * @param indexPool pool where indices for queued draws will be saved when
50 * the index source is either reserved or array.
51 */
bsalomon@google.com6e4e6502013-02-25 20:12:45 +000052 GrInOrderDrawBuffer(GrGpu* gpu,
bsalomon@google.com471d4712011-08-23 15:45:25 +000053 GrVertexBufferAllocPool* vertexPool,
bsalomon@google.com1c13c962011-02-14 16:51:21 +000054 GrIndexBufferAllocPool* indexPool);
reed@google.comac10a2d2010-12-22 21:39:39 +000055
56 virtual ~GrInOrderDrawBuffer();
57
bsalomon@google.com86afc2a2011-02-16 16:12:19 +000058 /**
bsalomon@google.com55e4a202013-01-11 13:54:21 +000059 * Empties the draw buffer of any queued up draws. This must not be called while inside an
60 * unbalanced pushGeometrySource(). The current draw state and clip are preserved.
bsalomon@google.com86afc2a2011-02-16 16:12:19 +000061 */
62 void reset();
63
64 /**
bsalomon@google.com6e4e6502013-02-25 20:12:45 +000065 * This plays the queued up draws to its GrGpu target. It also resets this object (i.e. flushing
bsalomon@google.com55e4a202013-01-11 13:54:21 +000066 * is destructive). This buffer must not have an active reserved vertex or index source. Any
67 * reserved geometry on the target will be finalized because it's geometry source will be pushed
68 * before flushing and popped afterwards.
bsalomon@google.com86afc2a2011-02-16 16:12:19 +000069 */
robertphillips@google.com1267fbd2013-07-03 18:37:27 +000070 void flush();
bsalomon@google.com97805382012-03-13 14:32:07 +000071
commit-bot@chromium.orga8916ff2013-08-16 15:53:46 +000072 // tracking for draws
73 virtual DrawToken getCurrentDrawToken() { return DrawToken(this, fDrawID); }
74
bsalomon@google.com86afc2a2011-02-16 16:12:19 +000075 // overrides from GrDrawTarget
jvanverth@google.comb75b0a02013-02-05 20:33:30 +000076 virtual bool geometryHints(int* vertexCount,
bsalomon@google.com97805382012-03-13 14:32:07 +000077 int* indexCount) const SK_OVERRIDE;
joshualitt6db519c2014-10-29 08:48:18 -070078
commit-bot@chromium.orgfd03d4a2013-07-17 21:39:42 +000079 virtual void clear(const SkIRect* rect,
robertphillips@google.comc82a8b72012-06-21 20:15:48 +000080 GrColor color,
robertphillips@google.com56ce48a2013-10-31 21:44:25 +000081 bool canIgnoreRect,
commit-bot@chromium.org28361fa2014-03-28 16:08:05 +000082 GrRenderTarget* renderTarget) SK_OVERRIDE;
83
joshualitt6db519c2014-10-29 08:48:18 -070084 virtual void clearStencilClip(const SkIRect& rect,
85 bool insideClip,
86 GrRenderTarget* renderTarget) SK_OVERRIDE;
87
commit-bot@chromium.org28361fa2014-03-28 16:08:05 +000088 virtual void discard(GrRenderTarget*) SK_OVERRIDE;
bsalomon@google.com0b335c12011-04-25 19:17:44 +000089
bsalomonf2703d82014-10-28 14:33:06 -070090 virtual void initCopySurfaceDstDesc(const GrSurface* src, GrSurfaceDesc* desc) SK_OVERRIDE;
bsalomon@google.comeb851172013-04-15 13:51:00 +000091
bsalomon@google.com97805382012-03-13 14:32:07 +000092protected:
bsalomon@google.com02ddc8b2013-01-28 15:35:28 +000093 virtual void clipWillBeSet(const GrClipData* newClip) SK_OVERRIDE;
94
reed@google.comac10a2d2010-12-22 21:39:39 +000095private:
cdalton6819df32014-10-15 13:43:48 -070096 enum {
bsalomon@google.comded4f4b2012-06-28 18:48:06 +000097 kDraw_Cmd = 1,
98 kStencilPath_Cmd = 2,
99 kSetState_Cmd = 3,
100 kSetClip_Cmd = 4,
101 kClear_Cmd = 5,
bsalomon@google.com116ad842013-04-09 15:38:19 +0000102 kCopySurface_Cmd = 6,
commit-bot@chromium.org32184d82013-10-09 15:14:18 +0000103 kDrawPath_Cmd = 7,
commit-bot@chromium.org9b62aa12014-03-25 11:59:40 +0000104 kDrawPaths_Cmd = 8,
bsalomon@google.coma4f6b102012-06-26 21:04:22 +0000105 };
106
cdalton6819df32014-10-15 13:43:48 -0700107 struct Cmd : ::SkNoncopyable {
108 Cmd(uint8_t type) : fType(type) {}
109 virtual ~Cmd() {}
110
joshualitt6db519c2014-10-29 08:48:18 -0700111 virtual void execute(GrClipTarget*) = 0;
cdalton6819df32014-10-15 13:43:48 -0700112
113 uint8_t fType;
114 };
115
116 struct Draw : public Cmd {
bsalomonb3e3a952014-09-19 11:10:40 -0700117 Draw(const DrawInfo& info, const GrVertexBuffer* vb, const GrIndexBuffer* ib)
cdalton6819df32014-10-15 13:43:48 -0700118 : Cmd(kDraw_Cmd)
119 , fInfo(info)
bsalomon45725db2014-09-19 11:48:02 -0700120 , fVertexBuffer(vb)
121 , fIndexBuffer(ib) {}
bsalomonb3e3a952014-09-19 11:10:40 -0700122
123 const GrVertexBuffer* vertexBuffer() const { return fVertexBuffer.get(); }
124 const GrIndexBuffer* indexBuffer() const { return fIndexBuffer.get(); }
125
joshualitt6db519c2014-10-29 08:48:18 -0700126 virtual void execute(GrClipTarget*);
cdalton6819df32014-10-15 13:43:48 -0700127
128 DrawInfo fInfo;
129
bsalomonb3e3a952014-09-19 11:10:40 -0700130 private:
bsalomonbcf0a522014-10-08 08:40:09 -0700131 GrPendingIOResource<const GrVertexBuffer, kRead_GrIOType> fVertexBuffer;
132 GrPendingIOResource<const GrIndexBuffer, kRead_GrIOType> fIndexBuffer;
reed@google.comac10a2d2010-12-22 21:39:39 +0000133 };
134
cdalton6819df32014-10-15 13:43:48 -0700135 struct StencilPath : public Cmd {
136 StencilPath(const GrPath* path) : Cmd(kStencilPath_Cmd), fPath(path) {}
sugoi@google.com5f74cf82012-12-17 21:16:45 +0000137
bsalomonb3e3a952014-09-19 11:10:40 -0700138 const GrPath* path() const { return fPath.get(); }
139
joshualitt6db519c2014-10-29 08:48:18 -0700140 virtual void execute(GrClipTarget*);
cdalton6819df32014-10-15 13:43:48 -0700141
bsalomonb3e3a952014-09-19 11:10:40 -0700142 SkPath::FillType fFill;
143
144 private:
bsalomonbcf0a522014-10-08 08:40:09 -0700145 GrPendingIOResource<const GrPath, kRead_GrIOType> fPath;
bsalomon@google.comded4f4b2012-06-28 18:48:06 +0000146 };
147
cdalton6819df32014-10-15 13:43:48 -0700148 struct DrawPath : public Cmd {
149 DrawPath(const GrPath* path) : Cmd(kDrawPath_Cmd), fPath(path) {}
commit-bot@chromium.orgc4dc0ad2013-10-09 14:11:33 +0000150
bsalomonb3e3a952014-09-19 11:10:40 -0700151 const GrPath* path() const { return fPath.get(); }
152
joshualitt6db519c2014-10-29 08:48:18 -0700153 virtual void execute(GrClipTarget*);
cdalton6819df32014-10-15 13:43:48 -0700154
bsalomonb3e3a952014-09-19 11:10:40 -0700155 SkPath::FillType fFill;
156 GrDeviceCoordTexture fDstCopy;
157
158 private:
bsalomonbcf0a522014-10-08 08:40:09 -0700159 GrPendingIOResource<const GrPath, kRead_GrIOType> fPath;
commit-bot@chromium.orgc4dc0ad2013-10-09 14:11:33 +0000160 };
161
cdalton6819df32014-10-15 13:43:48 -0700162 struct DrawPaths : public Cmd {
163 DrawPaths(const GrPathRange* pathRange) : Cmd(kDrawPaths_Cmd), fPathRange(pathRange) {}
bsalomonb3e3a952014-09-19 11:10:40 -0700164
165 const GrPathRange* pathRange() const { return fPathRange.get(); }
cdalton6819df32014-10-15 13:43:48 -0700166 uint32_t* indices() { return reinterpret_cast<uint32_t*>(CmdBuffer::GetDataForItem(this)); }
167 float* transforms() { return reinterpret_cast<float*>(&this->indices()[fCount]); }
bsalomonb3e3a952014-09-19 11:10:40 -0700168
joshualitt6db519c2014-10-29 08:48:18 -0700169 virtual void execute(GrClipTarget*);
cdalton6819df32014-10-15 13:43:48 -0700170
bsalomonb3e3a952014-09-19 11:10:40 -0700171 size_t fCount;
bsalomonb3e3a952014-09-19 11:10:40 -0700172 PathTransformType fTransformsType;
173 SkPath::FillType fFill;
174 GrDeviceCoordTexture fDstCopy;
175
176 private:
bsalomonbcf0a522014-10-08 08:40:09 -0700177 GrPendingIOResource<const GrPathRange, kRead_GrIOType> fPathRange;
commit-bot@chromium.org9b62aa12014-03-25 11:59:40 +0000178 };
179
commit-bot@chromium.org28361fa2014-03-28 16:08:05 +0000180 // This is also used to record a discard by setting the color to GrColor_ILLEGAL
cdalton6819df32014-10-15 13:43:48 -0700181 struct Clear : public Cmd {
182 Clear(GrRenderTarget* rt) : Cmd(kClear_Cmd), fRenderTarget(rt) {}
183
bsalomonb3e3a952014-09-19 11:10:40 -0700184 GrRenderTarget* renderTarget() const { return fRenderTarget.get(); }
robertphillips@google.comc82a8b72012-06-21 20:15:48 +0000185
joshualitt6db519c2014-10-29 08:48:18 -0700186 virtual void execute(GrClipTarget*);
cdalton6819df32014-10-15 13:43:48 -0700187
bsalomonb3e3a952014-09-19 11:10:40 -0700188 SkIRect fRect;
189 GrColor fColor;
190 bool fCanIgnoreRect;
191
192 private:
bsalomonbcf0a522014-10-08 08:40:09 -0700193 GrPendingIOResource<GrRenderTarget, kWrite_GrIOType> fRenderTarget;
bsalomon@google.com0b335c12011-04-25 19:17:44 +0000194 };
195
joshualitt6db519c2014-10-29 08:48:18 -0700196 // This command is ONLY used by the clip mask manager to clear the stencil clip bits
197 struct ClearStencilClip : public Cmd {
198 ClearStencilClip(GrRenderTarget* rt) : Cmd(kClear_Cmd), fRenderTarget(rt) {}
199
200 GrRenderTarget* renderTarget() const { return fRenderTarget.get(); }
201
202 virtual void execute(GrClipTarget*);
203
204 SkIRect fRect;
205 bool fInsideClip;
206
207 private:
208 GrPendingIOResource<GrRenderTarget, kWrite_GrIOType> fRenderTarget;
209 };
210
cdalton6819df32014-10-15 13:43:48 -0700211 struct CopySurface : public Cmd {
212 CopySurface(GrSurface* dst, GrSurface* src) : Cmd(kCopySurface_Cmd), fDst(dst), fSrc(src) {}
bsalomonb3e3a952014-09-19 11:10:40 -0700213
214 GrSurface* dst() const { return fDst.get(); }
215 GrSurface* src() const { return fSrc.get(); }
216
joshualitt6db519c2014-10-29 08:48:18 -0700217 virtual void execute(GrClipTarget*);
cdalton6819df32014-10-15 13:43:48 -0700218
bsalomonb3e3a952014-09-19 11:10:40 -0700219 SkIPoint fDstPoint;
220 SkIRect fSrcRect;
221
222 private:
bsalomonbcf0a522014-10-08 08:40:09 -0700223 GrPendingIOResource<GrSurface, kWrite_GrIOType> fDst;
224 GrPendingIOResource<GrSurface, kRead_GrIOType> fSrc;
bsalomon@google.com116ad842013-04-09 15:38:19 +0000225 };
226
cdalton6819df32014-10-15 13:43:48 -0700227 struct SetState : public Cmd {
228 SetState(const GrDrawState& state) : Cmd(kSetState_Cmd), fState(state) {}
229
joshualitt6db519c2014-10-29 08:48:18 -0700230 virtual void execute(GrClipTarget*);
cdalton6819df32014-10-15 13:43:48 -0700231
232 GrDrawState fState;
bsalomonf0480b12014-07-02 12:11:24 -0700233 };
234
cdalton6819df32014-10-15 13:43:48 -0700235 struct SetClip : public Cmd {
236 SetClip(const GrClipData* clipData)
237 : Cmd(kSetClip_Cmd),
238 fStackStorage(*clipData->fClipStack) {
239 fClipData.fClipStack = &fStackStorage;
240 fClipData.fOrigin = clipData->fOrigin;
241 }
242
joshualitt6db519c2014-10-29 08:48:18 -0700243 virtual void execute(GrClipTarget*);
cdalton6819df32014-10-15 13:43:48 -0700244
245 GrClipData fClipData;
246
247 private:
248 SkClipStack fStackStorage;
249 };
250
251 typedef void* TCmdAlign; // This wouldn't be enough align if a command used long double.
252 typedef GrTRecorder<Cmd, TCmdAlign> CmdBuffer;
253
bsalomon@google.com25fb21f2011-06-21 18:17:25 +0000254 // overrides from GrDrawTarget
bsalomon@google.com74749cd2013-01-30 16:12:41 +0000255 virtual void onDraw(const DrawInfo&) SK_OVERRIDE;
commit-bot@chromium.orgfd03d4a2013-07-17 21:39:42 +0000256 virtual void onDrawRect(const SkRect& rect,
commit-bot@chromium.orgfd03d4a2013-07-17 21:39:42 +0000257 const SkRect* localRect,
bsalomon@google.com0406b9e2013-04-02 21:00:15 +0000258 const SkMatrix* localMatrix) SK_OVERRIDE;
commit-bot@chromium.org32184d82013-10-09 15:14:18 +0000259
260 virtual void onStencilPath(const GrPath*, SkPath::FillType) SK_OVERRIDE;
261 virtual void onDrawPath(const GrPath*, SkPath::FillType,
commit-bot@chromium.orgc4dc0ad2013-10-09 14:11:33 +0000262 const GrDeviceCoordTexture* dstCopy) SK_OVERRIDE;
cdaltonb85a0aa2014-07-21 15:32:44 -0700263 virtual void onDrawPaths(const GrPathRange*,
264 const uint32_t indices[], int count,
265 const float transforms[], PathTransformType,
266 SkPath::FillType, const GrDeviceCoordTexture*) SK_OVERRIDE;
commit-bot@chromium.org32184d82013-10-09 15:14:18 +0000267
jvanverth@google.coma6338982013-01-31 21:34:25 +0000268 virtual bool onReserveVertexSpace(size_t vertexSize,
bsalomon@google.com25fb21f2011-06-21 18:17:25 +0000269 int vertexCount,
bsalomon@google.com13f1b6f2012-05-31 12:52:43 +0000270 void** vertices) SK_OVERRIDE;
271 virtual bool onReserveIndexSpace(int indexCount,
272 void** indices) SK_OVERRIDE;
273 virtual void releaseReservedVertexSpace() SK_OVERRIDE;
274 virtual void releaseReservedIndexSpace() SK_OVERRIDE;
bsalomon@google.combcdbbe62011-04-12 15:40:00 +0000275 virtual void onSetVertexSourceToArray(const void* vertexArray,
bsalomon@google.com13f1b6f2012-05-31 12:52:43 +0000276 int vertexCount) SK_OVERRIDE;
bsalomon@google.combcdbbe62011-04-12 15:40:00 +0000277 virtual void onSetIndexSourceToArray(const void* indexArray,
bsalomon@google.com13f1b6f2012-05-31 12:52:43 +0000278 int indexCount) SK_OVERRIDE;
279 virtual void releaseVertexArray() SK_OVERRIDE;
280 virtual void releaseIndexArray() SK_OVERRIDE;
281 virtual void geometrySourceWillPush() SK_OVERRIDE;
bsalomon@google.com02ddc8b2013-01-28 15:35:28 +0000282 virtual void geometrySourceWillPop(const GeometrySrcState& restoredState) SK_OVERRIDE;
jvanverth@google.comb75b0a02013-02-05 20:33:30 +0000283 virtual void willReserveVertexAndIndexSpace(int vertexCount,
bsalomon@google.com02ddc8b2013-01-28 15:35:28 +0000284 int indexCount) SK_OVERRIDE;
bsalomon@google.com116ad842013-04-09 15:38:19 +0000285 virtual bool onCopySurface(GrSurface* dst,
286 GrSurface* src,
287 const SkIRect& srcRect,
288 const SkIPoint& dstPoint) SK_OVERRIDE;
289 virtual bool onCanCopySurface(GrSurface* dst,
290 GrSurface* src,
291 const SkIRect& srcRect,
292 const SkIPoint& dstPoint) SK_OVERRIDE;
293
bsalomon@google.comd62e88e2013-02-01 14:19:27 +0000294 bool quickInsideClip(const SkRect& devBounds);
bsalomon@google.com02ddc8b2013-01-28 15:35:28 +0000295
commit-bot@chromium.org2a05de02014-03-25 15:17:32 +0000296 virtual void didAddGpuTraceMarker() SK_OVERRIDE {}
297 virtual void didRemoveGpuTraceMarker() SK_OVERRIDE {}
commit-bot@chromium.orga3baf3b2014-02-21 18:45:30 +0000298
bsalomon@google.comd62e88e2013-02-01 14:19:27 +0000299 // Attempts to concat instances from info onto the previous draw. info must represent an
300 // instanced draw. The caller must have already recorded a new draw state and clip if necessary.
301 int concatInstancedDraw(const DrawInfo& info);
bsalomon@google.com1c13c962011-02-14 16:51:21 +0000302
bsalomon838f62d2014-08-05 07:15:57 -0700303 // Determines whether the current draw operation requieres a new drawstate and if so records it.
304 void recordStateIfNecessary();
305 // We lazily record clip changes in order to skip clips that have no effect.
cdalton6819df32014-10-15 13:43:48 -0700306 void recordClipIfNecessary();
307 // Records any trace markers for a command after adding it to the buffer.
308 void recordTraceMarkersIfNecessary();
bsalomonb3e3a952014-09-19 11:10:40 -0700309
310 virtual bool isIssued(uint32_t drawID) { return drawID != fDrawID; }
bsalomon@google.com934c5702012-03-20 21:17:58 +0000311
bsalomon@google.com116ad842013-04-09 15:38:19 +0000312 // TODO: Use a single allocator for commands and records
bsalomon@google.com4b90c622011-09-28 17:52:15 +0000313 enum {
cdalton6819df32014-10-15 13:43:48 -0700314 kCmdBufferInitialSizeInBytes = 64 * 1024,
315 kGeoPoolStatePreAllocCnt = 4,
bsalomon@google.com4b90c622011-09-28 17:52:15 +0000316 };
reed@google.comac10a2d2010-12-22 21:39:39 +0000317
cdalton6819df32014-10-15 13:43:48 -0700318 CmdBuffer fCmdBuffer;
319 GrDrawState* fLastState;
320 GrClipData* fLastClip;
bsalomonbce3d6d2014-07-02 07:54:42 -0700321
cdalton6819df32014-10-15 13:43:48 -0700322 SkTArray<GrTraceMarkerSet, false> fGpuCmdMarkers;
joshualitt6db519c2014-10-29 08:48:18 -0700323 GrClipTarget* fDstGpu;
cdalton6819df32014-10-15 13:43:48 -0700324 bool fClipSet;
bsalomon@google.com86afc2a2011-02-16 16:12:19 +0000325
bsalomon@google.comd62e88e2013-02-01 14:19:27 +0000326 enum ClipProxyState {
327 kUnknown_ClipProxyState,
328 kValid_ClipProxyState,
329 kInvalid_ClipProxyState
330 };
bsalomon@google.comd62e88e2013-02-01 14:19:27 +0000331
bsalomonb3e3a952014-09-19 11:10:40 -0700332 ClipProxyState fClipProxyState;
333 SkRect fClipProxy;
334 GrVertexBufferAllocPool& fVertexPool;
335 GrIndexBufferAllocPool& fIndexPool;
bsalomon@google.com934c5702012-03-20 21:17:58 +0000336
bsalomon@google.com25fb21f2011-06-21 18:17:25 +0000337 struct GeometryPoolState {
bsalomonb3e3a952014-09-19 11:10:40 -0700338 const GrVertexBuffer* fPoolVertexBuffer;
339 int fPoolStartVertex;
340 const GrIndexBuffer* fPoolIndexBuffer;
341 int fPoolStartIndex;
bsalomon@google.com25fb21f2011-06-21 18:17:25 +0000342 // caller may conservatively over reserve vertices / indices.
343 // we release unused space back to allocator if possible
344 // can only do this if there isn't an intervening pushGeometrySource()
bsalomonb3e3a952014-09-19 11:10:40 -0700345 size_t fUsedPoolVertexBytes;
346 size_t fUsedPoolIndexBytes;
bsalomon@google.com25fb21f2011-06-21 18:17:25 +0000347 };
reed@google.comac10a2d2010-12-22 21:39:39 +0000348
bsalomonb3e3a952014-09-19 11:10:40 -0700349 typedef SkSTArray<kGeoPoolStatePreAllocCnt, GeometryPoolState> GeoPoolStateStack;
skia.committer@gmail.com74758112013-08-17 07:01:54 +0000350
bsalomonb3e3a952014-09-19 11:10:40 -0700351 GeoPoolStateStack fGeoPoolStateStack;
352 bool fFlushing;
353 uint32_t fDrawID;
robertphillips@google.comc82a8b72012-06-21 20:15:48 +0000354
joshualitt6db519c2014-10-29 08:48:18 -0700355 typedef GrClipTarget INHERITED;
reed@google.comac10a2d2010-12-22 21:39:39 +0000356};
357
358#endif