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 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 | 298 |
299 /////////////////////////////////////////////////////////////////////////////// | 299 /////////////////////////////////////////////////////////////////////////////// |
300 | 300 |
301 class GrDisplacementMapEffect : public GrEffect { | 301 class GrDisplacementMapEffect : public GrEffect { |
302 public: | 302 public: |
303 static GrEffectRef* Create(SkDisplacementMapEffect::ChannelSelectorType xCha
nnelSelector, | 303 static GrEffectRef* Create(SkDisplacementMapEffect::ChannelSelectorType xCha
nnelSelector, |
304 SkDisplacementMapEffect::ChannelSelectorType yCha
nnelSelector, | 304 SkDisplacementMapEffect::ChannelSelectorType yCha
nnelSelector, |
305 SkVector scale, | 305 SkVector scale, |
306 GrTexture* displacement, const SkMatrix& offsetMa
trix, | 306 GrTexture* displacement, const SkMatrix& offsetMa
trix, |
307 GrTexture* color) { | 307 GrTexture* color) { |
308 AutoEffectUnref effect(SkNEW_ARGS(GrDisplacementMapEffect, (xChannelSele
ctor, | 308 return SkNEW_ARGS(GrDisplacementMapEffect, (xChannelSelector, |
309 yChannelSele
ctor, | 309 yChannelSelector, |
310 scale, | 310 scale, |
311 displacement
, | 311 displacement, |
312 offsetMatrix
, | 312 offsetMatrix, |
313 color))); | 313 color)); |
314 return CreateEffectRef(effect); | |
315 } | 314 } |
316 | 315 |
317 virtual ~GrDisplacementMapEffect(); | 316 virtual ~GrDisplacementMapEffect(); |
318 | 317 |
319 virtual const GrBackendEffectFactory& getFactory() const SK_OVERRIDE; | 318 virtual const GrBackendEffectFactory& getFactory() const SK_OVERRIDE; |
320 SkDisplacementMapEffect::ChannelSelectorType xChannelSelector() const | 319 SkDisplacementMapEffect::ChannelSelectorType xChannelSelector() const |
321 { return fXChannelSelector; } | 320 { return fXChannelSelector; } |
322 SkDisplacementMapEffect::ChannelSelectorType yChannelSelector() const | 321 SkDisplacementMapEffect::ChannelSelectorType yChannelSelector() const |
323 { return fYChannelSelector; } | 322 { return fYChannelSelector; } |
324 const SkVector& scale() const { return fScale; } | 323 const SkVector& scale() const { return fScale; } |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
605 const GrGLCaps&) { | 604 const GrGLCaps&) { |
606 const GrDisplacementMapEffect& displacementMap = | 605 const GrDisplacementMapEffect& displacementMap = |
607 drawEffect.castEffect<GrDisplacementMapEffect>(); | 606 drawEffect.castEffect<GrDisplacementMapEffect>(); |
608 | 607 |
609 EffectKey xKey = displacementMap.xChannelSelector(); | 608 EffectKey xKey = displacementMap.xChannelSelector(); |
610 EffectKey yKey = displacementMap.yChannelSelector() << kChannelSelectorKeyBi
ts; | 609 EffectKey yKey = displacementMap.yChannelSelector() << kChannelSelectorKeyBi
ts; |
611 | 610 |
612 return xKey | yKey; | 611 return xKey | yKey; |
613 } | 612 } |
614 #endif | 613 #endif |
OLD | NEW |