OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 #include "GrInOrderCommandBuilder.h" | 8 #include "GrInOrderCommandBuilder.h" |
9 | 9 |
10 #include "GrBufferedDrawTarget.h" | 10 #include "GrBufferedDrawTarget.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 SkASSERT(kIncClamp_StencilOp == pathStencilSettings.failOp(pathFace)); | 21 SkASSERT(kIncClamp_StencilOp == pathStencilSettings.failOp(pathFace)); |
22 SkASSERT(0x1 != pathStencilSettings.writeMask(pathFace)); | 22 SkASSERT(0x1 != pathStencilSettings.writeMask(pathFace)); |
23 SkASSERT(!pathStencilSettings.isTwoSided()); | 23 SkASSERT(!pathStencilSettings.isTwoSided()); |
24 } | 24 } |
25 return isWinding; | 25 return isWinding; |
26 } | 26 } |
27 | 27 |
28 GrTargetCommands::Cmd* GrInOrderCommandBuilder::recordDrawBatch(State* state, Gr
Batch* batch) { | 28 GrTargetCommands::Cmd* GrInOrderCommandBuilder::recordDrawBatch(State* state, Gr
Batch* batch) { |
29 // Check if there is a Batch Draw we can batch with | 29 // Check if there is a Batch Draw we can batch with |
30 batch->setPipeline(state->getPipeline()); | 30 batch->setPipeline(state->getPipeline()); |
| 31 GrBATCH_INFO("In-Recording (%s, %u)\n", batch->name(), batch->uniqueID()); |
31 if (!this->cmdBuffer()->empty() && | 32 if (!this->cmdBuffer()->empty() && |
32 Cmd::kDrawBatch_CmdType == this->cmdBuffer()->back().type()) { | 33 Cmd::kDrawBatch_CmdType == this->cmdBuffer()->back().type()) { |
33 DrawBatch* previous = static_cast<DrawBatch*>(&this->cmdBuffer()->back()
); | 34 DrawBatch* previous = static_cast<DrawBatch*>(&this->cmdBuffer()->back()
); |
34 if (previous->fState == state && previous->fBatch->combineIfPossible(bat
ch)) { | 35 if (previous->fState == state && previous->fBatch->combineIfPossible(bat
ch)) { |
| 36 GrBATCH_INFO("\tBatching with (%s, %u)\n", |
| 37 previous->fBatch->name(), previous->fBatch->uniqueID())
; |
35 return NULL; | 38 return NULL; |
36 } | 39 } |
37 } | 40 } |
38 | 41 |
39 return GrNEW_APPEND_TO_RECORDER(*this->cmdBuffer(), DrawBatch, (state, batch
, | 42 return GrNEW_APPEND_TO_RECORDER(*this->cmdBuffer(), DrawBatch, (state, batch
, |
40 this->batchT
arget())); | 43 this->batchT
arget())); |
41 } | 44 } |
42 | 45 |
43 GrTargetCommands::Cmd* | 46 GrTargetCommands::Cmd* |
44 GrInOrderCommandBuilder::recordStencilPath(const GrPipelineBuilder& pipelineBuil
der, | 47 GrInOrderCommandBuilder::recordStencilPath(const GrPipelineBuilder& pipelineBuil
der, |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 | 123 |
121 DrawPaths* dp = GrNEW_APPEND_TO_RECORDER(*this->cmdBuffer(), DrawPaths, (sta
te, pathRange)); | 124 DrawPaths* dp = GrNEW_APPEND_TO_RECORDER(*this->cmdBuffer(), DrawPaths, (sta
te, pathRange)); |
122 dp->fIndices = savedIndices; | 125 dp->fIndices = savedIndices; |
123 dp->fIndexType = indexType; | 126 dp->fIndexType = indexType; |
124 dp->fTransforms = savedTransforms; | 127 dp->fTransforms = savedTransforms; |
125 dp->fTransformType = transformType; | 128 dp->fTransformType = transformType; |
126 dp->fCount = count; | 129 dp->fCount = count; |
127 dp->fStencilSettings = stencilSettings; | 130 dp->fStencilSettings = stencilSettings; |
128 return dp; | 131 return dp; |
129 } | 132 } |
OLD | NEW |