OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |