| OLD | NEW |
| 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 SkColorMatrixFilter* Create(const SkColorMatrix& cm) { | 16 static SkColorMatrixFilter* Create(const SkColorMatrix& cm) { |
| 17 return SkNEW_ARGS(SkColorMatrixFilter, (cm)); | 17 return SkNEW_ARGS(SkColorMatrixFilter, (cm)); |
| 18 } | 18 } |
| 19 static SkColorMatrixFilter* Create(const SkScalar array[20]) { | 19 static SkColorMatrixFilter* Create(const SkScalar array[20]) { |
| 20 return SkNEW_ARGS(SkColorMatrixFilter, (array)); | 20 return SkNEW_ARGS(SkColorMatrixFilter, (array)); |
| 21 } | 21 } |
| 22 | 22 |
| 23 void filterSpan(const SkPMColor src[], int count, SkPMColor[]) const overrid
e; | 23 void filterSpan(const SkPMColor src[], int count, SkPMColor[]) const overrid
e; |
| 24 uint32_t getFlags() const override; | 24 uint32_t getFlags() const override; |
| 25 bool asColorMatrix(SkScalar matrix[20]) const override; | 25 bool asColorMatrix(SkScalar matrix[20]) const override; |
| 26 SkColorFilter* newComposed(const SkColorFilter*) const override; | 26 SkColorFilter* newComposed(const SkColorFilter*) const override; |
| 27 | 27 |
| 28 #if SK_SUPPORT_GPU | 28 #if SK_SUPPORT_GPU |
| 29 bool asFragmentProcessors(GrContext*, SkTDArray<GrFragmentProcessor*>*) cons
t override; | 29 bool asFragmentProcessors(GrContext*, GrShaderDataManager*, |
| 30 SkTDArray<GrFragmentProcessor*>*) const override; |
| 30 #endif | 31 #endif |
| 31 | 32 |
| 32 struct State { | 33 struct State { |
| 33 int32_t fArray[20]; | 34 int32_t fArray[20]; |
| 34 int fShift; | 35 int fShift; |
| 35 }; | 36 }; |
| 36 | 37 |
| 37 SK_TO_STRING_OVERRIDE() | 38 SK_TO_STRING_OVERRIDE() |
| 38 | 39 |
| 39 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkColorMatrixFilter) | 40 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkColorMatrixFilter) |
| (...skipping 13 matching lines...) Expand all Loading... |
| 53 Proc fProc; | 54 Proc fProc; |
| 54 State fState; | 55 State fState; |
| 55 uint32_t fFlags; | 56 uint32_t fFlags; |
| 56 | 57 |
| 57 void initState(const SkScalar array[20]); | 58 void initState(const SkScalar array[20]); |
| 58 | 59 |
| 59 typedef SkColorFilter INHERITED; | 60 typedef SkColorFilter INHERITED; |
| 60 }; | 61 }; |
| 61 | 62 |
| 62 #endif | 63 #endif |
| OLD | NEW |