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 "SkDevice.h" | 9 #include "SkDevice.h" |
10 #include "SkReadBuffer.h" | 10 #include "SkReadBuffer.h" |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 default: | 157 default: |
158 break; | 158 break; |
159 } | 159 } |
160 return false; | 160 return false; |
161 } | 161 } |
162 | 162 |
163 } // end namespace | 163 } // end namespace |
164 | 164 |
165 /////////////////////////////////////////////////////////////////////////////// | 165 /////////////////////////////////////////////////////////////////////////////// |
166 | 166 |
167 SkDisplacementMapEffect* SkDisplacementMapEffect::Create(ChannelSelectorType xCh
annelSelector, | 167 SkImageFilter* SkDisplacementMapEffect::Create(ChannelSelectorType xChannelSelec
tor, |
168 ChannelSelectorType yCh
annelSelector, | 168 ChannelSelectorType yChannelSelec
tor, |
169 SkScalar scale, | 169 SkScalar scale, |
170 SkImageFilter* displace
ment, | 170 SkImageFilter* displacement, |
171 SkImageFilter* color, | 171 SkImageFilter* color, |
172 const CropRect* cropRec
t) { | 172 const CropRect* cropRect) { |
173 if (!channel_selector_type_is_valid(xChannelSelector) || | 173 if (!channel_selector_type_is_valid(xChannelSelector) || |
174 !channel_selector_type_is_valid(yChannelSelector)) { | 174 !channel_selector_type_is_valid(yChannelSelector)) { |
175 return nullptr; | 175 return nullptr; |
176 } | 176 } |
177 | 177 |
178 SkImageFilter* inputs[2] = { displacement, color }; | 178 SkImageFilter* inputs[2] = { displacement, color }; |
179 return new SkDisplacementMapEffect(xChannelSelector, yChannelSelector, scale
, inputs, cropRect); | 179 return new SkDisplacementMapEffect(xChannelSelector, yChannelSelector, scale
, inputs, cropRect); |
180 } | 180 } |
181 | 181 |
182 SkDisplacementMapEffect::SkDisplacementMapEffect(ChannelSelectorType xChannelSel
ector, | 182 SkDisplacementMapEffect::SkDisplacementMapEffect(ChannelSelectorType xChannelSel
ector, |
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
641 const GrGLSLCaps&, GrProcessorKeyBuilder*
b) { | 641 const GrGLSLCaps&, GrProcessorKeyBuilder*
b) { |
642 const GrDisplacementMapEffect& displacementMap = proc.cast<GrDisplacementMap
Effect>(); | 642 const GrDisplacementMapEffect& displacementMap = proc.cast<GrDisplacementMap
Effect>(); |
643 | 643 |
644 uint32_t xKey = displacementMap.xChannelSelector(); | 644 uint32_t xKey = displacementMap.xChannelSelector(); |
645 uint32_t yKey = displacementMap.yChannelSelector() << kChannelSelectorKeyBit
s; | 645 uint32_t yKey = displacementMap.yChannelSelector() << kChannelSelectorKeyBit
s; |
646 | 646 |
647 b->add32(xKey | yKey); | 647 b->add32(xKey | yKey); |
648 } | 648 } |
649 #endif | 649 #endif |
650 | 650 |
OLD | NEW |