diff options
author | robertphillips <robertphillips@google.com> | 2016-04-15 05:09:32 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-04-15 05:09:32 -0700 |
commit | 47db5fe4436c924f42b05bc63f8fad833b99bfbe (patch) | |
tree | ee36eee27a6b983aec2a6600a2a50768ec9e4fc0 /src/effects | |
parent | ad3dc0da218cc43c9917a256d4afb8cf0d7c5899 (diff) |
Revert of Update DisplacementMapEffect to sk_sp (patchset #3 id:40001 of https://codereview.chromium.org/1877783003/ )
Reason for revert:
unexpected image diffs in imagefilterscropexpand GM
Original issue's description:
> Update DisplacementMapEffect to sk_sp
>
> TBR=reed@google.com
>
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1877783003
>
> Committed: https://skia.googlesource.com/skia/+/a53011ef44705a091a8e24f7ea289a3f9ad759f2
TBR=fmalita@chromium.org,reed@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
Review URL: https://codereview.chromium.org/1884253004
Diffstat (limited to 'src/effects')
-rw-r--r-- | src/effects/SkDisplacementMapEffect.cpp | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/src/effects/SkDisplacementMapEffect.cpp b/src/effects/SkDisplacementMapEffect.cpp index b715f6a4f3..aee15ef753 100644 --- a/src/effects/SkDisplacementMapEffect.cpp +++ b/src/effects/SkDisplacementMapEffect.cpp @@ -163,29 +163,27 @@ bool channel_selector_type_is_valid(SkDisplacementMapEffect::ChannelSelectorType /////////////////////////////////////////////////////////////////////////////// -sk_sp<SkImageFilter> SkDisplacementMapEffect::Make(ChannelSelectorType xChannelSelector, - ChannelSelectorType yChannelSelector, - SkScalar scale, - sk_sp<SkImageFilter> displacement, - sk_sp<SkImageFilter> color, - const CropRect* cropRect) { +SkImageFilter* SkDisplacementMapEffect::Create(ChannelSelectorType xChannelSelector, + ChannelSelectorType yChannelSelector, + SkScalar scale, + SkImageFilter* displacement, + SkImageFilter* color, + const CropRect* cropRect) { if (!channel_selector_type_is_valid(xChannelSelector) || !channel_selector_type_is_valid(yChannelSelector)) { return nullptr; } - sk_sp<SkImageFilter> inputs[2] = { std::move(displacement), std::move(color) }; - return sk_sp<SkImageFilter>(new SkDisplacementMapEffect(xChannelSelector, - yChannelSelector, - scale, inputs, cropRect)); + SkImageFilter* inputs[2] = { displacement, color }; + return new SkDisplacementMapEffect(xChannelSelector, yChannelSelector, scale, inputs, cropRect); } SkDisplacementMapEffect::SkDisplacementMapEffect(ChannelSelectorType xChannelSelector, ChannelSelectorType yChannelSelector, SkScalar scale, - sk_sp<SkImageFilter> inputs[2], + SkImageFilter* inputs[2], const CropRect* cropRect) - : INHERITED(inputs, 2, cropRect) + : INHERITED(2, inputs, cropRect) , fXChannelSelector(xChannelSelector) , fYChannelSelector(yChannelSelector) , fScale(scale) { @@ -199,9 +197,8 @@ sk_sp<SkFlattenable> SkDisplacementMapEffect::CreateProc(SkReadBuffer& buffer) { ChannelSelectorType xsel = (ChannelSelectorType)buffer.readInt(); ChannelSelectorType ysel = (ChannelSelectorType)buffer.readInt(); SkScalar scale = buffer.readScalar(); - return Make(xsel, ysel, scale, - common.getInput(0), common.getInput(1), - &common.cropRect()); + return sk_sp<SkFlattenable>(Create(xsel, ysel, scale, common.getInput(0).get(), + common.getInput(1).get(), &common.cropRect())); } void SkDisplacementMapEffect::flatten(SkWriteBuffer& buffer) const { |