| 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 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 typedef void* TCmdAlign; // This wouldn't be enough align if a command used
long double. | 226 typedef void* TCmdAlign; // This wouldn't be enough align if a command used
long double. |
| 227 typedef GrTRecorder<Cmd, TCmdAlign> CmdBuffer; | 227 typedef GrTRecorder<Cmd, TCmdAlign> CmdBuffer; |
| 228 | 228 |
| 229 void onReset() SK_OVERRIDE; | 229 void onReset() SK_OVERRIDE; |
| 230 void onFlush() SK_OVERRIDE; | 230 void onFlush() SK_OVERRIDE; |
| 231 | 231 |
| 232 // overrides from GrDrawTarget | 232 // overrides from GrDrawTarget |
| 233 void onDraw(const GrPipelineBuilder&, | 233 void onDraw(const GrPipelineBuilder&, |
| 234 const GrGeometryProcessor*, | 234 const GrGeometryProcessor*, |
| 235 const DrawInfo&, | 235 const DrawInfo&, |
| 236 const GrScissorState&, | 236 const GrScissorState&) SK_OVERRIDE; |
| 237 const GrDeviceCoordTexture* dstCopy) SK_OVERRIDE; | |
| 238 void onDrawBatch(GrBatch*, | 237 void onDrawBatch(GrBatch*, |
| 239 const GrPipelineBuilder&, | 238 const GrPipelineBuilder&, |
| 240 const GrScissorState&, | 239 const GrScissorState&, |
| 241 const GrDeviceCoordTexture* dstCopy) SK_OVERRIDE; | 240 const SkRect* devBounds) SK_OVERRIDE; |
| 242 void onDrawRect(GrPipelineBuilder*, | 241 void onDrawRect(GrPipelineBuilder*, |
| 243 GrColor, | 242 GrColor, |
| 244 const SkMatrix& viewMatrix, | 243 const SkMatrix& viewMatrix, |
| 245 const SkRect& rect, | 244 const SkRect& rect, |
| 246 const SkRect* localRect, | 245 const SkRect* localRect, |
| 247 const SkMatrix* localMatrix) SK_OVERRIDE; | 246 const SkMatrix* localMatrix) SK_OVERRIDE; |
| 248 | 247 |
| 249 void onStencilPath(const GrPipelineBuilder&, | 248 void onStencilPath(const GrPipelineBuilder&, |
| 250 const GrPathProcessor*, | 249 const GrPathProcessor*, |
| 251 const GrPath*, | 250 const GrPath*, |
| 252 const GrScissorState&, | 251 const GrScissorState&, |
| 253 const GrStencilSettings&) SK_OVERRIDE; | 252 const GrStencilSettings&) SK_OVERRIDE; |
| 254 void onDrawPath(const GrPipelineBuilder&, | 253 void onDrawPath(const GrPipelineBuilder&, |
| 255 const GrPathProcessor*, | 254 const GrPathProcessor*, |
| 256 const GrPath*, | 255 const GrPath*, |
| 257 const GrScissorState&, | 256 const GrScissorState&, |
| 258 const GrStencilSettings&, | 257 const GrStencilSettings&, |
| 259 const GrDeviceCoordTexture* dstCopy) SK_OVERRIDE; | 258 const SkRect* devBounds) SK_OVERRIDE; |
| 260 void onDrawPaths(const GrPipelineBuilder&, | 259 void onDrawPaths(const GrPipelineBuilder&, |
| 261 const GrPathProcessor*, | 260 const GrPathProcessor*, |
| 262 const GrPathRange*, | 261 const GrPathRange*, |
| 263 const void* indices, | 262 const void* indices, |
| 264 PathIndexType, | 263 PathIndexType, |
| 265 const float transformValues[], | 264 const float transformValues[], |
| 266 PathTransformType, | 265 PathTransformType, |
| 267 int count, | 266 int count, |
| 268 const GrScissorState&, | 267 const GrScissorState&, |
| 269 const GrStencilSettings&, | 268 const GrStencilSettings&, |
| 270 const GrDeviceCoordTexture*) SK_OVERRIDE; | 269 const SkRect* devBounds) SK_OVERRIDE; |
| 271 void onClear(const SkIRect* rect, | 270 void onClear(const SkIRect* rect, |
| 272 GrColor color, | 271 GrColor color, |
| 273 bool canIgnoreRect, | 272 bool canIgnoreRect, |
| 274 GrRenderTarget* renderTarget) SK_OVERRIDE; | 273 GrRenderTarget* renderTarget) SK_OVERRIDE; |
| 275 bool onCopySurface(GrSurface* dst, | 274 bool onCopySurface(GrSurface* dst, |
| 276 GrSurface* src, | 275 GrSurface* src, |
| 277 const SkIRect& srcRect, | 276 const SkIRect& srcRect, |
| 278 const SkIPoint& dstPoint) SK_OVERRIDE; | 277 const SkIPoint& dstPoint) SK_OVERRIDE; |
| 279 | 278 |
| 280 // Attempts to concat instances from info onto the previous draw. info must
represent an | 279 // Attempts to concat instances from info onto the previous draw. info must
represent an |
| 281 // instanced draw. The caller must have already recorded a new draw state an
d clip if necessary. | 280 // instanced draw. The caller must have already recorded a new draw state an
d clip if necessary. |
| 282 int concatInstancedDraw(const GrPipelineBuilder&, const DrawInfo&); | 281 int concatInstancedDraw(const GrPipelineBuilder&, const DrawInfo&); |
| 283 | 282 |
| 284 // Determines whether the current draw operation requires a new GrPipeline a
nd if so | 283 // Determines whether the current draw operation requires a new GrPipeline a
nd if so |
| 285 // records it. If the draw can be skipped false is returned and no new GrPip
eline is | 284 // records it. If the draw can be skipped false is returned and no new GrPip
eline is |
| 286 // recorded. | 285 // recorded. |
| 287 // TODO delete the primproc variant when we have batches everywhere | 286 // TODO delete the primproc variant when we have batches everywhere |
| 288 bool SK_WARN_UNUSED_RESULT recordStateAndShouldDraw(const GrPipelineBuilder&
, | 287 bool SK_WARN_UNUSED_RESULT recordStateAndShouldDraw(const GrPipelineBuilder&
, |
| 289 const GrPrimitiveProcess
or*, | 288 const GrPrimitiveProcess
or*, |
| 290 const GrScissorState&, | 289 const GrScissorState&, |
| 291 const GrDeviceCoordTextu
re*); | 290 const SkRect*); |
| 292 bool SK_WARN_UNUSED_RESULT recordStateAndShouldDraw(GrBatch*, | 291 bool SK_WARN_UNUSED_RESULT recordStateAndShouldDraw(GrBatch*, |
| 293 const GrPipelineBuilder&
, | 292 const GrPipelineBuilder&
, |
| 294 const GrScissorState&, | 293 const GrScissorState&, |
| 295 const GrDeviceCoordTextu
re*); | 294 const SkRect*); |
| 296 | 295 |
| 297 // We lazily record clip changes in order to skip clips that have no effect. | 296 // We lazily record clip changes in order to skip clips that have no effect. |
| 298 void recordClipIfNecessary(); | 297 void recordClipIfNecessary(); |
| 299 // Records any trace markers for a command after adding it to the buffer. | 298 // Records any trace markers for a command after adding it to the buffer. |
| 300 void recordTraceMarkersIfNecessary(); | 299 void recordTraceMarkersIfNecessary(); |
| 301 | 300 |
| 302 bool isIssued(uint32_t drawID) SK_OVERRIDE { return drawID != fDrawID; } | 301 bool isIssued(uint32_t drawID) SK_OVERRIDE { return drawID != fDrawID; } |
| 303 | 302 |
| 304 GrBatchTarget* getBatchTarget() { return &fBatchTarget; } | 303 GrBatchTarget* getBatchTarget() { return &fBatchTarget; } |
| 305 | 304 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 319 GrBatchTarget fBatchTarget; | 318 GrBatchTarget fBatchTarget; |
| 320 // TODO hack until batch is everywhere | 319 // TODO hack until batch is everywhere |
| 321 DrawBatch* fDrawBatch; | 320 DrawBatch* fDrawBatch; |
| 322 | 321 |
| 323 void closeBatch(); | 322 void closeBatch(); |
| 324 | 323 |
| 325 typedef GrFlushToGpuDrawTarget INHERITED; | 324 typedef GrFlushToGpuDrawTarget INHERITED; |
| 326 }; | 325 }; |
| 327 | 326 |
| 328 #endif | 327 #endif |
| OLD | NEW |