OLD | NEW |
1 #include "GrBicubicEffect.h" | 1 #include "GrBicubicEffect.h" |
2 | 2 |
3 #define DS(x) SkDoubleToScalar(x) | 3 #define DS(x) SkDoubleToScalar(x) |
4 | 4 |
5 const SkScalar GrBicubicEffect::gMitchellCoefficients[16] = { | 5 const SkScalar GrBicubicEffect::gMitchellCoefficients[16] = { |
6 DS( 1.0 / 18.0), DS(-9.0 / 18.0), DS( 15.0 / 18.0), DS( -7.0 / 18.0), | 6 DS( 1.0 / 18.0), DS(-9.0 / 18.0), DS( 15.0 / 18.0), DS( -7.0 / 18.0), |
7 DS(16.0 / 18.0), DS( 0.0 / 18.0), DS(-36.0 / 18.0), DS( 21.0 / 18.0), | 7 DS(16.0 / 18.0), DS( 0.0 / 18.0), DS(-36.0 / 18.0), DS( 21.0 / 18.0), |
8 DS( 1.0 / 18.0), DS( 9.0 / 18.0), DS( 27.0 / 18.0), DS(-21.0 / 18.0), | 8 DS( 1.0 / 18.0), DS( 9.0 / 18.0), DS( 27.0 / 18.0), DS(-21.0 / 18.0), |
9 DS( 0.0 / 18.0), DS( 0.0 / 18.0), DS( -6.0 / 18.0), DS( 7.0 / 18.0), | 9 DS( 0.0 / 18.0), DS( 0.0 / 18.0), DS( -6.0 / 18.0), DS( 7.0 / 18.0), |
10 }; | 10 }; |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 } | 154 } |
155 | 155 |
156 void GrBicubicEffect::getConstantColorComponents(GrColor* color, uint32_t* valid
Flags) const { | 156 void GrBicubicEffect::getConstantColorComponents(GrColor* color, uint32_t* valid
Flags) const { |
157 // FIXME: Perhaps we can do better. | 157 // FIXME: Perhaps we can do better. |
158 *validFlags = 0; | 158 *validFlags = 0; |
159 return; | 159 return; |
160 } | 160 } |
161 | 161 |
162 GR_DEFINE_EFFECT_TEST(GrBicubicEffect); | 162 GR_DEFINE_EFFECT_TEST(GrBicubicEffect); |
163 | 163 |
164 GrEffectRef* GrBicubicEffect::TestCreate(SkMWCRandom* random, | 164 GrEffectRef* GrBicubicEffect::TestCreate(SkRandom* random, |
165 GrContext* context, | 165 GrContext* context, |
166 const GrDrawTargetCaps&, | 166 const GrDrawTargetCaps&, |
167 GrTexture* textures[]) { | 167 GrTexture* textures[]) { |
168 int texIdx = random->nextBool() ? GrEffectUnitTest::kSkiaPMTextureIdx : | 168 int texIdx = random->nextBool() ? GrEffectUnitTest::kSkiaPMTextureIdx : |
169 GrEffectUnitTest::kAlphaTextureIdx; | 169 GrEffectUnitTest::kAlphaTextureIdx; |
170 SkScalar coefficients[16]; | 170 SkScalar coefficients[16]; |
171 for (int i = 0; i < 16; i++) { | 171 for (int i = 0; i < 16; i++) { |
172 coefficients[i] = random->nextSScalar1(); | 172 coefficients[i] = random->nextSScalar1(); |
173 } | 173 } |
174 return GrBicubicEffect::Create(textures[texIdx], coefficients); | 174 return GrBicubicEffect::Create(textures[texIdx], coefficients); |
175 } | 175 } |
OLD | NEW |