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 "GrBicubicEffect.h" | 8 #include "GrBicubicEffect.h" |
9 #include "GrInvariantOutput.h" | 9 #include "GrInvariantOutput.h" |
10 #include "gl/builders/GrGLProgramBuilder.h" | 10 #include "gl/builders/GrGLProgramBuilder.h" |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 fDomain == s.fDomain; | 168 fDomain == s.fDomain; |
169 } | 169 } |
170 | 170 |
171 void GrBicubicEffect::onComputeInvariantOutput(GrInvariantOutput* inout) const { | 171 void GrBicubicEffect::onComputeInvariantOutput(GrInvariantOutput* inout) const { |
172 // FIXME: Perhaps we can do better. | 172 // FIXME: Perhaps we can do better. |
173 inout->mulByUnknownSingleComponent(); | 173 inout->mulByUnknownSingleComponent(); |
174 } | 174 } |
175 | 175 |
176 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrBicubicEffect); | 176 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrBicubicEffect); |
177 | 177 |
178 GrFragmentProcessor* GrBicubicEffect::TestCreate(GrProcessorTestData* d) { | 178 const GrFragmentProcessor* GrBicubicEffect::TestCreate(GrProcessorTestData* d) { |
179 int texIdx = d->fRandom->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx
: | 179 int texIdx = d->fRandom->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx
: |
180 GrProcessorUnitTest::kAlphaTextureIdx; | 180 GrProcessorUnitTest::kAlphaTextureIdx; |
181 SkScalar coefficients[16]; | 181 SkScalar coefficients[16]; |
182 for (int i = 0; i < 16; i++) { | 182 for (int i = 0; i < 16; i++) { |
183 coefficients[i] = d->fRandom->nextSScalar1(); | 183 coefficients[i] = d->fRandom->nextSScalar1(); |
184 } | 184 } |
185 return GrBicubicEffect::Create(d->fProcDataManager, d->fTextures[texIdx], co
efficients); | 185 return GrBicubicEffect::Create(d->fProcDataManager, d->fTextures[texIdx], co
efficients); |
186 } | 186 } |
187 | 187 |
188 ////////////////////////////////////////////////////////////////////////////// | 188 ////////////////////////////////////////////////////////////////////////////// |
(...skipping 21 matching lines...) Expand all Loading... |
210 // Use bilerp to handle rotation or fractional translation. | 210 // Use bilerp to handle rotation or fractional translation. |
211 *filterMode = GrTextureParams::kBilerp_FilterMode; | 211 *filterMode = GrTextureParams::kBilerp_FilterMode; |
212 } | 212 } |
213 return false; | 213 return false; |
214 } | 214 } |
215 // When we use the bicubic filtering effect each sample is read from the tex
ture using | 215 // When we use the bicubic filtering effect each sample is read from the tex
ture using |
216 // nearest neighbor sampling. | 216 // nearest neighbor sampling. |
217 *filterMode = GrTextureParams::kNone_FilterMode; | 217 *filterMode = GrTextureParams::kNone_FilterMode; |
218 return true; | 218 return true; |
219 } | 219 } |
OLD | NEW |