| 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 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 } | 248 } |
| 249 | 249 |
| 250 void SkDisplacementMapEffect::computeFastBounds(const SkRect& src, SkRect* dst)
const { | 250 void SkDisplacementMapEffect::computeFastBounds(const SkRect& src, SkRect* dst)
const { |
| 251 if (getColorInput()) { | 251 if (getColorInput()) { |
| 252 getColorInput()->computeFastBounds(src, dst); | 252 getColorInput()->computeFastBounds(src, dst); |
| 253 } else { | 253 } else { |
| 254 *dst = src; | 254 *dst = src; |
| 255 } | 255 } |
| 256 } | 256 } |
| 257 | 257 |
| 258 bool SkDisplacementMapEffect::onFilterBounds(const SkIRect& src, const SkMatrix&
ctm, |
| 259 SkIRect* dst) const { |
| 260 if (getColorInput()) { |
| 261 return getColorInput()->filterBounds(src, ctm, dst); |
| 262 } |
| 263 *dst = src; |
| 264 return true; |
| 265 } |
| 266 |
| 258 /////////////////////////////////////////////////////////////////////////////// | 267 /////////////////////////////////////////////////////////////////////////////// |
| 259 | 268 |
| 260 #if SK_SUPPORT_GPU | 269 #if SK_SUPPORT_GPU |
| 261 class GrGLDisplacementMapEffect : public GrGLEffect { | 270 class GrGLDisplacementMapEffect : public GrGLEffect { |
| 262 public: | 271 public: |
| 263 GrGLDisplacementMapEffect(const GrBackendEffectFactory& factory, | 272 GrGLDisplacementMapEffect(const GrBackendEffectFactory& factory, |
| 264 const GrDrawEffect& drawEffect); | 273 const GrDrawEffect& drawEffect); |
| 265 virtual ~GrGLDisplacementMapEffect(); | 274 virtual ~GrGLDisplacementMapEffect(); |
| 266 | 275 |
| 267 virtual void emitCode(GrGLShaderBuilder*, | 276 virtual void emitCode(GrGLShaderBuilder*, |
| (...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 590 const GrGLCaps&) { | 599 const GrGLCaps&) { |
| 591 const GrDisplacementMapEffect& displacementMap = | 600 const GrDisplacementMapEffect& displacementMap = |
| 592 drawEffect.castEffect<GrDisplacementMapEffect>(); | 601 drawEffect.castEffect<GrDisplacementMapEffect>(); |
| 593 | 602 |
| 594 EffectKey xKey = displacementMap.xChannelSelector(); | 603 EffectKey xKey = displacementMap.xChannelSelector(); |
| 595 EffectKey yKey = displacementMap.yChannelSelector() << SkDisplacementMapEffe
ct::kKeyBits; | 604 EffectKey yKey = displacementMap.yChannelSelector() << SkDisplacementMapEffe
ct::kKeyBits; |
| 596 | 605 |
| 597 return xKey | yKey; | 606 return xKey | yKey; |
| 598 } | 607 } |
| 599 #endif | 608 #endif |
| OLD | NEW |