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

Unified Diff: src/effects/SkMergeImageFilter.cpp

Issue 1826893002: Switch new SkImageFilter internal methods over to sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Change method name to drawSpriteWithFilter 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/effects/SkImageSource.cpp ('k') | src/effects/SkOffsetImageFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkMergeImageFilter.cpp
diff --git a/src/effects/SkMergeImageFilter.cpp b/src/effects/SkMergeImageFilter.cpp
index 01373b25bfa570cc11bcf601d2b5d9717e2b4285..e3b99c690ae2640c8fa549e9a6f63f9daf230c73 100755
--- a/src/effects/SkMergeImageFilter.cpp
+++ b/src/effects/SkMergeImageFilter.cpp
@@ -57,8 +57,8 @@ SkMergeImageFilter::~SkMergeImageFilter() {
}
}
-SkSpecialImage* SkMergeImageFilter::onFilterImage(SkSpecialImage* source, const Context& ctx,
- SkIPoint* offset) const {
+sk_sp<SkSpecialImage> SkMergeImageFilter::onFilterImage(SkSpecialImage* source, const Context& ctx,
+ SkIPoint* offset) const {
int inputCount = this->countInputs();
if (inputCount < 1) {
return nullptr;
@@ -67,14 +67,13 @@ SkSpecialImage* SkMergeImageFilter::onFilterImage(SkSpecialImage* source, const
SkIRect bounds;
bounds.setEmpty();
- SkAutoTDeleteArray<SkAutoTUnref<SkSpecialImage>> inputs(
- new SkAutoTUnref<SkSpecialImage>[inputCount]);
+ SkAutoTDeleteArray<sk_sp<SkSpecialImage>> inputs(new sk_sp<SkSpecialImage>[inputCount]);
SkAutoTDeleteArray<SkIPoint> offsets(new SkIPoint[inputCount]);
// Filter all of the inputs.
for (int i = 0; i < inputCount; ++i) {
offsets[i].setZero();
- inputs[i].reset(this->filterInput(i, source, ctx, &offsets[i]));
+ inputs[i] = this->filterInput(i, source, ctx, &offsets[i]);
if (!inputs[i]) {
continue;
}
@@ -126,7 +125,7 @@ SkSpecialImage* SkMergeImageFilter::onFilterImage(SkSpecialImage* source, const
offset->fX = bounds.left();
offset->fY = bounds.top();
- return surf->makeImageSnapshot().release();
+ return surf->makeImageSnapshot();
}
SkFlattenable* SkMergeImageFilter::CreateProc(SkReadBuffer& buffer) {
« no previous file with comments | « src/effects/SkImageSource.cpp ('k') | src/effects/SkOffsetImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698