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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 /////////////////////////////////////////////////////////////////////////////// | 162 /////////////////////////////////////////////////////////////////////////////// |
163 | 163 |
164 SkDisplacementMapEffect* SkDisplacementMapEffect::Create(ChannelSelectorType xCh
annelSelector, | 164 SkDisplacementMapEffect* SkDisplacementMapEffect::Create(ChannelSelectorType xCh
annelSelector, |
165 ChannelSelectorType yCh
annelSelector, | 165 ChannelSelectorType yCh
annelSelector, |
166 SkScalar scale, | 166 SkScalar scale, |
167 SkImageFilter* displace
ment, | 167 SkImageFilter* displace
ment, |
168 SkImageFilter* color, | 168 SkImageFilter* color, |
169 const CropRect* cropRec
t) { | 169 const CropRect* cropRec
t) { |
170 if (!channel_selector_type_is_valid(xChannelSelector) || | 170 if (!channel_selector_type_is_valid(xChannelSelector) || |
171 !channel_selector_type_is_valid(yChannelSelector)) { | 171 !channel_selector_type_is_valid(yChannelSelector)) { |
172 return NULL; | 172 return nullptr; |
173 } | 173 } |
174 | 174 |
175 SkImageFilter* inputs[2] = { displacement, color }; | 175 SkImageFilter* inputs[2] = { displacement, color }; |
176 return new SkDisplacementMapEffect(xChannelSelector, yChannelSelector, scale
, inputs, cropRect); | 176 return new SkDisplacementMapEffect(xChannelSelector, yChannelSelector, scale
, inputs, cropRect); |
177 } | 177 } |
178 | 178 |
179 SkDisplacementMapEffect::SkDisplacementMapEffect(ChannelSelectorType xChannelSel
ector, | 179 SkDisplacementMapEffect::SkDisplacementMapEffect(ChannelSelectorType xChannelSel
ector, |
180 ChannelSelectorType yChannelSel
ector, | 180 ChannelSelectorType yChannelSel
ector, |
181 SkScalar scale, | 181 SkScalar scale, |
182 SkImageFilter* inputs[2], | 182 SkImageFilter* inputs[2], |
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
633 const GrGLSLCaps&, GrProcessorKeyBuilder*
b) { | 633 const GrGLSLCaps&, GrProcessorKeyBuilder*
b) { |
634 const GrDisplacementMapEffect& displacementMap = proc.cast<GrDisplacementMap
Effect>(); | 634 const GrDisplacementMapEffect& displacementMap = proc.cast<GrDisplacementMap
Effect>(); |
635 | 635 |
636 uint32_t xKey = displacementMap.xChannelSelector(); | 636 uint32_t xKey = displacementMap.xChannelSelector(); |
637 uint32_t yKey = displacementMap.yChannelSelector() << kChannelSelectorKeyBit
s; | 637 uint32_t yKey = displacementMap.yChannelSelector() << kChannelSelectorKeyBit
s; |
638 | 638 |
639 b->add32(xKey | yKey); | 639 b->add32(xKey | yKey); |
640 } | 640 } |
641 #endif | 641 #endif |
642 | 642 |
OLD | NEW |