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

Unified Diff: src/core/SkCanvas.cpp

Issue 1821103004: Revert of Revert[2] of "switch colorfilters to sk_sp (patchset #11 id:200001 of https://codereview.chromium.o… (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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/core/SkBlitter.cpp ('k') | src/core/SkColorFilter.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 f7f870210d0844b6347030575ec159d210f15ea9..3efb44cc548bed305cf0c18450e9b45f91b6711d 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -391,17 +391,16 @@
* If the paint has an imagefilter, but it can be simplified to just a colorfilter, return that
* colorfilter, else return nullptr.
*/
-static sk_sp<SkColorFilter> image_to_color_filter(const SkPaint& paint) {
+static SkColorFilter* image_to_color_filter(const SkPaint& paint) {
SkImageFilter* imgf = paint.getImageFilter();
if (!imgf) {
return nullptr;
}
- SkColorFilter* imgCFPtr;
- if (!imgf->asAColorFilter(&imgCFPtr)) {
+ SkColorFilter* imgCF;
+ if (!imgf->asAColorFilter(&imgCF)) {
return nullptr;
}
- sk_sp<SkColorFilter> imgCF(imgCFPtr);
SkColorFilter* paintCF = paint.getColorFilter();
if (nullptr == paintCF) {
@@ -411,7 +410,8 @@
// The paint has both a colorfilter(paintCF) and an imagefilter-which-is-a-colorfilter(imgCF)
// and we need to combine them into a single colorfilter.
- return SkColorFilter::MakeComposeFilter(std::move(imgCF), sk_ref_sp(paintCF));
+ SkAutoTUnref<SkColorFilter> autoImgCF(imgCF);
+ return SkColorFilter::CreateComposeFilter(imgCF, paintCF);
}
/**
@@ -455,10 +455,10 @@
fTempLayerForImageFilter = false;
fDone = false;
- auto simplifiedCF = image_to_color_filter(fOrigPaint);
+ SkColorFilter* simplifiedCF = image_to_color_filter(fOrigPaint);
if (simplifiedCF) {
SkPaint* paint = set_if_needed(&fLazyPaintInit, fOrigPaint);
- paint->setColorFilter(std::move(simplifiedCF));
+ paint->setColorFilter(simplifiedCF)->unref();
paint->setImageFilter(nullptr);
fPaint = paint;
}
« no previous file with comments | « src/core/SkBlitter.cpp ('k') | src/core/SkColorFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698