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

Unified Diff: src/effects/SkDisplacementMapEffect.cpp

Issue 1702683002: Image filters: change applyCropRect() to take a src rect. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/effects/SkColorFilterImageFilter.cpp ('k') | src/effects/SkDropShadowImageFilter.cpp » ('j') | 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 ec306cca3ba0097ca9f80bb23eecf26bb6c659a1..2f95474a76b2d0a70f097432b3c65d223ffdf5fc 100644
--- a/src/effects/SkDisplacementMapEffect.cpp
+++ b/src/effects/SkDisplacementMapEffect.cpp
@@ -228,7 +228,9 @@ bool SkDisplacementMapEffect::onFilterImage(Proxy* proxy,
SkIRect bounds;
// Since computeDisplacement does bounds checking on color pixel access, we don't need to pad
// the color bitmap to bounds here.
- if (!this->applyCropRect(ctx, color, colorOffset, &bounds)) {
+ SkIRect srcBounds = color.bounds();
+ srcBounds.offset(colorOffset);
+ if (!this->applyCropRect(ctx, srcBounds, &bounds)) {
return false;
}
SkIRect displBounds;
@@ -396,10 +398,12 @@ bool SkDisplacementMapEffect::filterImageGPU(Proxy* proxy, const SkBitmap& src,
if (!this->filterInputGPU(0, proxy, src, ctx, &displacementBM, &displacementOffset)) {
return false;
}
+ SkIRect srcBounds = colorBM.bounds();
+ srcBounds.offset(colorOffset);
SkIRect bounds;
// Since GrDisplacementMapEffect does bounds checking on color pixel access, we don't need to
// pad the color bitmap to bounds here.
- if (!this->applyCropRect(ctx, colorBM, colorOffset, &bounds)) {
+ if (!this->applyCropRect(ctx, srcBounds, &bounds)) {
return false;
}
SkIRect displBounds;
« no previous file with comments | « src/effects/SkColorFilterImageFilter.cpp ('k') | src/effects/SkDropShadowImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698