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

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

Issue 851143003: Remove willReadDst from GrFragmentProcessor. (Closed) Base URL: https://skia.googlesource.com/skia.git@xferXP
Patch Set: Rebase Created 5 years, 11 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
« no previous file with comments | « src/gpu/GrDrawState.h ('k') | src/gpu/GrDrawTarget.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2012 Google Inc. 2 * Copyright 2012 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 "GrDrawState.h" 8 #include "GrDrawState.h"
9 9
10 #include "GrBlend.h" 10 #include "GrBlend.h"
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 140
141 // The coverage isn't actually white, its unknown, but this will produce the same effect 141 // The coverage isn't actually white, its unknown, but this will produce the same effect
142 // TODO we want to cache the result of this call, but we can probably clean up the interface 142 // TODO we want to cache the result of this call, but we can probably clean up the interface
143 // so we don't have to pass in a seemingly known coverage 143 // so we don't have to pass in a seemingly known coverage
144 this->calcCoverageInvariantOutput(GrColor_WHITE); 144 this->calcCoverageInvariantOutput(GrColor_WHITE);
145 return fXPFactory->canApplyCoverage(fColorProcInfo, fCoverageProcInfo); 145 return fXPFactory->canApplyCoverage(fColorProcInfo, fCoverageProcInfo);
146 } 146 }
147 147
148 //////////////////////////////////////////////////////////////////////////////s 148 //////////////////////////////////////////////////////////////////////////////s
149 149
150 bool GrDrawState::willEffectReadDstColor(const GrPrimitiveProcessor* pp) const { 150 bool GrDrawState::willEffectReadDstColor() const {
151 this->calcColorInvariantOutput(pp); 151 return fXPFactory->willReadDst();
152 this->calcCoverageInvariantOutput(pp);
153
154 return fXPFactory->willReadDst(fColorProcInfo, fCoverageProcInfo);
155 } 152 }
156 153
157 void GrDrawState::AutoRestoreEffects::set(GrDrawState* ds) { 154 void GrDrawState::AutoRestoreEffects::set(GrDrawState* ds) {
158 if (fDrawState) { 155 if (fDrawState) {
159 int m = fDrawState->numColorStages() - fColorEffectCnt; 156 int m = fDrawState->numColorStages() - fColorEffectCnt;
160 SkASSERT(m >= 0); 157 SkASSERT(m >= 0);
161 fDrawState->fColorStages.pop_back_n(m); 158 fDrawState->fColorStages.pop_back_n(m);
162 159
163 int n = fDrawState->numCoverageStages() - fCoverageEffectCnt; 160 int n = fDrawState->numCoverageStages() - fCoverageEffectCnt;
164 SkASSERT(n >= 0); 161 SkASSERT(n >= 0);
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 void GrDrawState::calcCoverageInvariantOutput(GrColor coverage) const { 229 void GrDrawState::calcCoverageInvariantOutput(GrColor coverage) const {
233 if (!fCoverageProcInfoValid || coverage != fCoverageCache) { 230 if (!fCoverageProcInfoValid || coverage != fCoverageCache) {
234 GrColorComponentFlags flags = kRGBA_GrColorComponentFlags; 231 GrColorComponentFlags flags = kRGBA_GrColorComponentFlags;
235 fCoverageProcInfo.calcWithInitialValues(fCoverageStages.begin(), 232 fCoverageProcInfo.calcWithInitialValues(fCoverageStages.begin(),
236 this->numCoverageStages(), cover age, flags, 233 this->numCoverageStages(), cover age, flags,
237 true); 234 true);
238 fCoverageProcInfoValid = true; 235 fCoverageProcInfoValid = true;
239 fCoverageCache = coverage; 236 fCoverageCache = coverage;
240 } 237 }
241 } 238 }
OLDNEW
« no previous file with comments | « src/gpu/GrDrawState.h ('k') | src/gpu/GrDrawTarget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698