aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkColorMatrixFilterRowMajor255.cpp
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2016-03-22 07:35:17 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-03-22 07:35:17 -0700
commit1eb81db650d31f50be67b12d60c4f9e7dd08432f (patch)
tree58a5fd565f06a398192be170009fefa2a12a1ee2 /src/core/SkColorMatrixFilterRowMajor255.cpp
parentee451cf09de31267c93b64e1fdac7c823cee7e85 (diff)
Revert of switch colorfilters to sk_sp (patchset #11 id:200001 of https://codereview.chromium.org/1822623002/ )
Reason for revert: need to fix unguarded makeWithFilter Original issue's description: > switch colorfilters to sk_sp > > BUG=skia: > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1822623002 > > Committed: https://skia.googlesource.com/skia/+/f809d7687a4fb7b88b651b046da2bc0035d6aa09 TBR=fmalita@chromium.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/1820303002
Diffstat (limited to 'src/core/SkColorMatrixFilterRowMajor255.cpp')
-rw-r--r--src/core/SkColorMatrixFilterRowMajor255.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/core/SkColorMatrixFilterRowMajor255.cpp b/src/core/SkColorMatrixFilterRowMajor255.cpp
index bd9a66a561..09df61699d 100644
--- a/src/core/SkColorMatrixFilterRowMajor255.cpp
+++ b/src/core/SkColorMatrixFilterRowMajor255.cpp
@@ -226,13 +226,12 @@ static void set_concat(SkScalar result[20], const SkScalar outer[20], const SkSc
// End duplication
//////
-sk_sp<SkColorFilter>
-SkColorMatrixFilterRowMajor255::makeComposed(sk_sp<SkColorFilter> innerFilter) const {
+SkColorFilter* SkColorMatrixFilterRowMajor255::newComposed(const SkColorFilter* innerFilter) const {
SkScalar innerMatrix[20];
if (innerFilter->asColorMatrix(innerMatrix) && !needs_clamping(innerMatrix)) {
SkScalar concat[20];
set_concat(concat, fMatrix, innerMatrix);
- return sk_make_sp<SkColorMatrixFilterRowMajor255>(concat);
+ return new SkColorMatrixFilterRowMajor255(concat);
}
return nullptr;
}
@@ -418,16 +417,15 @@ void SkColorMatrixFilterRowMajor255::toString(SkString* str) const {
///////////////////////////////////////////////////////////////////////////////
-sk_sp<SkColorFilter> SkColorFilter::MakeMatrixFilterRowMajor255(const SkScalar array[20]) {
- return sk_sp<SkColorFilter>(new SkColorMatrixFilterRowMajor255(array));
+SkColorFilter* SkColorFilter::CreateMatrixFilterRowMajor255(const SkScalar array[20]) {
+ return new SkColorMatrixFilterRowMajor255(array);
}
///////////////////////////////////////////////////////////////////////////////
-sk_sp<SkColorFilter>
-SkColorMatrixFilterRowMajor255::MakeSingleChannelOutput(const SkScalar row[5]) {
+SkColorFilter* SkColorMatrixFilterRowMajor255::CreateSingleChannelOutput(const SkScalar row[5]) {
SkASSERT(row);
- auto cf = sk_make_sp<SkColorMatrixFilterRowMajor255>();
+ SkColorMatrixFilterRowMajor255* cf = new SkColorMatrixFilterRowMajor255();
static_assert(sizeof(SkScalar) * 5 * 4 == sizeof(cf->fMatrix), "sizes don't match");
for (int i = 0; i < 4; ++i) {
memcpy(cf->fMatrix + 5 * i, row, sizeof(SkScalar) * 5);