OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 "SkDisplacementMapEffect.h" | 8 #include "SkDisplacementMapEffect.h" |
9 #include "SkFlattenableBuffers.h" | 9 #include "SkFlattenableBuffers.h" |
10 #include "SkUnPreMultiply.h" | 10 #include "SkUnPreMultiply.h" |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 // not of constant color when a displacement effect is applied. | 356 // not of constant color when a displacement effect is applied. |
357 *validFlags = 0; | 357 *validFlags = 0; |
358 } | 358 } |
359 | 359 |
360 /////////////////////////////////////////////////////////////////////////////// | 360 /////////////////////////////////////////////////////////////////////////////// |
361 | 361 |
362 GR_DEFINE_EFFECT_TEST(GrDisplacementMapEffect); | 362 GR_DEFINE_EFFECT_TEST(GrDisplacementMapEffect); |
363 | 363 |
364 GrEffectRef* GrDisplacementMapEffect::TestCreate(SkMWCRandom* random, | 364 GrEffectRef* GrDisplacementMapEffect::TestCreate(SkMWCRandom* random, |
365 GrContext*, | 365 GrContext*, |
| 366 const GrDrawTargetCaps&, |
366 GrTexture* textures[]) { | 367 GrTexture* textures[]) { |
367 int texIdxDispl = random->nextBool() ? GrEffectUnitTest::kSkiaPMTextureIdx : | 368 int texIdxDispl = random->nextBool() ? GrEffectUnitTest::kSkiaPMTextureIdx : |
368 GrEffectUnitTest::kAlphaTextureIdx; | 369 GrEffectUnitTest::kAlphaTextureIdx; |
369 int texIdxColor = random->nextBool() ? GrEffectUnitTest::kSkiaPMTextureIdx : | 370 int texIdxColor = random->nextBool() ? GrEffectUnitTest::kSkiaPMTextureIdx : |
370 GrEffectUnitTest::kAlphaTextureIdx; | 371 GrEffectUnitTest::kAlphaTextureIdx; |
371 static const int kMaxComponent = 4; | 372 static const int kMaxComponent = 4; |
372 SkDisplacementMapEffect::ChannelSelectorType xChannelSelector = | 373 SkDisplacementMapEffect::ChannelSelectorType xChannelSelector = |
373 static_cast<SkDisplacementMapEffect::ChannelSelectorType>( | 374 static_cast<SkDisplacementMapEffect::ChannelSelectorType>( |
374 random->nextRangeU(1, kMaxComponent)); | 375 random->nextRangeU(1, kMaxComponent)); |
375 SkDisplacementMapEffect::ChannelSelectorType yChannelSelector = | 376 SkDisplacementMapEffect::ChannelSelectorType yChannelSelector = |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
526 colorTex); | 527 colorTex); |
527 | 528 |
528 colorKey <<= GrGLEffectMatrix::kKeyBits; | 529 colorKey <<= GrGLEffectMatrix::kKeyBits; |
529 EffectKey xKey = displacementMap.xChannelSelector() << (2 * GrGLEffectMatrix
::kKeyBits); | 530 EffectKey xKey = displacementMap.xChannelSelector() << (2 * GrGLEffectMatrix
::kKeyBits); |
530 EffectKey yKey = displacementMap.yChannelSelector() << (2 * GrGLEffectMatrix
::kKeyBits + | 531 EffectKey yKey = displacementMap.yChannelSelector() << (2 * GrGLEffectMatrix
::kKeyBits + |
531 SkDisplacementMapEff
ect::kKeyBits); | 532 SkDisplacementMapEff
ect::kKeyBits); |
532 | 533 |
533 return xKey | yKey | displKey | colorKey; | 534 return xKey | yKey | displKey | colorKey; |
534 } | 535 } |
535 #endif | 536 #endif |
OLD | NEW |