Index: src/effects/SkTableColorFilter.cpp |
diff --git a/src/effects/SkTableColorFilter.cpp b/src/effects/SkTableColorFilter.cpp |
index 5ae175ffca7822f43c40c83206d11465249950c5..4ce0b4bb0ee4fb0e4b4b0678a64269634176e520 100644 |
--- a/src/effects/SkTableColorFilter.cpp |
+++ b/src/effects/SkTableColorFilter.cpp |
@@ -46,7 +46,7 @@ |
virtual ~SkTable_ColorFilter() { delete fBitmap; } |
bool asComponentTable(SkBitmap* table) const override; |
- SkColorFilter* newComposed(const SkColorFilter* inner) const override; |
+ sk_sp<SkColorFilter> makeComposed(sk_sp<SkColorFilter> inner) const override; |
#if SK_SUPPORT_GPU |
const GrFragmentProcessor* asFragmentProcessor(GrContext*) const override; |
@@ -251,7 +251,7 @@ |
b = ptr; |
ptr += 256; |
} |
- return SkTableColorFilter::CreateARGB(a, r, g, b); |
+ return SkTableColorFilter::MakeARGB(a, r, g, b).release(); |
} |
bool SkTable_ColorFilter::asComponentTable(SkBitmap* table) const { |
@@ -287,7 +287,7 @@ |
} |
} |
-SkColorFilter* SkTable_ColorFilter::newComposed(const SkColorFilter* innerFilter) const { |
+sk_sp<SkColorFilter> SkTable_ColorFilter::makeComposed(sk_sp<SkColorFilter> innerFilter) const { |
SkBitmap innerBM; |
if (!innerFilter->asComponentTable(&innerBM)) { |
return nullptr; |
@@ -326,7 +326,7 @@ |
combine_tables(concatG, tableG, innerBM.getAddr8(0, 2)); |
combine_tables(concatB, tableB, innerBM.getAddr8(0, 3)); |
- return SkTableColorFilter::CreateARGB(concatA, concatR, concatG, concatB); |
+ return SkTableColorFilter::MakeARGB(concatA, concatR, concatG, concatB); |
} |
#if SK_SUPPORT_GPU |
@@ -554,7 +554,7 @@ |
} |
} |
} |
- SkAutoTUnref<SkColorFilter> filter(SkTableColorFilter::CreateARGB( |
+ auto filter(SkTableColorFilter::MakeARGB( |
(flags & (1 << 0)) ? luts[0] : nullptr, |
(flags & (1 << 1)) ? luts[1] : nullptr, |
(flags & (1 << 2)) ? luts[2] : nullptr, |
@@ -587,15 +587,15 @@ |
/////////////////////////////////////////////////////////////////////////////// |
-SkColorFilter* SkTableColorFilter::Create(const uint8_t table[256]) { |
- return new SkTable_ColorFilter(table, table, table, table); |
-} |
- |
-SkColorFilter* SkTableColorFilter::CreateARGB(const uint8_t tableA[256], |
- const uint8_t tableR[256], |
- const uint8_t tableG[256], |
- const uint8_t tableB[256]) { |
- return new SkTable_ColorFilter(tableA, tableR, tableG, tableB); |
+sk_sp<SkColorFilter> SkTableColorFilter::Make(const uint8_t table[256]) { |
+ return sk_make_sp<SkTable_ColorFilter>(table, table, table, table); |
+} |
+ |
+sk_sp<SkColorFilter> SkTableColorFilter::MakeARGB(const uint8_t tableA[256], |
+ const uint8_t tableR[256], |
+ const uint8_t tableG[256], |
+ const uint8_t tableB[256]) { |
+ return sk_make_sp<SkTable_ColorFilter>(tableA, tableR, tableG, tableB); |
} |
SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkTableColorFilter) |