Index: src/effects/SkColorFilterImageFilter.cpp |
diff --git a/src/effects/SkColorFilterImageFilter.cpp b/src/effects/SkColorFilterImageFilter.cpp |
index 96ce5d9690588867945886330a4dc723b4450fd9..6eb66533d90a96846610a9c7674d784b19e34a3e 100644 |
--- a/src/effects/SkColorFilterImageFilter.cpp |
+++ b/src/effects/SkColorFilterImageFilter.cpp |
@@ -25,10 +25,10 @@ SkImageFilter* SkColorFilterImageFilter::Create(SkColorFilter* cf, SkImageFilter |
if (input && input->isColorFilterNode(&inputCF)) { |
// This is an optimization, as it collapses the hierarchy by just combining the two |
// colorfilters into a single one, which the new imagefilter will wrap. |
- SkAutoUnref autoUnref(inputCF); |
- SkAutoTUnref<SkColorFilter> newCF(SkColorFilter::CreateComposeFilter(cf, inputCF)); |
+ sk_sp<SkColorFilter> newCF(SkColorFilter::MakeComposeFilter(sk_ref_sp(cf), |
+ sk_sp<SkColorFilter>(inputCF))); |
if (newCF) { |
- return new SkColorFilterImageFilter(newCF, input->getInput(0), cropRect); |
+ return new SkColorFilterImageFilter(newCF.get(), input->getInput(0), cropRect); |
} |
} |
@@ -42,17 +42,13 @@ SkColorFilterImageFilter::SkColorFilterImageFilter(SkColorFilter* cf, |
SkFlattenable* SkColorFilterImageFilter::CreateProc(SkReadBuffer& buffer) { |
SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 1); |
- SkAutoTUnref<SkColorFilter> cf(buffer.readColorFilter()); |
- return Create(cf, common.getInput(0), &common.cropRect()); |
+ sk_sp<SkColorFilter> cf(buffer.readColorFilter()); |
+ return Create(cf.get(), common.getInput(0), &common.cropRect()); |
} |
void SkColorFilterImageFilter::flatten(SkWriteBuffer& buffer) const { |
this->INHERITED::flatten(buffer); |
- buffer.writeFlattenable(fColorFilter); |
-} |
- |
-SkColorFilterImageFilter::~SkColorFilterImageFilter() { |
- fColorFilter->unref(); |
+ buffer.writeFlattenable(fColorFilter.get()); |
} |
bool SkColorFilterImageFilter::onFilterImageDeprecated(Proxy* proxy, const SkBitmap& source, |
@@ -94,7 +90,7 @@ bool SkColorFilterImageFilter::onIsColorFilterNode(SkColorFilter** filter) const |
SkASSERT(1 == this->countInputs()); |
if (!this->cropRectIsSet()) { |
if (filter) { |
- *filter = SkRef(fColorFilter); |
+ *filter = SkRef(fColorFilter.get()); |
} |
return true; |
} |