| 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 24 matching lines...) Expand all Loading... |
| 35 * @param indexPool pool where indices for queued draws will be saved when | 35 * @param indexPool pool where indices for queued draws will be saved when |
| 36 * the index source is either reserved or array. | 36 * the index source is either reserved or array. |
| 37 */ | 37 */ |
| 38 GrInOrderDrawBuffer(GrGpu* gpu, | 38 GrInOrderDrawBuffer(GrGpu* gpu, |
| 39 GrVertexBufferAllocPool* vertexPool, | 39 GrVertexBufferAllocPool* vertexPool, |
| 40 GrIndexBufferAllocPool* indexPool); | 40 GrIndexBufferAllocPool* indexPool); |
| 41 | 41 |
| 42 ~GrInOrderDrawBuffer() SK_OVERRIDE; | 42 ~GrInOrderDrawBuffer() SK_OVERRIDE; |
| 43 | 43 |
| 44 // tracking for draws | 44 // tracking for draws |
| 45 DrawToken getCurrentDrawToken() { return DrawToken(this, fDrawID); } | 45 DrawToken getCurrentDrawToken() SK_OVERRIDE { return DrawToken(this, fDrawID
); } |
| 46 | 46 |
| 47 void clearStencilClip(const SkIRect& rect, | 47 void clearStencilClip(const SkIRect& rect, |
| 48 bool insideClip, | 48 bool insideClip, |
| 49 GrRenderTarget* renderTarget) SK_OVERRIDE; | 49 GrRenderTarget* renderTarget) SK_OVERRIDE; |
| 50 | 50 |
| 51 void discard(GrRenderTarget*) SK_OVERRIDE; | 51 void discard(GrRenderTarget*) SK_OVERRIDE; |
| 52 | 52 |
| 53 private: | 53 private: |
| 54 typedef GrClipMaskManager::ScissorState ScissorState; | 54 typedef GrClipMaskManager::ScissorState ScissorState; |
| 55 enum { | 55 enum { |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 const GrGeometryProcesso
r*, | 243 const GrGeometryProcesso
r*, |
| 244 const GrPathProcessor*, | 244 const GrPathProcessor*, |
| 245 GrGpu::DrawType, | 245 GrGpu::DrawType, |
| 246 const GrClipMaskManager:
:ScissorState&, | 246 const GrClipMaskManager:
:ScissorState&, |
| 247 const GrDeviceCoordTextu
re*); | 247 const GrDeviceCoordTextu
re*); |
| 248 // We lazily record clip changes in order to skip clips that have no effect. | 248 // We lazily record clip changes in order to skip clips that have no effect. |
| 249 void recordClipIfNecessary(); | 249 void recordClipIfNecessary(); |
| 250 // Records any trace markers for a command after adding it to the buffer. | 250 // Records any trace markers for a command after adding it to the buffer. |
| 251 void recordTraceMarkersIfNecessary(); | 251 void recordTraceMarkersIfNecessary(); |
| 252 | 252 |
| 253 virtual bool isIssued(uint32_t drawID) { return drawID != fDrawID; } | 253 virtual bool isIssued(uint32_t drawID) SK_OVERRIDE { return drawID != fDrawI
D; } |
| 254 | 254 |
| 255 // TODO: Use a single allocator for commands and records | 255 // TODO: Use a single allocator for commands and records |
| 256 enum { | 256 enum { |
| 257 kCmdBufferInitialSizeInBytes = 8 * 1024, | 257 kCmdBufferInitialSizeInBytes = 8 * 1024, |
| 258 kPathIdxBufferMinReserve = 2 * 64, // 64 uint16_t's | 258 kPathIdxBufferMinReserve = 2 * 64, // 64 uint16_t's |
| 259 kPathXformBufferMinReserve = 2 * 64, // 64 two-float transforms | 259 kPathXformBufferMinReserve = 2 * 64, // 64 two-float transforms |
| 260 }; | 260 }; |
| 261 | 261 |
| 262 CmdBuffer fCmdBuffer; | 262 CmdBuffer fCmdBuffer; |
| 263 const GrOptDrawState* fPrevState; | 263 const GrOptDrawState* fPrevState; |
| 264 SkTArray<GrTraceMarkerSet, false> fGpuCmdMarkers; | 264 SkTArray<GrTraceMarkerSet, false> fGpuCmdMarkers; |
| 265 SkTDArray<char> fPathIndexBuffer; | 265 SkTDArray<char> fPathIndexBuffer; |
| 266 SkTDArray<float> fPathTransformBuffer; | 266 SkTDArray<float> fPathTransformBuffer; |
| 267 uint32_t fDrawID; | 267 uint32_t fDrawID; |
| 268 | 268 |
| 269 typedef GrFlushToGpuDrawTarget INHERITED; | 269 typedef GrFlushToGpuDrawTarget INHERITED; |
| 270 }; | 270 }; |
| 271 | 271 |
| 272 #endif | 272 #endif |
| OLD | NEW |