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/SkMatrixImageFilter.cpp

Issue 1858353002: Update SkMatrixImageFilter to sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix fuzz Created 4 years, 8 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/SkMatrixImageFilter.h ('k') | tests/ImageFilterTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkMatrixImageFilter.cpp
diff --git a/src/core/SkMatrixImageFilter.cpp b/src/core/SkMatrixImageFilter.cpp
index 70bc81af434bdaeda0d1971194745745bb12ce93..6cd79f3f4ad0c8ef7ddc5cd1230f3a289afd5606 100644
--- a/src/core/SkMatrixImageFilter.cpp
+++ b/src/core/SkMatrixImageFilter.cpp
@@ -16,16 +16,18 @@
SkMatrixImageFilter::SkMatrixImageFilter(const SkMatrix& transform,
SkFilterQuality filterQuality,
- SkImageFilter* input)
- : INHERITED(1, &input)
+ sk_sp<SkImageFilter> input)
+ : INHERITED(&input, 1, nullptr)
, fTransform(transform)
, fFilterQuality(filterQuality) {
}
-SkMatrixImageFilter* SkMatrixImageFilter::Create(const SkMatrix& transform,
- SkFilterQuality filterQuality,
- SkImageFilter* input) {
- return new SkMatrixImageFilter(transform, filterQuality, input);
+sk_sp<SkImageFilter> SkMatrixImageFilter::Make(const SkMatrix& transform,
+ SkFilterQuality filterQuality,
+ sk_sp<SkImageFilter> input) {
+ return sk_sp<SkImageFilter>(new SkMatrixImageFilter(transform,
+ filterQuality,
+ std::move(input)));
}
sk_sp<SkFlattenable> SkMatrixImageFilter::CreateProc(SkReadBuffer& buffer) {
@@ -33,7 +35,7 @@ sk_sp<SkFlattenable> SkMatrixImageFilter::CreateProc(SkReadBuffer& buffer) {
SkMatrix matrix;
buffer.readMatrix(&matrix);
SkFilterQuality quality = static_cast<SkFilterQuality>(buffer.readInt());
- return sk_sp<SkImageFilter>(Create(matrix, quality, common.getInput(0).get()));
+ return Make(matrix, quality, common.getInput(0));
}
void SkMatrixImageFilter::flatten(SkWriteBuffer& buffer) const {
« no previous file with comments | « src/core/SkMatrixImageFilter.h ('k') | tests/ImageFilterTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698