OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 "GrOptDrawState.h" | 8 #include "GrOptDrawState.h" |
9 | 9 |
10 #include "GrDrawState.h" | 10 #include "GrDrawState.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 | 62 |
63 // Copy Color Stages from DS to ODS | 63 // Copy Color Stages from DS to ODS |
64 if (firstColorStageIdx < drawState.numColorStages()) { | 64 if (firstColorStageIdx < drawState.numColorStages()) { |
65 fColorStages.reset(&drawState.getColorStage(firstColorStageIdx), | 65 fColorStages.reset(&drawState.getColorStage(firstColorStageIdx), |
66 drawState.numColorStages() - firstColorStageIdx); | 66 drawState.numColorStages() - firstColorStageIdx); |
67 } else { | 67 } else { |
68 fColorStages.reset(); | 68 fColorStages.reset(); |
69 } | 69 } |
70 | 70 |
71 // Copy Coverage Stages from DS to ODS | 71 // Copy Coverage Stages from DS to ODS |
72 if (drawState.numCoverageStages() > 0 && separateCoverageFromColor) { | 72 if (firstCoverageStageIdx < drawState.numCoverageStages() && separateCoverag
eFromColor) { |
73 fCoverageStages.reset(&drawState.getCoverageStage(firstCoverageStageIdx)
, | 73 fCoverageStages.reset(&drawState.getCoverageStage(firstCoverageStageIdx)
, |
74 drawState.numCoverageStages() - firstCoverageStage
Idx); | 74 drawState.numCoverageStages() - firstCoverageStage
Idx); |
75 } else { | 75 } else { |
76 fCoverageStages.reset(); | 76 fCoverageStages.reset(); |
77 if (drawState.numCoverageStages() > 0) { | 77 if (firstCoverageStageIdx < drawState.numCoverageStages()) { |
78 // TODO: Once we have flag to know if we only multiply on stages, on
ly push coverage | 78 // TODO: Once we have flag to know if we only multiply on stages, on
ly push coverage |
79 // into color stages if everything is multiply | 79 // into color stages if everything is multiply |
80 fColorStages.push_back_n(drawState.numCoverageStages() - firstCovera
geStageIdx, | 80 fColorStages.push_back_n(drawState.numCoverageStages() - firstCovera
geStageIdx, |
81 &drawState.getCoverageStage(firstCoverageSt
ageIdx)); | 81 &drawState.getCoverageStage(firstCoverageSt
ageIdx)); |
82 } | 82 } |
83 } | 83 } |
84 }; | 84 }; |
85 | 85 |
86 GrOptDrawState* GrOptDrawState::Create(const GrDrawState& drawState, const GrDra
wTargetCaps& caps, | 86 GrOptDrawState* GrOptDrawState::Create(const GrDrawState& drawState, const GrDra
wTargetCaps& caps, |
87 GrGpu::DrawType drawType) { | 87 GrGpu::DrawType drawType) { |
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 } | 380 } |
381 } | 381 } |
382 | 382 |
383 SkASSERT(0 == memcmp(this->fFixedFunctionVertexAttribIndices, | 383 SkASSERT(0 == memcmp(this->fFixedFunctionVertexAttribIndices, |
384 that.fFixedFunctionVertexAttribIndices, | 384 that.fFixedFunctionVertexAttribIndices, |
385 sizeof(this->fFixedFunctionVertexAttribIndices))); | 385 sizeof(this->fFixedFunctionVertexAttribIndices))); |
386 | 386 |
387 return true; | 387 return true; |
388 } | 388 } |
389 | 389 |
OLD | NEW |