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

Unified Diff: src/gpu/SkGpuDevice.cpp

Issue 1308703007: Fix filter primitive bounds computations. (Closed) Base URL: https://skia.googlesource.com/skia.git@saveLayer-bounds-not-transformed
Patch Set: Update to ToT Created 5 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
Index: src/gpu/SkGpuDevice.cpp
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index 17e4468acb21f293b1e3ba87945a8b48d57619df..45f51097f47b23d96e0570bf90f7d307d7ef7c4b 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -1163,7 +1163,8 @@ void SkGpuDevice::drawSprite(const SkDraw& draw, const SkBitmap& bitmap,
SkIPoint offset = SkIPoint::Make(0, 0);
SkMatrix matrix(*draw.fMatrix);
matrix.postTranslate(SkIntToScalar(-left), SkIntToScalar(-top));
- SkIRect clipBounds = SkIRect::MakeWH(bitmap.width(), bitmap.height());
+ SkIRect clipBounds = draw.fClip->getBounds();
reed1 2015/12/07 20:26:20 option: could use (your pref) SkIRect clipBounds
Stephen White 2015/12/07 21:34:23 Good idea! Done.
+ clipBounds.offset(-left, -top);
SkAutoTUnref<SkImageFilter::Cache> cache(getImageFilterCache());
// This cache is transient, and is freed (along with all its contained
// textures) when it goes out of scope.
@@ -1326,7 +1327,8 @@ void SkGpuDevice::drawDevice(const SkDraw& draw, SkBaseDevice* device,
SkIPoint offset = SkIPoint::Make(0, 0);
SkMatrix matrix(*draw.fMatrix);
matrix.postTranslate(SkIntToScalar(-x), SkIntToScalar(-y));
- SkIRect clipBounds = SkIRect::MakeWH(devTex->width(), devTex->height());
+ SkIRect clipBounds = draw.fClip->getBounds();
+ clipBounds.offset(-x, -y);
// This cache is transient, and is freed (along with all its contained
// textures) when it goes out of scope.
SkAutoTUnref<SkImageFilter::Cache> cache(getImageFilterCache());

Powered by Google App Engine
This is Rietveld 408576698