| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
| 3 * | 3 * |
| 4 * 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 |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #ifndef GrInOrderDrawBuffer_DEFINED | 8 #ifndef GrInOrderDrawBuffer_DEFINED |
| 9 #define GrInOrderDrawBuffer_DEFINED | 9 #define GrInOrderDrawBuffer_DEFINED |
| 10 | 10 |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 struct Cmd : ::SkNoncopyable { | 110 struct Cmd : ::SkNoncopyable { |
| 111 Cmd(uint8_t type) : fType(type) {} | 111 Cmd(uint8_t type) : fType(type) {} |
| 112 virtual ~Cmd() {} | 112 virtual ~Cmd() {} |
| 113 | 113 |
| 114 virtual void execute(GrInOrderDrawBuffer*, const GrOptDrawState*) = 0; | 114 virtual void execute(GrInOrderDrawBuffer*, const GrOptDrawState*) = 0; |
| 115 | 115 |
| 116 uint8_t fType; | 116 uint8_t fType; |
| 117 }; | 117 }; |
| 118 | 118 |
| 119 struct Draw : public Cmd { | 119 struct Draw : public Cmd { |
| 120 Draw(const DrawInfo& info, | 120 Draw(const DrawInfo& info, const ScissorState& scissorState) |
| 121 const ScissorState& scissorState, | |
| 122 const GrVertexBuffer* vb, | |
| 123 const GrIndexBuffer* ib) | |
| 124 : Cmd(kDraw_Cmd) | 121 : Cmd(kDraw_Cmd) |
| 125 , fInfo(info) | 122 , fInfo(info) |
| 126 , fScissorState(scissorState) | 123 , fScissorState(scissorState){} |
| 127 , fVertexBuffer(vb) | |
| 128 , fIndexBuffer(ib) {} | |
| 129 | |
| 130 const GrVertexBuffer* vertexBuffer() const { return fVertexBuffer.get();
} | |
| 131 const GrIndexBuffer* indexBuffer() const { return fIndexBuffer.get(); } | |
| 132 | 124 |
| 133 virtual void execute(GrInOrderDrawBuffer*, const GrOptDrawState*); | 125 virtual void execute(GrInOrderDrawBuffer*, const GrOptDrawState*); |
| 134 | 126 |
| 135 DrawInfo fInfo; | 127 DrawInfo fInfo; |
| 136 ScissorState fScissorState; | 128 ScissorState fScissorState; |
| 137 | |
| 138 private: | |
| 139 GrPendingIOResource<const GrVertexBuffer, kRead_GrIOType> fVertexBuff
er; | |
| 140 GrPendingIOResource<const GrIndexBuffer, kRead_GrIOType> fIndexBuffe
r; | |
| 141 }; | 129 }; |
| 142 | 130 |
| 143 struct StencilPath : public Cmd { | 131 struct StencilPath : public Cmd { |
| 144 StencilPath(const GrPath* path) : Cmd(kStencilPath_Cmd), fPath(path) {} | 132 StencilPath(const GrPath* path) : Cmd(kStencilPath_Cmd), fPath(path) {} |
| 145 | 133 |
| 146 const GrPath* path() const { return fPath.get(); } | 134 const GrPath* path() const { return fPath.get(); } |
| 147 | 135 |
| 148 virtual void execute(GrInOrderDrawBuffer*, const GrOptDrawState*); | 136 virtual void execute(GrInOrderDrawBuffer*, const GrOptDrawState*); |
| 149 | 137 |
| 150 ScissorState fScissorState; | 138 ScissorState fScissorState; |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 int count, | 260 int count, |
| 273 const float transforms[], | 261 const float transforms[], |
| 274 PathTransformType, | 262 PathTransformType, |
| 275 const GrClipMaskManager::ScissorState&, | 263 const GrClipMaskManager::ScissorState&, |
| 276 const GrStencilSettings&, | 264 const GrStencilSettings&, |
| 277 const GrDeviceCoordTexture*) SK_OVERRIDE; | 265 const GrDeviceCoordTexture*) SK_OVERRIDE; |
| 278 virtual void onClear(const SkIRect* rect, | 266 virtual void onClear(const SkIRect* rect, |
| 279 GrColor color, | 267 GrColor color, |
| 280 bool canIgnoreRect, | 268 bool canIgnoreRect, |
| 281 GrRenderTarget* renderTarget) SK_OVERRIDE; | 269 GrRenderTarget* renderTarget) SK_OVERRIDE; |
| 270 virtual void setDrawBuffers(DrawInfo*) SK_OVERRIDE; |
| 282 | 271 |
| 283 virtual bool onReserveVertexSpace(size_t vertexSize, | 272 virtual bool onReserveVertexSpace(size_t vertexSize, |
| 284 int vertexCount, | 273 int vertexCount, |
| 285 void** vertices) SK_OVERRIDE; | 274 void** vertices) SK_OVERRIDE; |
| 286 virtual bool onReserveIndexSpace(int indexCount, | 275 virtual bool onReserveIndexSpace(int indexCount, |
| 287 void** indices) SK_OVERRIDE; | 276 void** indices) SK_OVERRIDE; |
| 288 virtual void releaseReservedVertexSpace() SK_OVERRIDE; | 277 virtual void releaseReservedVertexSpace() SK_OVERRIDE; |
| 289 virtual void releaseReservedIndexSpace() SK_OVERRIDE; | 278 virtual void releaseReservedIndexSpace() SK_OVERRIDE; |
| 290 virtual void geometrySourceWillPush() SK_OVERRIDE; | 279 virtual void geometrySourceWillPush() SK_OVERRIDE; |
| 291 virtual void geometrySourceWillPop(const GeometrySrcState& restoredState) SK
_OVERRIDE; | 280 virtual void geometrySourceWillPop(const GeometrySrcState& restoredState) SK
_OVERRIDE; |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 typedef SkSTArray<kGeoPoolStatePreAllocCnt, GeometryPoolState> GeoPoolStateS
tack; | 329 typedef SkSTArray<kGeoPoolStatePreAllocCnt, GeometryPoolState> GeoPoolStateS
tack; |
| 341 | 330 |
| 342 GeoPoolStateStack fGeoPoolStateStack; | 331 GeoPoolStateStack fGeoPoolStateStack; |
| 343 bool fFlushing; | 332 bool fFlushing; |
| 344 uint32_t fDrawID; | 333 uint32_t fDrawID; |
| 345 | 334 |
| 346 typedef GrClipTarget INHERITED; | 335 typedef GrClipTarget INHERITED; |
| 347 }; | 336 }; |
| 348 | 337 |
| 349 #endif | 338 #endif |
| OLD | NEW |