OLD | NEW |
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 "gl/builders/GrGLProgramBuilder.h" | 8 #include "gl/builders/GrGLProgramBuilder.h" |
9 #include "GrBicubicEffect.h" | 9 #include "GrBicubicEffect.h" |
10 | 10 |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 | 157 |
158 GrBicubicEffect::~GrBicubicEffect() { | 158 GrBicubicEffect::~GrBicubicEffect() { |
159 } | 159 } |
160 | 160 |
161 const GrBackendFragmentProcessorFactory& GrBicubicEffect::getFactory() const { | 161 const GrBackendFragmentProcessorFactory& GrBicubicEffect::getFactory() const { |
162 return GrTBackendFragmentProcessorFactory<GrBicubicEffect>::getInstance(); | 162 return GrTBackendFragmentProcessorFactory<GrBicubicEffect>::getInstance(); |
163 } | 163 } |
164 | 164 |
165 bool GrBicubicEffect::onIsEqual(const GrFragmentProcessor& sBase) const { | 165 bool GrBicubicEffect::onIsEqual(const GrFragmentProcessor& sBase) const { |
166 const GrBicubicEffect& s = sBase.cast<GrBicubicEffect>(); | 166 const GrBicubicEffect& s = sBase.cast<GrBicubicEffect>(); |
167 return this->textureAccess(0) == s.textureAccess(0) && | 167 return !memcmp(fCoefficients, s.coefficients(), 16) && |
168 !memcmp(fCoefficients, s.coefficients(), 16) && | |
169 fDomain == s.fDomain; | 168 fDomain == s.fDomain; |
170 } | 169 } |
171 | 170 |
172 void GrBicubicEffect::onComputeInvariantOutput(InvariantOutput* inout) const { | 171 void GrBicubicEffect::onComputeInvariantOutput(InvariantOutput* inout) const { |
173 // FIXME: Perhaps we can do better. | 172 // FIXME: Perhaps we can do better. |
174 inout->mulByUnknownAlpha(); | 173 inout->mulByUnknownAlpha(); |
175 } | 174 } |
176 | 175 |
177 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrBicubicEffect); | 176 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrBicubicEffect); |
178 | 177 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 // Use bilerp to handle rotation or fractional translation. | 213 // Use bilerp to handle rotation or fractional translation. |
215 *filterMode = GrTextureParams::kBilerp_FilterMode; | 214 *filterMode = GrTextureParams::kBilerp_FilterMode; |
216 } | 215 } |
217 return false; | 216 return false; |
218 } | 217 } |
219 // When we use the bicubic filtering effect each sample is read from the tex
ture using | 218 // When we use the bicubic filtering effect each sample is read from the tex
ture using |
220 // nearest neighbor sampling. | 219 // nearest neighbor sampling. |
221 *filterMode = GrTextureParams::kNone_FilterMode; | 220 *filterMode = GrTextureParams::kNone_FilterMode; |
222 return true; | 221 return true; |
223 } | 222 } |
OLD | NEW |