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

Side by Side Diff: include/effects/SkColorMatrixFilter.h

Issue 1827433002: Reland of [2] of "switch colorfilters to sk_sp (patchset #11 id:200001 of https://codereview.chromium.o… (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 unified diff | Download patch
« no previous file with comments | « include/effects/SkColorFilterImageFilter.h ('k') | include/effects/SkLumaColorFilter.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2007 The Android Open Source Project 2 * Copyright 2007 The Android Open Source Project
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef SkColorMatrixFilter_DEFINED 8 #ifndef SkColorMatrixFilter_DEFINED
9 #define SkColorMatrixFilter_DEFINED 9 #define SkColorMatrixFilter_DEFINED
10 10
11 #include "SkColorFilter.h" 11 #include "SkColorFilter.h"
12 #include "SkColorMatrix.h" 12 #include "SkColorMatrix.h"
13 13
14 class SK_API SkColorMatrixFilter : public SkColorFilter { 14 class SK_API SkColorMatrixFilter : public SkColorFilter {
15 public: 15 public:
16 static SkColorFilter* Create(const SkColorMatrix& cm) {
17 return SkColorFilter::CreateMatrixFilterRowMajor255(cm.fMat);
18 }
19 static SkColorFilter* Create(const SkScalar array[20]) {
20 return SkColorFilter::CreateMatrixFilterRowMajor255(array);
21 }
22
23 /** 16 /**
24 * Create a colorfilter that multiplies the RGB channels by one color, and 17 * Create a colorfilter that multiplies the RGB channels by one color, and
25 * then adds a second color, pinning the result for each component to 18 * then adds a second color, pinning the result for each component to
26 * [0..255]. The alpha components of the mul and add arguments 19 * [0..255]. The alpha components of the mul and add arguments
27 * are ignored. 20 * are ignored.
28 */ 21 */
29 static SkColorFilter* CreateLightingFilter(SkColor mul, SkColor add); 22 static sk_sp<SkColorFilter> MakeLightingFilter(SkColor mul, SkColor add);
23
24 #ifdef SK_SUPPORT_LEGACY_COLORFILTER_PTR
25 static SkColorFilter* Create(const SkColorMatrix& cm) {
26 return SkColorFilter::MakeMatrixFilterRowMajor255(cm.fMat).release();
27 }
28 static SkColorFilter* Create(const SkScalar array[20]) {
29 return SkColorFilter::MakeMatrixFilterRowMajor255(array).release();
30 }
31 static SkColorFilter* CreateLightingFilter(SkColor mul, SkColor add) {
32 return MakeLightingFilter(mul, add).release();
33 }
34 #endif
30 }; 35 };
31 36
32 #endif 37 #endif
OLDNEW
« no previous file with comments | « include/effects/SkColorFilterImageFilter.h ('k') | include/effects/SkLumaColorFilter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698