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

Unified Diff: src/gpu/SkGpuDevice.cpp

Issue 230653005: Implement intra-frame cacheing in image filters. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Set minChildren to 2 by default; comment it. Created 6 years, 8 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
Index: src/gpu/SkGpuDevice.cpp
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index 9acc20434233c73d4080349c59773c7e922f1a53..1ea821a4c8ac2156029ccf43392d742c409dcfb6 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -1536,7 +1536,9 @@ void SkGpuDevice::drawSprite(const SkDraw& draw, const SkBitmap& bitmap,
SkMatrix matrix(*draw.fMatrix);
matrix.postTranslate(SkIntToScalar(-left), SkIntToScalar(-top));
SkIRect clipBounds = SkIRect::MakeWH(bitmap.width(), bitmap.height());
- SkImageFilter::Context ctx(matrix, clipBounds);
+ SkImageFilter::Cache* cache = SkImageFilter::Cache::Create();
+ SkAutoUnref aur(cache);
+ SkImageFilter::Context ctx(matrix, clipBounds, cache);
if (filter_texture(this, fContext, texture, filter, w, h, ctx, &filteredBitmap,
&offset)) {
texture = (GrTexture*) filteredBitmap.getTexture();
@@ -1644,7 +1646,9 @@ void SkGpuDevice::drawDevice(const SkDraw& draw, SkBaseDevice* device,
SkMatrix matrix(*draw.fMatrix);
matrix.postTranslate(SkIntToScalar(-x), SkIntToScalar(-y));
SkIRect clipBounds = SkIRect::MakeWH(devTex->width(), devTex->height());
- SkImageFilter::Context ctx(matrix, clipBounds);
+ SkImageFilter::Cache* cache = SkImageFilter::Cache::Create();
+ SkAutoUnref aur(cache);
+ SkImageFilter::Context ctx(matrix, clipBounds, cache);
if (filter_texture(this, fContext, devTex, filter, w, h, ctx, &filteredBitmap,
&offset)) {
devTex = filteredBitmap.getTexture();

Powered by Google App Engine
This is Rietveld 408576698