Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(92)

Side by Side Diff: src/gpu/GrRODrawState.cpp

Issue 542723004: Make GrDrawState and GrEffectStage use the pending io/exec ref mechanisms. (Closed) Base URL: https://skia.googlesource.com/skia.git@complete
Patch Set: revert two files Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 find that only 1, ISA, and ISC produce the correct destination when applied to S' and D. 158 find that only 1, ISA, and ISC produce the correct destination when applied to S' and D.
159 Also, if we're directly rendering coverage (isCoverageDrawing) then coverag e is treated as 159 Also, if we're directly rendering coverage (isCoverageDrawing) then coverag e is treated as
160 color by definition. 160 color by definition.
161 */ 161 */
162 return kOne_GrBlendCoeff == fDstBlend || 162 return kOne_GrBlendCoeff == fDstBlend ||
163 kISA_GrBlendCoeff == fDstBlend || 163 kISA_GrBlendCoeff == fDstBlend ||
164 kISC_GrBlendCoeff == fDstBlend || 164 kISC_GrBlendCoeff == fDstBlend ||
165 this->isCoverageDrawing(); 165 this->isCoverageDrawing();
166 } 166 }
167 167
168 void GrRODrawState::convertToPendingExec() {
169 fRenderTarget.markPendingIO();
170 fRenderTarget.removeRef();
171 for (int i = 0; i < fColorStages.count(); ++i) {
172 fColorStages[i].convertToPendingExec();
173 }
174 for (int i = 0; i < fCoverageStages.count(); ++i) {
175 fCoverageStages[i].convertToPendingExec();
176 }
177 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698