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 "GrRODrawState.h" | 8 #include "GrRODrawState.h" |
9 #include "GrDrawTargetCaps.h" | 9 #include "GrDrawTargetCaps.h" |
10 | 10 |
11 //////////////////////////////////////////////////////////////////////////////// | 11 //////////////////////////////////////////////////////////////////////////////// |
12 | 12 |
13 bool GrRODrawState::isEqual(const GrRODrawState& that) const { | 13 bool GrRODrawState::isEqual(const GrRODrawState& that) const { |
14 bool usingVertexColors = this->hasColorVertexAttribute(); | 14 bool usingVertexColors = this->hasColorVertexAttribute(); |
15 if (!usingVertexColors && this->fColor != that.fColor) { | 15 if (!usingVertexColors && this->fColor != that.fColor) { |
16 return false; | 16 return false; |
17 } | 17 } |
18 | 18 |
19 if (this->fRenderTarget.get() != that.fRenderTarget.get() || | 19 if (this->getRenderTarget() != that.getRenderTarget() || |
20 this->fColorStages.count() != that.fColorStages.count() || | 20 this->fColorStages.count() != that.fColorStages.count() || |
21 this->fCoverageStages.count() != that.fCoverageStages.count() || | 21 this->fCoverageStages.count() != that.fCoverageStages.count() || |
22 !this->fViewMatrix.cheapEqualTo(that.fViewMatrix) || | 22 !this->fViewMatrix.cheapEqualTo(that.fViewMatrix) || |
23 this->fSrcBlend != that.fSrcBlend || | 23 this->fSrcBlend != that.fSrcBlend || |
24 this->fDstBlend != that.fDstBlend || | 24 this->fDstBlend != that.fDstBlend || |
25 this->fBlendConstant != that.fBlendConstant || | 25 this->fBlendConstant != that.fBlendConstant || |
26 this->fFlagBits != that.fFlagBits || | 26 this->fFlagBits != that.fFlagBits || |
27 this->fVACount != that.fVACount || | 27 this->fVACount != that.fVACount || |
28 this->fVAStride != that.fVAStride || | 28 this->fVAStride != that.fVAStride || |
29 memcmp(this->fVAPtr, that.fVAPtr, this->fVACount * sizeof(GrVertexAttrib
)) || | 29 memcmp(this->fVAPtr, that.fVAPtr, this->fVACount * sizeof(GrVertexAttrib
)) || |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 find that only 1, ISA, and ISC produce the correct destination when applied
to S' and D. | 177 find that only 1, ISA, and ISC produce the correct destination when applied
to S' and D. |
178 Also, if we're directly rendering coverage (isCoverageDrawing) then coverag
e is treated as | 178 Also, if we're directly rendering coverage (isCoverageDrawing) then coverag
e is treated as |
179 color by definition. | 179 color by definition. |
180 */ | 180 */ |
181 return kOne_GrBlendCoeff == fDstBlend || | 181 return kOne_GrBlendCoeff == fDstBlend || |
182 kISA_GrBlendCoeff == fDstBlend || | 182 kISA_GrBlendCoeff == fDstBlend || |
183 kISC_GrBlendCoeff == fDstBlend || | 183 kISC_GrBlendCoeff == fDstBlend || |
184 this->isCoverageDrawing(); | 184 this->isCoverageDrawing(); |
185 } | 185 } |
186 | 186 |
| 187 void GrRODrawState::convertToPendingExec() { |
| 188 fRenderTarget.markPendingIO(); |
| 189 fRenderTarget.removeRef(); |
| 190 for (int i = 0; i < fColorStages.count(); ++i) { |
| 191 fColorStages[i].convertToPendingExec(); |
| 192 } |
| 193 if (fGeometryProcessor) { |
| 194 fGeometryProcessor->convertToPendingExec(); |
| 195 } |
| 196 for (int i = 0; i < fCoverageStages.count(); ++i) { |
| 197 fCoverageStages[i].convertToPendingExec(); |
| 198 } |
| 199 } |
OLD | NEW |