blob: c89823636bc093f6610580483954f6ffd31ff86a [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"
joshualittd53a8272014-11-10 16:03:14 -080014#include "GrGpu.h"
bsalomonb3e3a952014-09-19 11:10:40 -070015#include "GrIndexBuffer.h"
16#include "GrRenderTarget.h"
bsalomon@google.comded4f4b2012-06-28 18:48:06 +000017#include "GrPath.h"
bsalomonb3e3a952014-09-19 11:10:40 -070018#include "GrPathRange.h"
19#include "GrSurface.h"
cdalton6819df32014-10-15 13:43:48 -070020#include "GrTRecorder.h"
bsalomonb3e3a952014-09-19 11:10:40 -070021#include "GrVertexBuffer.h"
reed@google.comac10a2d2010-12-22 21:39:39 +000022
robertphillips@google.com641f8b12012-07-31 19:15:58 +000023#include "SkClipStack.h"
bsalomon@google.comded4f4b2012-06-28 18:48:06 +000024#include "SkTemplates.h"
commit-bot@chromium.orga0b40282013-09-18 13:00:55 +000025#include "SkTypes.h"
bsalomon@google.comded4f4b2012-06-28 18:48:06 +000026
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
joshualitt9853cce2014-11-17 14:22:48 -080076 virtual bool geometryHints(size_t vertexStride,
77 int* vertexCount,
bsalomon@google.com97805382012-03-13 14:32:07 +000078 int* indexCount) const SK_OVERRIDE;
joshualitt6db519c2014-10-29 08:48:18 -070079
joshualitta7024152014-11-03 14:16:35 -080080 virtual bool copySurface(GrSurface* dst,
81 GrSurface* src,
82 const SkIRect& srcRect,
83 const SkIPoint& dstPoint) SK_OVERRIDE;
84
joshualitt9853cce2014-11-17 14:22:48 -080085 virtual bool canCopySurface(const GrSurface* dst,
86 const GrSurface* src,
joshualitta7024152014-11-03 14:16:35 -080087 const SkIRect& srcRect,
88 const SkIPoint& dstPoint) SK_OVERRIDE;
89
joshualitt6db519c2014-10-29 08:48:18 -070090 virtual void clearStencilClip(const SkIRect& rect,
91 bool insideClip,
92 GrRenderTarget* renderTarget) SK_OVERRIDE;
93
commit-bot@chromium.org28361fa2014-03-28 16:08:05 +000094 virtual void discard(GrRenderTarget*) SK_OVERRIDE;
bsalomon@google.com0b335c12011-04-25 19:17:44 +000095
bsalomonf2703d82014-10-28 14:33:06 -070096 virtual void initCopySurfaceDstDesc(const GrSurface* src, GrSurfaceDesc* desc) SK_OVERRIDE;
bsalomon@google.comeb851172013-04-15 13:51:00 +000097
reed@google.comac10a2d2010-12-22 21:39:39 +000098private:
joshualitt2c93efe2014-11-06 12:57:13 -080099 typedef GrClipMaskManager::ScissorState ScissorState;
cdalton6819df32014-10-15 13:43:48 -0700100 enum {
bsalomon@google.comded4f4b2012-06-28 18:48:06 +0000101 kDraw_Cmd = 1,
102 kStencilPath_Cmd = 2,
103 kSetState_Cmd = 3,
joshualitt2c93efe2014-11-06 12:57:13 -0800104 kClear_Cmd = 4,
105 kCopySurface_Cmd = 5,
106 kDrawPath_Cmd = 6,
107 kDrawPaths_Cmd = 7,
bsalomon@google.coma4f6b102012-06-26 21:04:22 +0000108 };
109
cdalton6819df32014-10-15 13:43:48 -0700110 struct Cmd : ::SkNoncopyable {
111 Cmd(uint8_t type) : fType(type) {}
112 virtual ~Cmd() {}
113
cdalton3fc6a2f2014-11-13 11:54:20 -0800114 virtual void execute(GrInOrderDrawBuffer*, const GrOptDrawState*) = 0;
cdalton6819df32014-10-15 13:43:48 -0700115
116 uint8_t fType;
117 };
118
119 struct Draw : public Cmd {
joshualitt2c93efe2014-11-06 12:57:13 -0800120 Draw(const DrawInfo& info,
121 const ScissorState& scissorState,
122 const GrVertexBuffer* vb,
123 const GrIndexBuffer* ib)
cdalton6819df32014-10-15 13:43:48 -0700124 : Cmd(kDraw_Cmd)
125 , fInfo(info)
joshualitt2c93efe2014-11-06 12:57:13 -0800126 , fScissorState(scissorState)
bsalomon45725db2014-09-19 11:48:02 -0700127 , fVertexBuffer(vb)
128 , fIndexBuffer(ib) {}
bsalomonb3e3a952014-09-19 11:10:40 -0700129
130 const GrVertexBuffer* vertexBuffer() const { return fVertexBuffer.get(); }
131 const GrIndexBuffer* indexBuffer() const { return fIndexBuffer.get(); }
132
cdalton3fc6a2f2014-11-13 11:54:20 -0800133 virtual void execute(GrInOrderDrawBuffer*, const GrOptDrawState*);
cdalton6819df32014-10-15 13:43:48 -0700134
joshualitt2c93efe2014-11-06 12:57:13 -0800135 DrawInfo fInfo;
136 ScissorState fScissorState;
cdalton6819df32014-10-15 13:43:48 -0700137
bsalomonb3e3a952014-09-19 11:10:40 -0700138 private:
bsalomonbcf0a522014-10-08 08:40:09 -0700139 GrPendingIOResource<const GrVertexBuffer, kRead_GrIOType> fVertexBuffer;
140 GrPendingIOResource<const GrIndexBuffer, kRead_GrIOType> fIndexBuffer;
reed@google.comac10a2d2010-12-22 21:39:39 +0000141 };
142
cdalton6819df32014-10-15 13:43:48 -0700143 struct StencilPath : public Cmd {
144 StencilPath(const GrPath* path) : Cmd(kStencilPath_Cmd), fPath(path) {}
sugoi@google.com5f74cf82012-12-17 21:16:45 +0000145
bsalomonb3e3a952014-09-19 11:10:40 -0700146 const GrPath* path() const { return fPath.get(); }
147
cdalton3fc6a2f2014-11-13 11:54:20 -0800148 virtual void execute(GrInOrderDrawBuffer*, const GrOptDrawState*);
cdalton6819df32014-10-15 13:43:48 -0700149
joshualitt2c93efe2014-11-06 12:57:13 -0800150 ScissorState fScissorState;
151 GrStencilSettings fStencilSettings;
bsalomonb3e3a952014-09-19 11:10:40 -0700152
153 private:
bsalomonbcf0a522014-10-08 08:40:09 -0700154 GrPendingIOResource<const GrPath, kRead_GrIOType> fPath;
bsalomon@google.comded4f4b2012-06-28 18:48:06 +0000155 };
156
cdalton6819df32014-10-15 13:43:48 -0700157 struct DrawPath : public Cmd {
158 DrawPath(const GrPath* path) : Cmd(kDrawPath_Cmd), fPath(path) {}
commit-bot@chromium.orgc4dc0ad2013-10-09 14:11:33 +0000159
bsalomonb3e3a952014-09-19 11:10:40 -0700160 const GrPath* path() const { return fPath.get(); }
161
cdalton3fc6a2f2014-11-13 11:54:20 -0800162 virtual void execute(GrInOrderDrawBuffer*, const GrOptDrawState*);
cdalton6819df32014-10-15 13:43:48 -0700163
joshualitt2c93efe2014-11-06 12:57:13 -0800164 GrDeviceCoordTexture fDstCopy;
165 ScissorState fScissorState;
166 GrStencilSettings fStencilSettings;
bsalomonb3e3a952014-09-19 11:10:40 -0700167
168 private:
bsalomonbcf0a522014-10-08 08:40:09 -0700169 GrPendingIOResource<const GrPath, kRead_GrIOType> fPath;
commit-bot@chromium.orgc4dc0ad2013-10-09 14:11:33 +0000170 };
171
cdalton6819df32014-10-15 13:43:48 -0700172 struct DrawPaths : public Cmd {
173 DrawPaths(const GrPathRange* pathRange) : Cmd(kDrawPaths_Cmd), fPathRange(pathRange) {}
bsalomonb3e3a952014-09-19 11:10:40 -0700174
175 const GrPathRange* pathRange() const { return fPathRange.get(); }
176
cdalton3fc6a2f2014-11-13 11:54:20 -0800177 virtual void execute(GrInOrderDrawBuffer*, const GrOptDrawState*);
cdalton6819df32014-10-15 13:43:48 -0700178
cdalton3fc6a2f2014-11-13 11:54:20 -0800179 int fIndicesLocation;
joshualitt2c93efe2014-11-06 12:57:13 -0800180 size_t fCount;
cdalton3fc6a2f2014-11-13 11:54:20 -0800181 int fTransformsLocation;
joshualitt2c93efe2014-11-06 12:57:13 -0800182 PathTransformType fTransformsType;
183 GrDeviceCoordTexture fDstCopy;
184 ScissorState fScissorState;
185 GrStencilSettings fStencilSettings;
bsalomonb3e3a952014-09-19 11:10:40 -0700186
187 private:
bsalomonbcf0a522014-10-08 08:40:09 -0700188 GrPendingIOResource<const GrPathRange, kRead_GrIOType> fPathRange;
commit-bot@chromium.org9b62aa12014-03-25 11:59:40 +0000189 };
190
commit-bot@chromium.org28361fa2014-03-28 16:08:05 +0000191 // This is also used to record a discard by setting the color to GrColor_ILLEGAL
cdalton6819df32014-10-15 13:43:48 -0700192 struct Clear : public Cmd {
193 Clear(GrRenderTarget* rt) : Cmd(kClear_Cmd), fRenderTarget(rt) {}
194
bsalomonb3e3a952014-09-19 11:10:40 -0700195 GrRenderTarget* renderTarget() const { return fRenderTarget.get(); }
robertphillips@google.comc82a8b72012-06-21 20:15:48 +0000196
cdalton3fc6a2f2014-11-13 11:54:20 -0800197 virtual void execute(GrInOrderDrawBuffer*, const GrOptDrawState*);
cdalton6819df32014-10-15 13:43:48 -0700198
bsalomonb3e3a952014-09-19 11:10:40 -0700199 SkIRect fRect;
200 GrColor fColor;
201 bool fCanIgnoreRect;
202
203 private:
bsalomonbcf0a522014-10-08 08:40:09 -0700204 GrPendingIOResource<GrRenderTarget, kWrite_GrIOType> fRenderTarget;
bsalomon@google.com0b335c12011-04-25 19:17:44 +0000205 };
206
joshualitt6db519c2014-10-29 08:48:18 -0700207 // This command is ONLY used by the clip mask manager to clear the stencil clip bits
208 struct ClearStencilClip : public Cmd {
209 ClearStencilClip(GrRenderTarget* rt) : Cmd(kClear_Cmd), fRenderTarget(rt) {}
210
211 GrRenderTarget* renderTarget() const { return fRenderTarget.get(); }
212
cdalton3fc6a2f2014-11-13 11:54:20 -0800213 virtual void execute(GrInOrderDrawBuffer*, const GrOptDrawState*);
joshualitt6db519c2014-10-29 08:48:18 -0700214
215 SkIRect fRect;
216 bool fInsideClip;
217
218 private:
219 GrPendingIOResource<GrRenderTarget, kWrite_GrIOType> fRenderTarget;
220 };
221
cdalton6819df32014-10-15 13:43:48 -0700222 struct CopySurface : public Cmd {
223 CopySurface(GrSurface* dst, GrSurface* src) : Cmd(kCopySurface_Cmd), fDst(dst), fSrc(src) {}
bsalomonb3e3a952014-09-19 11:10:40 -0700224
225 GrSurface* dst() const { return fDst.get(); }
226 GrSurface* src() const { return fSrc.get(); }
227
cdalton3fc6a2f2014-11-13 11:54:20 -0800228 virtual void execute(GrInOrderDrawBuffer*, const GrOptDrawState*);
cdalton6819df32014-10-15 13:43:48 -0700229
bsalomonb3e3a952014-09-19 11:10:40 -0700230 SkIPoint fDstPoint;
231 SkIRect fSrcRect;
232
233 private:
bsalomonbcf0a522014-10-08 08:40:09 -0700234 GrPendingIOResource<GrSurface, kWrite_GrIOType> fDst;
235 GrPendingIOResource<GrSurface, kRead_GrIOType> fSrc;
bsalomon@google.com116ad842013-04-09 15:38:19 +0000236 };
237
cdalton6819df32014-10-15 13:43:48 -0700238 struct SetState : public Cmd {
239 SetState(const GrDrawState& state) : Cmd(kSetState_Cmd), fState(state) {}
240
cdalton3fc6a2f2014-11-13 11:54:20 -0800241 virtual void execute(GrInOrderDrawBuffer*, const GrOptDrawState*);
cdalton6819df32014-10-15 13:43:48 -0700242
243 GrDrawState fState;
joshualittd53a8272014-11-10 16:03:14 -0800244 GrGpu::DrawType fDrawType;
245 GrDeviceCoordTexture fDstCopy;
bsalomonf0480b12014-07-02 12:11:24 -0700246 };
247
cdalton6819df32014-10-15 13:43:48 -0700248 typedef void* TCmdAlign; // This wouldn't be enough align if a command used long double.
249 typedef GrTRecorder<Cmd, TCmdAlign> CmdBuffer;
250
bsalomon@google.com25fb21f2011-06-21 18:17:25 +0000251 // overrides from GrDrawTarget
joshualitt9853cce2014-11-17 14:22:48 -0800252 virtual void onDraw(const GrDrawState&,
253 const DrawInfo&,
254 const GrClipMaskManager::ScissorState&) SK_OVERRIDE;
255 virtual void onDrawRect(GrDrawState*,
256 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
joshualitt9853cce2014-11-17 14:22:48 -0800260 virtual void onStencilPath(const GrDrawState&,
261 const GrPath*,
joshualitt2c93efe2014-11-06 12:57:13 -0800262 const GrClipMaskManager::ScissorState&,
263 const GrStencilSettings&) SK_OVERRIDE;
joshualitt9853cce2014-11-17 14:22:48 -0800264 virtual void onDrawPath(const GrDrawState&,
265 const GrPath*,
joshualitt2c93efe2014-11-06 12:57:13 -0800266 const GrClipMaskManager::ScissorState&,
267 const GrStencilSettings&,
commit-bot@chromium.orgc4dc0ad2013-10-09 14:11:33 +0000268 const GrDeviceCoordTexture* dstCopy) SK_OVERRIDE;
joshualitt9853cce2014-11-17 14:22:48 -0800269 virtual void onDrawPaths(const GrDrawState&,
270 const GrPathRange*,
joshualitt2c93efe2014-11-06 12:57:13 -0800271 const uint32_t indices[],
272 int count,
273 const float transforms[],
274 PathTransformType,
275 const GrClipMaskManager::ScissorState&,
276 const GrStencilSettings&,
277 const GrDeviceCoordTexture*) SK_OVERRIDE;
bsalomon63b21962014-11-05 07:05:34 -0800278 virtual void onClear(const SkIRect* rect,
279 GrColor color,
280 bool canIgnoreRect,
281 GrRenderTarget* renderTarget) SK_OVERRIDE;
commit-bot@chromium.org32184d82013-10-09 15:14:18 +0000282
jvanverth@google.coma6338982013-01-31 21:34:25 +0000283 virtual bool onReserveVertexSpace(size_t vertexSize,
bsalomon@google.com25fb21f2011-06-21 18:17:25 +0000284 int vertexCount,
bsalomon@google.com13f1b6f2012-05-31 12:52:43 +0000285 void** vertices) SK_OVERRIDE;
286 virtual bool onReserveIndexSpace(int indexCount,
287 void** indices) SK_OVERRIDE;
288 virtual void releaseReservedVertexSpace() SK_OVERRIDE;
289 virtual void releaseReservedIndexSpace() SK_OVERRIDE;
bsalomon@google.com13f1b6f2012-05-31 12:52:43 +0000290 virtual void geometrySourceWillPush() SK_OVERRIDE;
bsalomon@google.com02ddc8b2013-01-28 15:35:28 +0000291 virtual void geometrySourceWillPop(const GeometrySrcState& restoredState) SK_OVERRIDE;
jvanverth@google.comb75b0a02013-02-05 20:33:30 +0000292 virtual void willReserveVertexAndIndexSpace(int vertexCount,
joshualitt9853cce2014-11-17 14:22:48 -0800293 size_t vertexStride,
bsalomon@google.com02ddc8b2013-01-28 15:35:28 +0000294 int indexCount) SK_OVERRIDE;
bsalomon@google.com116ad842013-04-09 15:38:19 +0000295
bsalomon@google.comd62e88e2013-02-01 14:19:27 +0000296 // Attempts to concat instances from info onto the previous draw. info must represent an
297 // instanced draw. The caller must have already recorded a new draw state and clip if necessary.
joshualitt9853cce2014-11-17 14:22:48 -0800298 int concatInstancedDraw(const GrDrawState&,
299 const DrawInfo&,
300 const GrClipMaskManager::ScissorState&);
bsalomon@google.com1c13c962011-02-14 16:51:21 +0000301
bsalomon838f62d2014-08-05 07:15:57 -0700302 // Determines whether the current draw operation requieres a new drawstate and if so records it.
joshualitt9853cce2014-11-17 14:22:48 -0800303 void recordStateIfNecessary(const GrDrawState&, GrGpu::DrawType, const GrDeviceCoordTexture*);
bsalomon838f62d2014-08-05 07:15:57 -0700304 // We lazily record clip changes in order to skip clips that have no effect.
cdalton6819df32014-10-15 13:43:48 -0700305 void recordClipIfNecessary();
306 // Records any trace markers for a command after adding it to the buffer.
307 void recordTraceMarkersIfNecessary();
bsalomonb3e3a952014-09-19 11:10:40 -0700308
309 virtual bool isIssued(uint32_t drawID) { return drawID != fDrawID; }
bsalomon@google.com934c5702012-03-20 21:17:58 +0000310
bsalomon@google.com116ad842013-04-09 15:38:19 +0000311 // TODO: Use a single allocator for commands and records
bsalomon@google.com4b90c622011-09-28 17:52:15 +0000312 enum {
cdaltonc4650ee2014-11-07 12:51:18 -0800313 kCmdBufferInitialSizeInBytes = 8 * 1024,
cdalton3fc6a2f2014-11-13 11:54:20 -0800314 kPathIdxBufferMinReserve = 64,
315 kPathXformBufferMinReserve = 2 * kPathIdxBufferMinReserve,
cdalton6819df32014-10-15 13:43:48 -0700316 kGeoPoolStatePreAllocCnt = 4,
bsalomon@google.com4b90c622011-09-28 17:52:15 +0000317 };
reed@google.comac10a2d2010-12-22 21:39:39 +0000318
cdalton6819df32014-10-15 13:43:48 -0700319 CmdBuffer fCmdBuffer;
320 GrDrawState* fLastState;
cdalton6819df32014-10-15 13:43:48 -0700321 SkTArray<GrTraceMarkerSet, false> fGpuCmdMarkers;
joshualitt3322fa42014-11-07 08:48:51 -0800322 GrGpu* fDstGpu;
joshualitt2c93efe2014-11-06 12:57:13 -0800323 GrVertexBufferAllocPool& fVertexPool;
324 GrIndexBufferAllocPool& fIndexPool;
cdalton3fc6a2f2014-11-13 11:54:20 -0800325 SkTDArray<uint32_t> fPathIndexBuffer;
326 SkTDArray<float> fPathTransformBuffer;
bsalomon@google.com934c5702012-03-20 21:17:58 +0000327
bsalomon@google.com25fb21f2011-06-21 18:17:25 +0000328 struct GeometryPoolState {
bsalomonb3e3a952014-09-19 11:10:40 -0700329 const GrVertexBuffer* fPoolVertexBuffer;
330 int fPoolStartVertex;
331 const GrIndexBuffer* fPoolIndexBuffer;
332 int fPoolStartIndex;
bsalomon@google.com25fb21f2011-06-21 18:17:25 +0000333 // caller may conservatively over reserve vertices / indices.
334 // we release unused space back to allocator if possible
335 // can only do this if there isn't an intervening pushGeometrySource()
bsalomonb3e3a952014-09-19 11:10:40 -0700336 size_t fUsedPoolVertexBytes;
337 size_t fUsedPoolIndexBytes;
bsalomon@google.com25fb21f2011-06-21 18:17:25 +0000338 };
reed@google.comac10a2d2010-12-22 21:39:39 +0000339
bsalomonb3e3a952014-09-19 11:10:40 -0700340 typedef SkSTArray<kGeoPoolStatePreAllocCnt, GeometryPoolState> GeoPoolStateStack;
skia.committer@gmail.com74758112013-08-17 07:01:54 +0000341
bsalomonb3e3a952014-09-19 11:10:40 -0700342 GeoPoolStateStack fGeoPoolStateStack;
343 bool fFlushing;
344 uint32_t fDrawID;
robertphillips@google.comc82a8b72012-06-21 20:15:48 +0000345
joshualitt6db519c2014-10-29 08:48:18 -0700346 typedef GrClipTarget INHERITED;
reed@google.comac10a2d2010-12-22 21:39:39 +0000347};
348
349#endif