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

Unified Diff: src/gpu/SkGpuDevice.cpp

Issue 112803004: Make SkImageFilter crop rects relative to the primitive origin, instead of relative to their parent (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Updated to ToT Created 6 years, 12 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/SkXfermodeImageFilter.cpp ('k') | tests/ImageFilterTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/SkGpuDevice.cpp
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index b18f54b595efb12d0668d59b29b2a51fb48377bb..680dd8998433572aaf80bd16a2f67c9607bd3e14 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -1494,11 +1494,11 @@ void SkGpuDevice::drawSprite(const SkDraw& draw, const SkBitmap& bitmap,
SkAutoCachedTexture act(this, bitmap, NULL, &texture);
SkImageFilter* filter = paint.getImageFilter();
- SkIPoint offset = SkIPoint::Make(left, top);
// This bitmap will own the filtered result as a texture.
SkBitmap filteredBitmap;
if (NULL != filter) {
+ SkIPoint offset = SkIPoint::Make(0, 0);
SkMatrix matrix(*draw.fMatrix);
matrix.postTranslate(SkIntToScalar(-left), SkIntToScalar(-top));
if (filter_texture(this, fContext, texture, filter, w, h, matrix, &filteredBitmap,
@@ -1506,6 +1506,8 @@ void SkGpuDevice::drawSprite(const SkDraw& draw, const SkBitmap& bitmap,
texture = (GrTexture*) filteredBitmap.getTexture();
w = filteredBitmap.width();
h = filteredBitmap.height();
+ left += offset.x();
+ top += offset.y();
} else {
return;
}
@@ -1519,8 +1521,8 @@ void SkGpuDevice::drawSprite(const SkDraw& draw, const SkBitmap& bitmap,
}
fContext->drawRectToRect(grPaint,
- SkRect::MakeXYWH(SkIntToScalar(offset.fX),
- SkIntToScalar(offset.fY),
+ SkRect::MakeXYWH(SkIntToScalar(left),
+ SkIntToScalar(top),
SkIntToScalar(w),
SkIntToScalar(h)),
SkRect::MakeXYWH(0,
« no previous file with comments | « src/effects/SkXfermodeImageFilter.cpp ('k') | tests/ImageFilterTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698