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 "SkReadBuffer.h" | 9 #include "SkReadBuffer.h" |
10 #include "SkWriteBuffer.h" | 10 #include "SkWriteBuffer.h" |
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
510 // not of constant color when a displacement effect is applied. | 510 // not of constant color when a displacement effect is applied. |
511 inout->setToUnknown(GrInvariantOutput::kWillNot_ReadInput); | 511 inout->setToUnknown(GrInvariantOutput::kWillNot_ReadInput); |
512 } | 512 } |
513 | 513 |
514 /////////////////////////////////////////////////////////////////////////////// | 514 /////////////////////////////////////////////////////////////////////////////// |
515 | 515 |
516 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrDisplacementMapEffect); | 516 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrDisplacementMapEffect); |
517 | 517 |
518 GrFragmentProcessor* GrDisplacementMapEffect::TestCreate(SkRandom* random, | 518 GrFragmentProcessor* GrDisplacementMapEffect::TestCreate(SkRandom* random, |
519 GrContext*, | 519 GrContext*, |
520 const GrDrawTargetCaps&, | 520 const GrCaps&, |
521 GrTexture* textures[]) { | 521 GrTexture* textures[]) { |
522 int texIdxDispl = random->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureId
x : | 522 int texIdxDispl = random->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureId
x : |
523 GrProcessorUnitTest::kAlphaTextureIdx
; | 523 GrProcessorUnitTest::kAlphaTextureIdx
; |
524 int texIdxColor = random->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureId
x : | 524 int texIdxColor = random->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureId
x : |
525 GrProcessorUnitTest::kAlphaTextureIdx
; | 525 GrProcessorUnitTest::kAlphaTextureIdx
; |
526 static const int kMaxComponent = 4; | 526 static const int kMaxComponent = 4; |
527 SkDisplacementMapEffect::ChannelSelectorType xChannelSelector = | 527 SkDisplacementMapEffect::ChannelSelectorType xChannelSelector = |
528 static_cast<SkDisplacementMapEffect::ChannelSelectorType>( | 528 static_cast<SkDisplacementMapEffect::ChannelSelectorType>( |
529 random->nextRangeU(1, kMaxComponent)); | 529 random->nextRangeU(1, kMaxComponent)); |
530 SkDisplacementMapEffect::ChannelSelectorType yChannelSelector = | 530 SkDisplacementMapEffect::ChannelSelectorType yChannelSelector = |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
637 const GrGLSLCaps&, GrProcessorKeyBuilder*
b) { | 637 const GrGLSLCaps&, GrProcessorKeyBuilder*
b) { |
638 const GrDisplacementMapEffect& displacementMap = proc.cast<GrDisplacementMap
Effect>(); | 638 const GrDisplacementMapEffect& displacementMap = proc.cast<GrDisplacementMap
Effect>(); |
639 | 639 |
640 uint32_t xKey = displacementMap.xChannelSelector(); | 640 uint32_t xKey = displacementMap.xChannelSelector(); |
641 uint32_t yKey = displacementMap.yChannelSelector() << kChannelSelectorKeyBit
s; | 641 uint32_t yKey = displacementMap.yChannelSelector() << kChannelSelectorKeyBit
s; |
642 | 642 |
643 b->add32(xKey | yKey); | 643 b->add32(xKey | yKey); |
644 } | 644 } |
645 #endif | 645 #endif |
646 | 646 |
OLD | NEW |