diff options
author | robertphillips <robertphillips@google.com> | 2016-03-30 07:32:28 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-03-30 07:32:28 -0700 |
commit | 372177ee115d46dfb5bfb881a408e6c37ae83678 (patch) | |
tree | 674a01098b007017b989cf8d350398a0c794a345 /src/effects | |
parent | 2e77ddbb5e7274a83724ceaa5680f367e54163d4 (diff) |
Switch SkLocalMatrixImageFilter and SkPaintImageFilter over to sk_sp
TBR=reed@google.com
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1842793002
Committed: https://skia.googlesource.com/skia/+/a33cf07a2273315363c0b6fb5d3ce811742f5a85
Review URL: https://codereview.chromium.org/1842793002
Diffstat (limited to 'src/effects')
-rw-r--r-- | src/effects/SkPaintImageFilter.cpp | 11 | ||||
-rw-r--r-- | src/effects/SkPictureImageFilter.cpp | 4 |
2 files changed, 6 insertions, 9 deletions
diff --git a/src/effects/SkPaintImageFilter.cpp b/src/effects/SkPaintImageFilter.cpp index 7056f26863..cbd793a692 100644 --- a/src/effects/SkPaintImageFilter.cpp +++ b/src/effects/SkPaintImageFilter.cpp @@ -12,20 +12,16 @@ #include "SkSpecialSurface.h" #include "SkWriteBuffer.h" -SkImageFilter* SkPaintImageFilter::Create(const SkPaint& paint, const CropRect* cropRect) { - return new SkPaintImageFilter(paint, cropRect); -} - SkPaintImageFilter::SkPaintImageFilter(const SkPaint& paint, const CropRect* cropRect) - : INHERITED(0, nullptr, cropRect) - , fPaint(paint) { + : INHERITED(nullptr, 0, cropRect) + , fPaint(paint) { } SkFlattenable* SkPaintImageFilter::CreateProc(SkReadBuffer& buffer) { SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 0); SkPaint paint; buffer.readPaint(&paint); - return Create(paint, &common.cropRect()); + return SkPaintImageFilter::Make(paint, &common.cropRect()).release(); } void SkPaintImageFilter::flatten(SkWriteBuffer& buffer) const { @@ -80,6 +76,7 @@ bool SkPaintImageFilter::canComputeFastBounds() const { #ifndef SK_IGNORE_TO_STRING void SkPaintImageFilter::toString(SkString* str) const { str->appendf("SkPaintImageFilter: ("); + fPaint.toString(str); str->append(")"); } #endif diff --git a/src/effects/SkPictureImageFilter.cpp b/src/effects/SkPictureImageFilter.cpp index f5e3d4680b..2005463bd4 100644 --- a/src/effects/SkPictureImageFilter.cpp +++ b/src/effects/SkPictureImageFilter.cpp @@ -14,7 +14,7 @@ #include "SkValidationUtils.h" SkPictureImageFilter::SkPictureImageFilter(sk_sp<SkPicture> picture) - : INHERITED(0, 0, nullptr) + : INHERITED(nullptr, 0, nullptr) , fPicture(std::move(picture)) , fCropRect(fPicture ? fPicture->cullRect() : SkRect::MakeEmpty()) , fPictureResolution(kDeviceSpace_PictureResolution) @@ -24,7 +24,7 @@ SkPictureImageFilter::SkPictureImageFilter(sk_sp<SkPicture> picture) SkPictureImageFilter::SkPictureImageFilter(sk_sp<SkPicture> picture, const SkRect& cropRect, PictureResolution pictureResolution, SkFilterQuality filterQuality) - : INHERITED(0, 0, nullptr) + : INHERITED(nullptr, 0, nullptr) , fPicture(std::move(picture)) , fCropRect(cropRect) , fPictureResolution(pictureResolution) |