Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(395)

Side by Side Diff: src/effects/SkDisplacementMapEffect.cpp

Issue 23011012: Implement correct clipping for image filters. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Add morphology to the list of ignored tests Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/effects/SkComposeImageFilter.cpp ('k') | src/effects/SkDropShadowImageFilter.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/effects/SkComposeImageFilter.cpp ('k') | src/effects/SkDropShadowImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698