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

Side by Side Diff: src/core/SkColorMatrixFilterRowMajor255.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 | « src/core/SkColorFilterShader.cpp ('k') | src/core/SkColorMatrixFilterRowMajor255.cpp » ('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 2016 Google Inc. 2 * Copyright 2016 Google Inc.
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 12
13 class SK_API SkColorMatrixFilterRowMajor255 : public SkColorFilter { 13 class SK_API SkColorMatrixFilterRowMajor255 : public SkColorFilter {
14 public: 14 public:
15 SkColorMatrixFilterRowMajor255() {};
15 explicit SkColorMatrixFilterRowMajor255(const SkScalar array[20]); 16 explicit SkColorMatrixFilterRowMajor255(const SkScalar array[20]);
16 17
17 /** Creates a color matrix filter that returns the same value in all four ch annels. */ 18 /** Creates a color matrix filter that returns the same value in all four ch annels. */
18 static SkColorFilter* CreateSingleChannelOutput(const SkScalar row[5]); 19 static sk_sp<SkColorFilter> MakeSingleChannelOutput(const SkScalar row[5]);
19 20
20 void filterSpan(const SkPMColor src[], int count, SkPMColor[]) const overrid e; 21 void filterSpan(const SkPMColor src[], int count, SkPMColor[]) const overrid e;
21 void filterSpan4f(const SkPM4f src[], int count, SkPM4f[]) const override; 22 void filterSpan4f(const SkPM4f src[], int count, SkPM4f[]) const override;
22 uint32_t getFlags() const override; 23 uint32_t getFlags() const override;
23 bool asColorMatrix(SkScalar matrix[20]) const override; 24 bool asColorMatrix(SkScalar matrix[20]) const override;
24 SkColorFilter* newComposed(const SkColorFilter*) const override; 25 sk_sp<SkColorFilter> makeComposed(sk_sp<SkColorFilter>) const override;
25 26
26 #if SK_SUPPORT_GPU 27 #if SK_SUPPORT_GPU
27 const GrFragmentProcessor* asFragmentProcessor(GrContext*) const override; 28 const GrFragmentProcessor* asFragmentProcessor(GrContext*) const override;
28 #endif 29 #endif
29 30
30 SK_TO_STRING_OVERRIDE() 31 SK_TO_STRING_OVERRIDE()
31 32
32 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkColorMatrixFilter) 33 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkColorMatrixFilter)
33 34
34 protected: 35 protected:
35 void flatten(SkWriteBuffer&) const override; 36 void flatten(SkWriteBuffer&) const override;
36 37
37 private: 38 private:
38 SkColorMatrixFilterRowMajor255() {};
39
40 SkScalar fMatrix[20]; 39 SkScalar fMatrix[20];
41 float fTranspose[20]; // for Sk4s 40 float fTranspose[20]; // for Sk4s
42 uint32_t fFlags; 41 uint32_t fFlags;
43 42
44 void initState(); 43 void initState();
45 44
46 typedef SkColorFilter INHERITED; 45 typedef SkColorFilter INHERITED;
47 }; 46 };
48 47
49 #endif 48 #endif
OLDNEW
« no previous file with comments | « src/core/SkColorFilterShader.cpp ('k') | src/core/SkColorMatrixFilterRowMajor255.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698