| epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 1 | |
| reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 2 | /* |
| epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 3 | * Copyright 2011 Google Inc. |
| 4 | * |
| 5 | * Use of this source code is governed by a BSD-style license that can be |
| 6 | * found in the LICENSE file. |
| reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 7 | */ |
| 8 | |
| 9 | |
| epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 10 | |
| reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 11 | #ifndef GrInOrderDrawBuffer_DEFINED |
| 12 | #define GrInOrderDrawBuffer_DEFINED |
| 13 | |
| 14 | #include "GrDrawTarget.h" |
| 15 | #include "GrAllocPool.h" |
| 16 | #include "GrAllocator.h" |
| bsalomon@google.com | ded4f4b | 2012-06-28 18:48:06 +0000 | [diff] [blame] | 17 | #include "GrPath.h" |
| reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 18 | |
| robertphillips@google.com | 641f8b1 | 2012-07-31 19:15:58 +0000 | [diff] [blame] | 19 | #include "SkClipStack.h" |
| sugoi@google.com | 5f74cf8 | 2012-12-17 21:16:45 +0000 | [diff] [blame] | 20 | #include "SkStrokeRec.h" |
| bsalomon@google.com | ded4f4b | 2012-06-28 18:48:06 +0000 | [diff] [blame] | 21 | #include "SkTemplates.h" |
| 22 | |
| bsalomon@google.com | 471d471 | 2011-08-23 15:45:25 +0000 | [diff] [blame] | 23 | class GrGpu; |
| bsalomon@google.com | 1c13c96 | 2011-02-14 16:51:21 +0000 | [diff] [blame] | 24 | class GrIndexBufferAllocPool; |
| bsalomon@google.com | 471d471 | 2011-08-23 15:45:25 +0000 | [diff] [blame] | 25 | class GrVertexBufferAllocPool; |
| reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 26 | |
| bsalomon@google.com | 1c13c96 | 2011-02-14 16:51:21 +0000 | [diff] [blame] | 27 | /** |
| bsalomon@google.com | 55e4a20 | 2013-01-11 13:54:21 +0000 | [diff] [blame^] | 28 | * 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 |
| 30 | * 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 the data is still |
| 32 | * valid when the draw buffer is played back into a GrGpu. Similarly, it is the caller's |
| 33 | * responsibility to ensure that all referenced textures, buffers, and render-targets are associated |
| 34 | * in the GrGpu object that the buffer is played back into. The buffer requires VB and IB pools to |
| 35 | * store geometry. |
| bsalomon@google.com | 1c13c96 | 2011-02-14 16:51:21 +0000 | [diff] [blame] | 36 | */ |
| reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 37 | class GrInOrderDrawBuffer : public GrDrawTarget { |
| 38 | public: |
| 39 | |
| bsalomon@google.com | 86afc2a | 2011-02-16 16:12:19 +0000 | [diff] [blame] | 40 | /** |
| 41 | * Creates a GrInOrderDrawBuffer |
| 42 | * |
| bsalomon@google.com | 471d471 | 2011-08-23 15:45:25 +0000 | [diff] [blame] | 43 | * @param gpu the gpu object where this will be played back |
| 44 | * (possible indirectly). GrResources used with the draw |
| 45 | * buffer are created by this gpu object. |
| bsalomon@google.com | 86afc2a | 2011-02-16 16:12:19 +0000 | [diff] [blame] | 46 | * @param vertexPool pool where vertices for queued draws will be saved when |
| 47 | * the vertex source is either reserved or array. |
| 48 | * @param indexPool pool where indices for queued draws will be saved when |
| 49 | * the index source is either reserved or array. |
| 50 | */ |
| bsalomon@google.com | 471d471 | 2011-08-23 15:45:25 +0000 | [diff] [blame] | 51 | GrInOrderDrawBuffer(const GrGpu* gpu, |
| 52 | GrVertexBufferAllocPool* vertexPool, |
| bsalomon@google.com | 1c13c96 | 2011-02-14 16:51:21 +0000 | [diff] [blame] | 53 | GrIndexBufferAllocPool* indexPool); |
| reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 54 | |
| 55 | virtual ~GrInOrderDrawBuffer(); |
| 56 | |
| bsalomon@google.com | 86afc2a | 2011-02-16 16:12:19 +0000 | [diff] [blame] | 57 | /** |
| bsalomon@google.com | 86afc2a | 2011-02-16 16:12:19 +0000 | [diff] [blame] | 58 | * Provides the buffer with an index buffer that can be used for quad rendering. |
| 59 | * The buffer may be able to batch consecutive drawRects if this is provided. |
| 60 | * @param indexBuffer index buffer with quad indices. |
| 61 | */ |
| 62 | void setQuadIndexBuffer(const GrIndexBuffer* indexBuffer); |
| 63 | |
| 64 | /** |
| bsalomon@google.com | 55e4a20 | 2013-01-11 13:54:21 +0000 | [diff] [blame^] | 65 | * Empties the draw buffer of any queued up draws. This must not be called while inside an |
| 66 | * unbalanced pushGeometrySource(). The current draw state and clip are preserved. |
| bsalomon@google.com | 86afc2a | 2011-02-16 16:12:19 +0000 | [diff] [blame] | 67 | */ |
| 68 | void reset(); |
| 69 | |
| 70 | /** |
| bsalomon@google.com | 55e4a20 | 2013-01-11 13:54:21 +0000 | [diff] [blame^] | 71 | * This plays the queued up draws to another target. It also resets this object (i.e. flushing |
| 72 | * is destructive). This buffer must not have an active reserved vertex or index source. Any |
| 73 | * reserved geometry on the target will be finalized because it's geometry source will be pushed |
| 74 | * before flushing and popped afterwards. |
| bsalomon@google.com | 9780538 | 2012-03-13 14:32:07 +0000 | [diff] [blame] | 75 | * |
| bsalomon@google.com | 55e4a20 | 2013-01-11 13:54:21 +0000 | [diff] [blame^] | 76 | * @return false if the playback trivially drew nothing because nothing was recorded. |
| bsalomon@google.com | a4f6b10 | 2012-06-26 21:04:22 +0000 | [diff] [blame] | 77 | * |
| bsalomon@google.com | 86afc2a | 2011-02-16 16:12:19 +0000 | [diff] [blame] | 78 | * @param target the target to receive the playback |
| 79 | */ |
| bsalomon@google.com | 55e4a20 | 2013-01-11 13:54:21 +0000 | [diff] [blame^] | 80 | bool flushTo(GrDrawTarget* target); |
| bsalomon@google.com | 9780538 | 2012-03-13 14:32:07 +0000 | [diff] [blame] | 81 | |
| 82 | /** |
| bsalomon@google.com | 55e4a20 | 2013-01-11 13:54:21 +0000 | [diff] [blame^] | 83 | * This function allows the draw buffer to automatically flush itself to another target. This |
| 84 | * means the buffer may internally call this->flushTo(target) when it is safe to do so. |
| rmistry@google.com | fbfcd56 | 2012-08-23 18:09:54 +0000 | [diff] [blame] | 85 | * |
| bsalomon@google.com | 55e4a20 | 2013-01-11 13:54:21 +0000 | [diff] [blame^] | 86 | * When the auto flush target is set to NULL (as it initially is) the draw buffer will never |
| 87 | * automatically flush itself. |
| bsalomon@google.com | 9780538 | 2012-03-13 14:32:07 +0000 | [diff] [blame] | 88 | */ |
| 89 | void setAutoFlushTarget(GrDrawTarget* target); |
| 90 | |
| bsalomon@google.com | 86afc2a | 2011-02-16 16:12:19 +0000 | [diff] [blame] | 91 | // overrides from GrDrawTarget |
| rmistry@google.com | fbfcd56 | 2012-08-23 18:09:54 +0000 | [diff] [blame] | 92 | virtual void drawRect(const GrRect& rect, |
| bsalomon@google.com | b9086a0 | 2012-11-01 18:02:54 +0000 | [diff] [blame] | 93 | const SkMatrix* matrix = NULL, |
| bsalomon@google.com | 86afc2a | 2011-02-16 16:12:19 +0000 | [diff] [blame] | 94 | const GrRect* srcRects[] = NULL, |
| bsalomon@google.com | b9086a0 | 2012-11-01 18:02:54 +0000 | [diff] [blame] | 95 | const SkMatrix* srcMatrices[] = NULL) SK_OVERRIDE; |
| bsalomon@google.com | 86afc2a | 2011-02-16 16:12:19 +0000 | [diff] [blame] | 96 | |
| bsalomon@google.com | 934c570 | 2012-03-20 21:17:58 +0000 | [diff] [blame] | 97 | virtual void drawIndexedInstances(GrPrimitiveType type, |
| 98 | int instanceCount, |
| 99 | int verticesPerInstance, |
| 100 | int indicesPerInstance) |
| 101 | SK_OVERRIDE; |
| 102 | |
| reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 103 | virtual bool geometryHints(GrVertexLayout vertexLayout, |
| bsalomon@google.com | 1c13c96 | 2011-02-14 16:51:21 +0000 | [diff] [blame] | 104 | int* vertexCount, |
| bsalomon@google.com | 9780538 | 2012-03-13 14:32:07 +0000 | [diff] [blame] | 105 | int* indexCount) const SK_OVERRIDE; |
| reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 106 | |
| rmistry@google.com | fbfcd56 | 2012-08-23 18:09:54 +0000 | [diff] [blame] | 107 | virtual void clear(const GrIRect* rect, |
| robertphillips@google.com | c82a8b7 | 2012-06-21 20:15:48 +0000 | [diff] [blame] | 108 | GrColor color, |
| 109 | GrRenderTarget* renderTarget = NULL) SK_OVERRIDE; |
| bsalomon@google.com | 0b335c1 | 2011-04-25 19:17:44 +0000 | [diff] [blame] | 110 | |
| bsalomon@google.com | 9780538 | 2012-03-13 14:32:07 +0000 | [diff] [blame] | 111 | protected: |
| bsalomon@google.com | 9780538 | 2012-03-13 14:32:07 +0000 | [diff] [blame] | 112 | virtual void willReserveVertexAndIndexSpace(GrVertexLayout vertexLayout, |
| 113 | int vertexCount, |
| 114 | int indexCount) SK_OVERRIDE; |
| reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 115 | private: |
| bsalomon@google.com | a4f6b10 | 2012-06-26 21:04:22 +0000 | [diff] [blame] | 116 | enum Cmd { |
| bsalomon@google.com | ded4f4b | 2012-06-28 18:48:06 +0000 | [diff] [blame] | 117 | kDraw_Cmd = 1, |
| 118 | kStencilPath_Cmd = 2, |
| 119 | kSetState_Cmd = 3, |
| 120 | kSetClip_Cmd = 4, |
| 121 | kClear_Cmd = 5, |
| bsalomon@google.com | a4f6b10 | 2012-06-26 21:04:22 +0000 | [diff] [blame] | 122 | }; |
| 123 | |
| reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 124 | struct Draw { |
| bsalomon@google.com | ffca400 | 2011-02-22 20:34:01 +0000 | [diff] [blame] | 125 | GrPrimitiveType fPrimitiveType; |
| bsalomon@google.com | 1c13c96 | 2011-02-14 16:51:21 +0000 | [diff] [blame] | 126 | int fStartVertex; |
| 127 | int fStartIndex; |
| 128 | int fVertexCount; |
| 129 | int fIndexCount; |
| bsalomon@google.com | 1c13c96 | 2011-02-14 16:51:21 +0000 | [diff] [blame] | 130 | GrVertexLayout fVertexLayout; |
| 131 | const GrVertexBuffer* fVertexBuffer; |
| 132 | const GrIndexBuffer* fIndexBuffer; |
| reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 133 | }; |
| 134 | |
| bsalomon@google.com | ded4f4b | 2012-06-28 18:48:06 +0000 | [diff] [blame] | 135 | struct StencilPath { |
| sugoi@google.com | 5f74cf8 | 2012-12-17 21:16:45 +0000 | [diff] [blame] | 136 | StencilPath(); |
| 137 | |
| bsalomon@google.com | ded4f4b | 2012-06-28 18:48:06 +0000 | [diff] [blame] | 138 | SkAutoTUnref<const GrPath> fPath; |
| sugoi@google.com | 5f74cf8 | 2012-12-17 21:16:45 +0000 | [diff] [blame] | 139 | SkStrokeRec fStroke; |
| sugoi@google.com | 12b4e27 | 2012-12-06 20:13:11 +0000 | [diff] [blame] | 140 | SkPath::FillType fFill; |
| bsalomon@google.com | ded4f4b | 2012-06-28 18:48:06 +0000 | [diff] [blame] | 141 | }; |
| 142 | |
| bsalomon@google.com | 0b335c1 | 2011-04-25 19:17:44 +0000 | [diff] [blame] | 143 | struct Clear { |
| robertphillips@google.com | c82a8b7 | 2012-06-21 20:15:48 +0000 | [diff] [blame] | 144 | Clear() : fRenderTarget(NULL) {} |
| 145 | ~Clear() { GrSafeUnref(fRenderTarget); } |
| 146 | |
| robertphillips@google.com | c82a8b7 | 2012-06-21 20:15:48 +0000 | [diff] [blame] | 147 | GrIRect fRect; |
| 148 | GrColor fColor; |
| 149 | GrRenderTarget* fRenderTarget; |
| bsalomon@google.com | 0b335c1 | 2011-04-25 19:17:44 +0000 | [diff] [blame] | 150 | }; |
| 151 | |
| bsalomon@google.com | 25fb21f | 2011-06-21 18:17:25 +0000 | [diff] [blame] | 152 | // overrides from GrDrawTarget |
| 153 | virtual void onDrawIndexed(GrPrimitiveType primitiveType, |
| 154 | int startVertex, |
| 155 | int startIndex, |
| 156 | int vertexCount, |
| bsalomon@google.com | 13f1b6f | 2012-05-31 12:52:43 +0000 | [diff] [blame] | 157 | int indexCount) SK_OVERRIDE; |
| bsalomon@google.com | 25fb21f | 2011-06-21 18:17:25 +0000 | [diff] [blame] | 158 | virtual void onDrawNonIndexed(GrPrimitiveType primitiveType, |
| 159 | int startVertex, |
| bsalomon@google.com | 13f1b6f | 2012-05-31 12:52:43 +0000 | [diff] [blame] | 160 | int vertexCount) SK_OVERRIDE; |
| sugoi@google.com | 5f74cf8 | 2012-12-17 21:16:45 +0000 | [diff] [blame] | 161 | virtual void onStencilPath(const GrPath*, const SkStrokeRec& stroke, SkPath::FillType) SK_OVERRIDE; |
| rmistry@google.com | fbfcd56 | 2012-08-23 18:09:54 +0000 | [diff] [blame] | 162 | virtual bool onReserveVertexSpace(GrVertexLayout layout, |
| bsalomon@google.com | 25fb21f | 2011-06-21 18:17:25 +0000 | [diff] [blame] | 163 | int vertexCount, |
| bsalomon@google.com | 13f1b6f | 2012-05-31 12:52:43 +0000 | [diff] [blame] | 164 | void** vertices) SK_OVERRIDE; |
| 165 | virtual bool onReserveIndexSpace(int indexCount, |
| 166 | void** indices) SK_OVERRIDE; |
| 167 | virtual void releaseReservedVertexSpace() SK_OVERRIDE; |
| 168 | virtual void releaseReservedIndexSpace() SK_OVERRIDE; |
| bsalomon@google.com | bcdbbe6 | 2011-04-12 15:40:00 +0000 | [diff] [blame] | 169 | virtual void onSetVertexSourceToArray(const void* vertexArray, |
| bsalomon@google.com | 13f1b6f | 2012-05-31 12:52:43 +0000 | [diff] [blame] | 170 | int vertexCount) SK_OVERRIDE; |
| bsalomon@google.com | bcdbbe6 | 2011-04-12 15:40:00 +0000 | [diff] [blame] | 171 | virtual void onSetIndexSourceToArray(const void* indexArray, |
| bsalomon@google.com | 13f1b6f | 2012-05-31 12:52:43 +0000 | [diff] [blame] | 172 | int indexCount) SK_OVERRIDE; |
| 173 | virtual void releaseVertexArray() SK_OVERRIDE; |
| 174 | virtual void releaseIndexArray() SK_OVERRIDE; |
| 175 | virtual void geometrySourceWillPush() SK_OVERRIDE; |
| 176 | virtual void geometrySourceWillPop( |
| 177 | const GeometrySrcState& restoredState) SK_OVERRIDE; |
| robertphillips@google.com | beb1af7 | 2012-07-26 18:52:16 +0000 | [diff] [blame] | 178 | virtual void clipWillBeSet(const GrClipData* newClip) SK_OVERRIDE; |
| bsalomon@google.com | 1c13c96 | 2011-02-14 16:51:21 +0000 | [diff] [blame] | 179 | |
| bsalomon@google.com | a4f6b10 | 2012-06-26 21:04:22 +0000 | [diff] [blame] | 180 | // we lazily record state and clip changes in order to skip clips and states |
| 181 | // that have no effect. |
| bsalomon@google.com | 86afc2a | 2011-02-16 16:12:19 +0000 | [diff] [blame] | 182 | bool needsNewState() const; |
| 183 | bool needsNewClip() const; |
| reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 184 | |
| bsalomon@google.com | a4f6b10 | 2012-06-26 21:04:22 +0000 | [diff] [blame] | 185 | // these functions record a command |
| bsalomon@google.com | ded4f4b | 2012-06-28 18:48:06 +0000 | [diff] [blame] | 186 | void recordState(); |
| 187 | void recordDefaultState(); |
| 188 | void recordClip(); |
| 189 | void recordDefaultClip(); |
| 190 | Draw* recordDraw(); |
| 191 | StencilPath* recordStencilPath(); |
| 192 | Clear* recordClear(); |
| bsalomon@google.com | 934c570 | 2012-03-20 21:17:58 +0000 | [diff] [blame] | 193 | |
| rmistry@google.com | fbfcd56 | 2012-08-23 18:09:54 +0000 | [diff] [blame] | 194 | // call this to invalidate the tracking data that is used to concatenate |
| bsalomon@google.com | 934c570 | 2012-03-20 21:17:58 +0000 | [diff] [blame] | 195 | // multiple draws into a single draw. |
| 196 | void resetDrawTracking(); |
| 197 | |
| bsalomon@google.com | 4b90c62 | 2011-09-28 17:52:15 +0000 | [diff] [blame] | 198 | enum { |
| bsalomon@google.com | a4f6b10 | 2012-06-26 21:04:22 +0000 | [diff] [blame] | 199 | kCmdPreallocCnt = 32, |
| bsalomon@google.com | 4b90c62 | 2011-09-28 17:52:15 +0000 | [diff] [blame] | 200 | kDrawPreallocCnt = 8, |
| bsalomon@google.com | ded4f4b | 2012-06-28 18:48:06 +0000 | [diff] [blame] | 201 | kStencilPathPreallocCnt = 8, |
| bsalomon@google.com | 4b90c62 | 2011-09-28 17:52:15 +0000 | [diff] [blame] | 202 | kStatePreallocCnt = 8, |
| 203 | kClipPreallocCnt = 8, |
| 204 | kClearPreallocCnt = 4, |
| 205 | kGeoPoolStatePreAllocCnt = 4, |
| 206 | }; |
| reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 207 | |
| bsalomon@google.com | a4f6b10 | 2012-06-26 21:04:22 +0000 | [diff] [blame] | 208 | SkSTArray<kCmdPreallocCnt, uint8_t, true> fCmds; |
| bsalomon@google.com | 4b90c62 | 2011-09-28 17:52:15 +0000 | [diff] [blame] | 209 | GrSTAllocator<kDrawPreallocCnt, Draw> fDraws; |
| bsalomon@google.com | ded4f4b | 2012-06-28 18:48:06 +0000 | [diff] [blame] | 210 | GrSTAllocator<kStatePreallocCnt, StencilPath> fStencilPaths; |
| bsalomon@google.com | 873ea0c | 2012-03-30 15:55:32 +0000 | [diff] [blame] | 211 | GrSTAllocator<kStatePreallocCnt, GrDrawState> fStates; |
| bsalomon@google.com | 4b90c62 | 2011-09-28 17:52:15 +0000 | [diff] [blame] | 212 | GrSTAllocator<kClearPreallocCnt, Clear> fClears; |
| robertphillips@google.com | beb1af7 | 2012-07-26 18:52:16 +0000 | [diff] [blame] | 213 | |
| robertphillips@google.com | 641f8b1 | 2012-07-31 19:15:58 +0000 | [diff] [blame] | 214 | GrSTAllocator<kClipPreallocCnt, SkClipStack> fClips; |
| robertphillips@google.com | beb1af7 | 2012-07-26 18:52:16 +0000 | [diff] [blame] | 215 | GrSTAllocator<kClipPreallocCnt, SkIPoint> fClipOrigins; |
| bsalomon@google.com | 9780538 | 2012-03-13 14:32:07 +0000 | [diff] [blame] | 216 | |
| 217 | GrDrawTarget* fAutoFlushTarget; |
| 218 | |
| bsalomon@google.com | 86afc2a | 2011-02-16 16:12:19 +0000 | [diff] [blame] | 219 | bool fClipSet; |
| 220 | |
| bsalomon@google.com | 934c570 | 2012-03-20 21:17:58 +0000 | [diff] [blame] | 221 | GrVertexBufferAllocPool& fVertexPool; |
| 222 | |
| 223 | GrIndexBufferAllocPool& fIndexPool; |
| 224 | |
| 225 | // these are used to attempt to concatenate drawRect calls |
| bsalomon@google.com | 86afc2a | 2011-02-16 16:12:19 +0000 | [diff] [blame] | 226 | GrVertexLayout fLastRectVertexLayout; |
| 227 | const GrIndexBuffer* fQuadIndexBuffer; |
| 228 | int fMaxQuads; |
| 229 | int fCurrQuad; |
| reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 230 | |
| bsalomon@google.com | 55e4a20 | 2013-01-11 13:54:21 +0000 | [diff] [blame^] | 231 | // bookkeeping to attempt to concatenate drawIndexedInstances calls |
| bsalomon@google.com | 934c570 | 2012-03-20 21:17:58 +0000 | [diff] [blame] | 232 | struct { |
| 233 | int fVerticesPerInstance; |
| 234 | int fIndicesPerInstance; |
| 235 | void reset() { |
| 236 | fVerticesPerInstance = 0; |
| 237 | fIndicesPerInstance = 0; |
| 238 | } |
| 239 | } fInstancedDrawTracker; |
| bsalomon@google.com | 9266901 | 2011-09-27 19:10:05 +0000 | [diff] [blame] | 240 | |
| bsalomon@google.com | 25fb21f | 2011-06-21 18:17:25 +0000 | [diff] [blame] | 241 | struct GeometryPoolState { |
| 242 | const GrVertexBuffer* fPoolVertexBuffer; |
| 243 | int fPoolStartVertex; |
| 244 | const GrIndexBuffer* fPoolIndexBuffer; |
| 245 | int fPoolStartIndex; |
| 246 | // caller may conservatively over reserve vertices / indices. |
| 247 | // we release unused space back to allocator if possible |
| 248 | // can only do this if there isn't an intervening pushGeometrySource() |
| 249 | size_t fUsedPoolVertexBytes; |
| 250 | size_t fUsedPoolIndexBytes; |
| 251 | }; |
| bsalomon@google.com | 9266901 | 2011-09-27 19:10:05 +0000 | [diff] [blame] | 252 | SkSTArray<kGeoPoolStatePreAllocCnt, GeometryPoolState> fGeoPoolStateStack; |
| reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 253 | |
| robertphillips@google.com | c82a8b7 | 2012-06-21 20:15:48 +0000 | [diff] [blame] | 254 | bool fFlushing; |
| 255 | |
| bsalomon@google.com | 86afc2a | 2011-02-16 16:12:19 +0000 | [diff] [blame] | 256 | typedef GrDrawTarget INHERITED; |
| reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 257 | }; |
| 258 | |
| 259 | #endif |