OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 The Android Open Source Project | 2 * Copyright 2013 The Android Open Source Project |
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 "SkBicubicImageFilter.h" | 8 #include "SkBicubicImageFilter.h" |
9 #include "SkBitmap.h" | 9 #include "SkBitmap.h" |
10 #include "SkColorPriv.h" | 10 #include "SkColorPriv.h" |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 void GrBicubicEffect::getConstantColorComponents(GrColor* color, uint32_t* valid
Flags) const { | 319 void GrBicubicEffect::getConstantColorComponents(GrColor* color, uint32_t* valid
Flags) const { |
320 // FIXME: Perhaps we can do better. | 320 // FIXME: Perhaps we can do better. |
321 *validFlags = 0; | 321 *validFlags = 0; |
322 return; | 322 return; |
323 } | 323 } |
324 | 324 |
325 GR_DEFINE_EFFECT_TEST(GrBicubicEffect); | 325 GR_DEFINE_EFFECT_TEST(GrBicubicEffect); |
326 | 326 |
327 GrEffectRef* GrBicubicEffect::TestCreate(SkMWCRandom* random, | 327 GrEffectRef* GrBicubicEffect::TestCreate(SkMWCRandom* random, |
328 GrContext* context, | 328 GrContext* context, |
| 329 const GrDrawTargetCaps&, |
329 GrTexture* textures[]) { | 330 GrTexture* textures[]) { |
330 int texIdx = random->nextBool() ? GrEffectUnitTest::kSkiaPMTextureIdx : | 331 int texIdx = random->nextBool() ? GrEffectUnitTest::kSkiaPMTextureIdx : |
331 GrEffectUnitTest::kAlphaTextureIdx; | 332 GrEffectUnitTest::kAlphaTextureIdx; |
332 SkScalar coefficients[16]; | 333 SkScalar coefficients[16]; |
333 for (int i = 0; i < 16; i++) { | 334 for (int i = 0; i < 16; i++) { |
334 coefficients[i] = random->nextSScalar1(); | 335 coefficients[i] = random->nextSScalar1(); |
335 } | 336 } |
336 return GrBicubicEffect::Create(textures[texIdx], coefficients); | 337 return GrBicubicEffect::Create(textures[texIdx], coefficients); |
337 } | 338 } |
338 | 339 |
(...skipping 23 matching lines...) Expand all Loading... |
362 GrPaint paint; | 363 GrPaint paint; |
363 paint.colorStage(0)->setEffect(GrBicubicEffect::Create(srcTexture, fCoeffici
ents))->unref(); | 364 paint.colorStage(0)->setEffect(GrBicubicEffect::Create(srcTexture, fCoeffici
ents))->unref(); |
364 SkRect srcRect; | 365 SkRect srcRect; |
365 srcBM.getBounds(&srcRect); | 366 srcBM.getBounds(&srcRect); |
366 context->drawRectToRect(paint, dstRect, srcRect); | 367 context->drawRectToRect(paint, dstRect, srcRect); |
367 return SkImageFilterUtils::WrapTexture(dst, desc.fWidth, desc.fHeight, resul
t); | 368 return SkImageFilterUtils::WrapTexture(dst, desc.fWidth, desc.fHeight, resul
t); |
368 } | 369 } |
369 #endif | 370 #endif |
370 | 371 |
371 /////////////////////////////////////////////////////////////////////////////// | 372 /////////////////////////////////////////////////////////////////////////////// |
OLD | NEW |