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

Unified Diff: src/core/SkCanvas.cpp

Issue 230653005: Implement intra-frame cacheing in image filters. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: OCD tweak 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
« no previous file with comments | « include/core/SkImageFilter.h ('k') | src/core/SkImageFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkCanvas.cpp
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index 27b7a4c804222604d5ad2086e1bcd8481786b75f..8704de21dece27ef3548a748c5c17a5a6b563ef1 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -1258,7 +1258,9 @@ void SkCanvas::internalDrawDevice(SkBaseDevice* srcDev, int x, int y,
SkMatrix matrix = *iter.fMatrix;
matrix.postTranslate(SkIntToScalar(-pos.x()), SkIntToScalar(-pos.y()));
SkIRect clipBounds = SkIRect::MakeWH(srcDev->width(), srcDev->height());
- SkImageFilter::Context ctx(matrix, clipBounds);
+ SkImageFilter::Cache* cache = SkImageFilter::Cache::Create(2);
reed1 2014/04/10 21:23:26 That '2' is mysterious to the new reviewer... 1.
Stephen White 2014/04/10 21:26:36 2 means "cache only image filters with 2 or more c
+ SkAutoUnref aur(cache);
+ SkImageFilter::Context ctx(matrix, clipBounds, cache);
if (filter->filterImage(&proxy, src, ctx, &dst, &offset)) {
SkPaint tmpUnfiltered(*paint);
tmpUnfiltered.setImageFilter(NULL);
@@ -1298,7 +1300,9 @@ void SkCanvas::drawSprite(const SkBitmap& bitmap, int x, int y,
SkMatrix matrix = *iter.fMatrix;
matrix.postTranslate(SkIntToScalar(-pos.x()), SkIntToScalar(-pos.y()));
SkIRect clipBounds = SkIRect::MakeWH(bitmap.width(), bitmap.height());
- SkImageFilter::Context ctx(matrix, clipBounds);
+ SkImageFilter::Cache* cache = SkImageFilter::Cache::Create(2);
+ SkAutoUnref aur(cache);
+ SkImageFilter::Context ctx(matrix, clipBounds, cache);
if (filter->filterImage(&proxy, bitmap, ctx, &dst, &offset)) {
SkPaint tmpUnfiltered(*paint);
tmpUnfiltered.setImageFilter(NULL);
« no previous file with comments | « include/core/SkImageFilter.h ('k') | src/core/SkImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698