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

Unified Diff: src/core/SkImageFilter.cpp

Issue 1837293003: Revert of Switch SkLocalMatrixImageFilter and SkPaintImageFilter over to sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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/core/SkCanvas.cpp ('k') | src/core/SkLocalMatrixImageFilter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkImageFilter.cpp
diff --git a/src/core/SkImageFilter.cpp b/src/core/SkImageFilter.cpp
index e999d3aebb3ef885b0ea82926a11eb7319c76190..06076c6891101e4f6c4cd71b94fb40ab61f0e3c8 100644
--- a/src/core/SkImageFilter.cpp
+++ b/src/core/SkImageFilter.cpp
@@ -158,22 +158,6 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
-SkImageFilter::SkImageFilter(sk_sp<SkImageFilter>* inputs,
- int inputCount,
- const CropRect* cropRect)
- : fInputCount(inputCount),
- fInputs(new SkImageFilter*[inputCount]),
- fUsesSrcInput(false),
- fCropRect(cropRect ? *cropRect : CropRect(SkRect(), 0x0)),
- fUniqueID(next_image_filter_unique_id()) {
- for (int i = 0; i < inputCount; ++i) {
- if (nullptr == inputs[i] || inputs[i]->usesSrcInput()) {
- fUsesSrcInput = true;
- }
- fInputs[i] = SkSafeRef(inputs[i].get());
- }
-}
-
SkImageFilter::SkImageFilter(int inputCount, SkImageFilter** inputs, const CropRect* cropRect)
: fInputCount(inputCount),
fInputs(new SkImageFilter*[inputCount]),
@@ -184,7 +168,8 @@
if (nullptr == inputs[i] || inputs[i]->usesSrcInput()) {
fUsesSrcInput = true;
}
- fInputs[i] = SkSafeRef(inputs[i]);
+ fInputs[i] = inputs[i];
+ SkSafeRef(fInputs[i]);
}
}
@@ -571,12 +556,11 @@
return SkMatrixImageFilter::Create(matrix, filterQuality, input);
}
-sk_sp<SkImageFilter> SkImageFilter::makeWithLocalMatrix(const SkMatrix& matrix) const {
+SkImageFilter* SkImageFilter::newWithLocalMatrix(const SkMatrix& matrix) const {
// SkLocalMatrixImageFilter takes SkImage* in its factory, but logically that parameter
// is *always* treated as a const ptr. Hence the const-cast here.
//
- SkImageFilter* nonConstThis = const_cast<SkImageFilter*>(this);
- return SkLocalMatrixImageFilter::Make(matrix, sk_ref_sp<SkImageFilter>(nonConstThis));
+ return SkLocalMatrixImageFilter::Create(matrix, const_cast<SkImageFilter*>(this));
}
sk_sp<SkSpecialImage> SkImageFilter::filterInput(int index,
« no previous file with comments | « src/core/SkCanvas.cpp ('k') | src/core/SkLocalMatrixImageFilter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698