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

Unified Diff: src/core/SkCanvas.cpp

Issue 414483003: Implement a persistent uniqueID-based cache for SkImageFilter. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix cross-process issue (revert those changes to HEAD^^) Created 6 years, 5 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/core/SkBitmapDevice.cpp ('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 504c9908abbb8015a65e7bfd7b77a2662d21154a..a561316b7f6ae7eb9e4b49ee7101be5ba9ac3956 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -1134,13 +1134,8 @@ 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::Cache* cache = SkImageFilter::GetExternalCache();
- SkAutoUnref aur(NULL);
- if (!cache) {
- cache = SkImageFilter::Cache::Create();
- aur.reset(cache);
- }
- SkImageFilter::Context ctx(matrix, clipBounds, cache);
+ SkAutoTUnref<SkImageFilter::UniqueIDCache> cache(dstDev->getImageFilterCache());
+ SkImageFilter::Context ctx(matrix, clipBounds, cache.get());
if (filter->filterImage(&proxy, src, ctx, &dst, &offset)) {
SkPaint tmpUnfiltered(*paint);
tmpUnfiltered.setImageFilter(NULL);
@@ -1179,13 +1174,8 @@ 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::Cache* cache = SkImageFilter::GetExternalCache();
- SkAutoUnref aur(NULL);
- if (!cache) {
- cache = SkImageFilter::Cache::Create();
- aur.reset(cache);
- }
- SkImageFilter::Context ctx(matrix, clipBounds, cache);
+ SkAutoTUnref<SkImageFilter::UniqueIDCache> cache(iter.fDevice->getImageFilterCache());
+ SkImageFilter::Context ctx(matrix, clipBounds, cache.get());
if (filter->filterImage(&proxy, bitmap, ctx, &dst, &offset)) {
SkPaint tmpUnfiltered(*paint);
tmpUnfiltered.setImageFilter(NULL);
« no previous file with comments | « src/core/SkBitmapDevice.cpp ('k') | src/core/SkImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698