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" |
11 #include "SkUnPreMultiply.h" | 11 #include "SkUnPreMultiply.h" |
12 #include "SkColorPriv.h" | 12 #include "SkColorPriv.h" |
13 #if SK_SUPPORT_GPU | 13 #if SK_SUPPORT_GPU |
14 #include "GrContext.h" | 14 #include "GrContext.h" |
15 #include "GrDrawContext.h" | 15 #include "GrDrawContext.h" |
16 #include "GrCoordTransform.h" | 16 #include "GrCoordTransform.h" |
17 #include "GrInvariantOutput.h" | 17 #include "GrInvariantOutput.h" |
18 #include "effects/GrTextureDomain.h" | 18 #include "effects/GrTextureDomain.h" |
19 #include "gl/GrGLProcessor.h" | 19 #include "gl/GrGLFragmentProcessor.h" |
20 #include "gl/builders/GrGLProgramBuilder.h" | 20 #include "gl/builders/GrGLProgramBuilder.h" |
21 #endif | 21 #endif |
22 | 22 |
23 namespace { | 23 namespace { |
24 | 24 |
25 #define kChannelSelectorKeyBits 3; // Max value is 4, so 3 bits are required at
most | 25 #define kChannelSelectorKeyBits 3; // Max value is 4, so 3 bits are required at
most |
26 | 26 |
27 template<SkDisplacementMapEffect::ChannelSelectorType type> | 27 template<SkDisplacementMapEffect::ChannelSelectorType type> |
28 uint32_t getValue(SkColor, const SkUnPreMultiply::Scale*) { | 28 uint32_t getValue(SkColor, const SkUnPreMultiply::Scale*) { |
29 SkDEBUGFAIL("Unknown channel selector"); | 29 SkDEBUGFAIL("Unknown channel selector"); |
(...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
647 const GrGLSLCaps&, GrProcessorKeyBuilder*
b) { | 647 const GrGLSLCaps&, GrProcessorKeyBuilder*
b) { |
648 const GrDisplacementMapEffect& displacementMap = proc.cast<GrDisplacementMap
Effect>(); | 648 const GrDisplacementMapEffect& displacementMap = proc.cast<GrDisplacementMap
Effect>(); |
649 | 649 |
650 uint32_t xKey = displacementMap.xChannelSelector(); | 650 uint32_t xKey = displacementMap.xChannelSelector(); |
651 uint32_t yKey = displacementMap.yChannelSelector() << kChannelSelectorKeyBit
s; | 651 uint32_t yKey = displacementMap.yChannelSelector() << kChannelSelectorKeyBit
s; |
652 | 652 |
653 b->add32(xKey | yKey); | 653 b->add32(xKey | yKey); |
654 } | 654 } |
655 #endif | 655 #endif |
656 | 656 |
OLD | NEW |