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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 return GrTBackendFragmentProcessorFactory<GrBicubicEffect>::getInstance(); | 162 return GrTBackendFragmentProcessorFactory<GrBicubicEffect>::getInstance(); |
163 } | 163 } |
164 | 164 |
165 bool GrBicubicEffect::onIsEqual(const GrProcessor& sBase) const { | 165 bool GrBicubicEffect::onIsEqual(const GrProcessor& 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 this->textureAccess(0) == s.textureAccess(0) && |
168 !memcmp(fCoefficients, s.coefficients(), 16) && | 168 !memcmp(fCoefficients, s.coefficients(), 16) && |
169 fDomain == s.fDomain; | 169 fDomain == s.fDomain; |
170 } | 170 } |
171 | 171 |
172 void GrBicubicEffect::getConstantColorComponents(GrColor* color, uint32_t* valid
Flags) const { | 172 void GrBicubicEffect::onComputeInvariantOutput(InvariantOutput* inout) const { |
173 // FIXME: Perhaps we can do better. | 173 // FIXME: Perhaps we can do better. |
174 *validFlags = 0; | 174 inout->fValidFlags = 0; |
| 175 inout->fIsSingleComponent = false; |
175 return; | 176 return; |
176 } | 177 } |
177 | 178 |
178 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrBicubicEffect); | 179 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrBicubicEffect); |
179 | 180 |
180 GrFragmentProcessor* GrBicubicEffect::TestCreate(SkRandom* random, | 181 GrFragmentProcessor* GrBicubicEffect::TestCreate(SkRandom* random, |
181 GrContext* context, | 182 GrContext* context, |
182 const GrDrawTargetCaps&, | 183 const GrDrawTargetCaps&, |
183 GrTexture* textures[]) { | 184 GrTexture* textures[]) { |
184 int texIdx = random->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx : | 185 int texIdx = random->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx : |
(...skipping 30 matching lines...) Expand all Loading... |
215 // Use bilerp to handle rotation or fractional translation. | 216 // Use bilerp to handle rotation or fractional translation. |
216 *filterMode = GrTextureParams::kBilerp_FilterMode; | 217 *filterMode = GrTextureParams::kBilerp_FilterMode; |
217 } | 218 } |
218 return false; | 219 return false; |
219 } | 220 } |
220 // When we use the bicubic filtering effect each sample is read from the tex
ture using | 221 // When we use the bicubic filtering effect each sample is read from the tex
ture using |
221 // nearest neighbor sampling. | 222 // nearest neighbor sampling. |
222 *filterMode = GrTextureParams::kNone_FilterMode; | 223 *filterMode = GrTextureParams::kNone_FilterMode; |
223 return true; | 224 return true; |
224 } | 225 } |
OLD | NEW |