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

Unified Diff: src/pdf/SkPDFDevice.cpp

Issue 1822623002: switch colorfilters to sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 4 years, 9 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/SkTableColorFilter.cpp ('k') | src/utils/SkLua.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pdf/SkPDFDevice.cpp
diff --git a/src/pdf/SkPDFDevice.cpp b/src/pdf/SkPDFDevice.cpp
index 514cd8840897c9a84312ce5c6da0186e9605ee06..66048ff751f0210418d411043d4a3f3b09326037 100644
--- a/src/pdf/SkPDFDevice.cpp
+++ b/src/pdf/SkPDFDevice.cpp
@@ -2114,8 +2114,7 @@ static SkSize rect_to_size(const SkRect& r) {
return SkSize::Make(r.width(), r.height());
}
-static const SkImage* color_filter(const SkImage* image,
- SkColorFilter* colorFilter) {
+static const SkImage* color_filter(const SkImage* image, SkColorFilter* colorFilter) {
sk_sp<SkSurface> surface(SkSurface::NewRaster(
SkImageInfo::MakeN32Premul(image->dimensions())));
if (!surface) {
@@ -2124,7 +2123,7 @@ static const SkImage* color_filter(const SkImage* image,
SkCanvas* canvas = surface->getCanvas();
canvas->clear(SK_ColorTRANSPARENT);
SkPaint paint;
- paint.setColorFilter(colorFilter);
+ paint.setColorFilter(sk_ref_sp(colorFilter));
canvas->drawImage(image, 0, 0, &paint);
canvas->flush();
return surface->makeImageSnapshot().release();
« no previous file with comments | « src/effects/SkTableColorFilter.cpp ('k') | src/utils/SkLua.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698