OLD | NEW |
---|---|
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 #ifndef SkColorFilter_DEFINED | 10 #ifndef SkColorFilter_DEFINED |
11 #define SkColorFilter_DEFINED | 11 #define SkColorFilter_DEFINED |
12 | 12 |
13 #include "SkColor.h" | 13 #include "SkColor.h" |
14 #include "SkFlattenable.h" | 14 #include "SkFlattenable.h" |
15 #include "SkXfermode.h" | 15 #include "SkXfermode.h" |
16 | 16 |
17 class SkBitmap; | 17 class SkBitmap; |
18 class GrEffectRef; | 18 class GrEffectRef; |
19 class GrContext; | 19 class GrContext; |
20 | 20 |
21 class SK_API SkColorFilter : public SkFlattenable { | 21 class SK_API SkColorFilter : public SkFlattenable { |
22 typedef SkFlattenable INHERITED; | |
22 public: | 23 public: |
23 SK_DECLARE_INST_COUNT(SkColorFilter) | 24 SK_DECLARE_INST_COUNT(SkColorFilter) |
24 | 25 |
25 /** | 26 /** |
26 * If the filter can be represented by a source color plus Mode, this | 27 * If the filter can be represented by a source color plus Mode, this |
27 * returns true, and sets (if not NULL) the color and mode appropriately. | 28 * returns true, and sets (if not NULL) the color and mode appropriately. |
28 * If not, this returns false and ignores the parameters. | 29 * If not, this returns false and ignores the parameters. |
29 */ | 30 */ |
30 virtual bool asColorMode(SkColor* color, SkXfermode::Mode* mode) const; | 31 virtual bool asColorMode(SkColor* color, SkXfermode::Mode* mode) const; |
31 | 32 |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
115 */ | 116 */ |
116 static SkColorFilter* CreateLightingFilter(SkColor mul, SkColor add); | 117 static SkColorFilter* CreateLightingFilter(SkColor mul, SkColor add); |
117 | 118 |
118 /** A subclass may implement this factory function to work with the GPU back end. If the return | 119 /** A subclass may implement this factory function to work with the GPU back end. If the return |
119 is non-NULL then the caller owns a ref on the returned object. | 120 is non-NULL then the caller owns a ref on the returned object. |
120 */ | 121 */ |
121 virtual GrEffectRef* asNewEffect(GrContext*) const; | 122 virtual GrEffectRef* asNewEffect(GrContext*) const; |
122 | 123 |
123 SkDEVCODE(virtual void toString(SkString* str) const = 0;) | 124 SkDEVCODE(virtual void toString(SkString* str) const = 0;) |
124 | 125 |
125 SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP() | 126 SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP() |
mtklein
2013/09/24 22:52:18
I think we're going to have to work on some of the
sugoi1
2013/09/25 21:15:27
You're right.
SK_DEFINE_FLATTENABLE_TYPE defines
| |
127 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_UTILS() | |
128 SK_DEFINE_FLATTENABLE_TYPE(SkColorFilter) | |
126 protected: | 129 protected: |
127 SkColorFilter() {} | 130 SkColorFilter() {} |
128 SkColorFilter(SkFlattenableReadBuffer& rb) : INHERITED(rb) {} | 131 SkColorFilter(SkFlattenableReadBuffer& rb) : INHERITED(rb) {} |
129 | |
130 private: | |
131 typedef SkFlattenable INHERITED; | |
132 }; | 132 }; |
133 | 133 |
134 #endif | 134 #endif |
OLD | NEW |