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; |
} |