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

Unified Diff: src/effects/SkDisplacementMapEffect.cpp

Issue 101623007: Fixed more issues (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Fixed conflict with senorblanco's cl Created 7 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gm/displacement.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkDisplacementMapEffect.cpp
diff --git a/src/effects/SkDisplacementMapEffect.cpp b/src/effects/SkDisplacementMapEffect.cpp
index 6e5c910edf4f6f04a670841d2906587e95115675..f43287c4d7fcfaa0a3bc9c949a7c78a2f74e1ad6 100644
--- a/src/effects/SkDisplacementMapEffect.cpp
+++ b/src/effects/SkDisplacementMapEffect.cpp
@@ -205,6 +205,14 @@ bool SkDisplacementMapEffect::onFilterImage(Proxy* proxy,
if (!this->applyCropRect(&bounds, ctm)) {
return false;
}
+ SkIRect displBounds;
+ displ.getBounds(&displBounds);
+ if (!this->applyCropRect(&displBounds, ctm)) {
+ return false;
+ }
+ if (!bounds.intersect(displBounds)) {
+ return false;
+ }
dst->setConfig(color.config(), bounds.width(), bounds.height());
dst->allocPixels();
@@ -338,6 +346,14 @@ bool SkDisplacementMapEffect::filterImageGPU(Proxy* proxy, const SkBitmap& src,
if (!this->applyCropRect(&bounds, ctm)) {
return false;
}
+ SkIRect displBounds;
+ displacementBM.getBounds(&displBounds);
+ if (!this->applyCropRect(&displBounds, ctm)) {
+ return false;
+ }
+ if (!bounds.intersect(displBounds)) {
+ return false;
+ }
SkRect srcRect = SkRect::Make(bounds);
SkRect dstRect = SkRect::MakeWH(srcRect.width(), srcRect.height());
context->drawRectToRect(paint, dstRect, srcRect);
« no previous file with comments | « gm/displacement.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698