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

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

Issue 656503002: Move willUseInputColor check to computeInvariantOutput (Closed) Base URL: https://skia.googlesource.com/skia.git@addMultFlag
Patch Set: Rebase2 Created 6 years, 2 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/GrOptDrawState.cpp ('k') | src/gpu/effects/GrConvexPolyEffect.cpp » ('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 "GrProcessor.h" 8 #include "GrProcessor.h"
9 #include "GrBackendProcessorFactory.h" 9 #include "GrBackendProcessorFactory.h"
10 #include "GrContext.h" 10 #include "GrContext.h"
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 126
127 void GrProcessor::InvariantOutput::validate() const { 127 void GrProcessor::InvariantOutput::validate() const {
128 if (fIsSingleComponent) { 128 if (fIsSingleComponent) {
129 SkASSERT(0 == fValidFlags || kRGBA_GrColorComponentFlags == fValidFlags) ; 129 SkASSERT(0 == fValidFlags || kRGBA_GrColorComponentFlags == fValidFlags) ;
130 if (kRGBA_GrColorComponentFlags == fValidFlags) { 130 if (kRGBA_GrColorComponentFlags == fValidFlags) {
131 SkASSERT(this->colorComponentsAllEqual()); 131 SkASSERT(this->colorComponentsAllEqual());
132 } 132 }
133 } 133 }
134 134
135 SkASSERT(this->validPreMulColor()); 135 SkASSERT(this->validPreMulColor());
136
137 // If we claim that we are not using the input color we must not be modulati ng the input.
138 SkASSERT(fNonMulStageFound || fWillUseInputColor);
136 } 139 }
137 140
138 bool GrProcessor::InvariantOutput::colorComponentsAllEqual() const { 141 bool GrProcessor::InvariantOutput::colorComponentsAllEqual() const {
139 unsigned colorA = GrColorUnpackA(fColor); 142 unsigned colorA = GrColorUnpackA(fColor);
140 return(GrColorUnpackR(fColor) == colorA && 143 return(GrColorUnpackR(fColor) == colorA &&
141 GrColorUnpackG(fColor) == colorA && 144 GrColorUnpackG(fColor) == colorA &&
142 GrColorUnpackB(fColor) == colorA); 145 GrColorUnpackB(fColor) == colorA);
143 } 146 }
144 147
145 bool GrProcessor::InvariantOutput::validPreMulColor() const { 148 bool GrProcessor::InvariantOutput::validPreMulColor() const {
(...skipping 19 matching lines...) Expand all
165 return true; 168 return true;
166 } 169 }
167 #endif // end DEBUG 170 #endif // end DEBUG
168 171
169 //////////////////////////////////////////////////////////////////////////////// /////////////////// 172 //////////////////////////////////////////////////////////////////////////////// ///////////////////
170 173
171 void GrFragmentProcessor::addCoordTransform(const GrCoordTransform* transform) { 174 void GrFragmentProcessor::addCoordTransform(const GrCoordTransform* transform) {
172 fCoordTransforms.push_back(transform); 175 fCoordTransforms.push_back(transform);
173 SkDEBUGCODE(transform->setInEffect();) 176 SkDEBUGCODE(transform->setInEffect();)
174 } 177 }
OLDNEW
« no previous file with comments | « src/gpu/GrOptDrawState.cpp ('k') | src/gpu/effects/GrConvexPolyEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698