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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 } | 123 } |
124 for (int i = 0; i < this->numTextures(); ++i) { | 124 for (int i = 0; i < this->numTextures(); ++i) { |
125 if (this->textureAccess(i) != that.textureAccess(i)) { | 125 if (this->textureAccess(i) != that.textureAccess(i)) { |
126 return false; | 126 return false; |
127 } | 127 } |
128 } | 128 } |
129 return true; | 129 return true; |
130 } | 130 } |
131 | 131 |
132 void GrProcessor::computeInvariantOutput(GrInvariantOutput* inout) const { | 132 void GrProcessor::computeInvariantOutput(GrInvariantOutput* inout) const { |
133 inout->resetWillUseInputColor(); | |
134 this->onComputeInvariantOutput(inout); | 133 this->onComputeInvariantOutput(inout); |
135 #ifdef SK_DEBUG | |
136 inout->validate(); | |
137 #endif | |
138 } | 134 } |
139 | 135 |
140 ////////////////////////////////////////////////////////////////////////////////
/////////////////// | 136 ////////////////////////////////////////////////////////////////////////////////
/////////////////// |
141 | 137 |
142 void GrFragmentProcessor::addCoordTransform(const GrCoordTransform* transform) { | 138 void GrFragmentProcessor::addCoordTransform(const GrCoordTransform* transform) { |
143 fCoordTransforms.push_back(transform); | 139 fCoordTransforms.push_back(transform); |
144 SkDEBUGCODE(transform->setInProcessor();) | 140 SkDEBUGCODE(transform->setInProcessor();) |
145 } | 141 } |
146 | 142 |
147 bool GrFragmentProcessor::hasSameTransforms(const GrFragmentProcessor& that) con
st { | 143 bool GrFragmentProcessor::hasSameTransforms(const GrFragmentProcessor& that) con
st { |
148 if (fCoordTransforms.count() != that.fCoordTransforms.count()) { | 144 if (fCoordTransforms.count() != that.fCoordTransforms.count()) { |
149 return false; | 145 return false; |
150 } | 146 } |
151 int count = fCoordTransforms.count(); | 147 int count = fCoordTransforms.count(); |
152 for (int i = 0; i < count; ++i) { | 148 for (int i = 0; i < count; ++i) { |
153 if (*fCoordTransforms[i] != *that.fCoordTransforms[i]) { | 149 if (*fCoordTransforms[i] != *that.fCoordTransforms[i]) { |
154 return false; | 150 return false; |
155 } | 151 } |
156 } | 152 } |
157 return true; | 153 return true; |
158 } | 154 } |
OLD | NEW |