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 SkXfermode_DEFINED | 10 #ifndef SkXfermode_DEFINED |
11 #define SkXfermode_DEFINED | 11 #define SkXfermode_DEFINED |
12 | 12 |
13 #include "SkFlattenable.h" | 13 #include "SkFlattenable.h" |
14 #include "SkColor.h" | 14 #include "SkColor.h" |
15 | 15 |
16 class GrFragmentProcessor; | 16 class GrFragmentProcessor; |
17 class GrTexture; | 17 class GrTexture; |
18 class GrXPFactory; | 18 class GrXPFactory; |
19 class SkString; | 19 class SkString; |
20 class SkValue; | |
20 | 21 |
21 /** \class SkXfermode | 22 /** \class SkXfermode |
22 * | 23 * |
23 * SkXfermode is the base class for objects that are called to implement custom | 24 * SkXfermode is the base class for objects that are called to implement custom |
24 * "transfer-modes" in the drawing pipeline. The static function Create(Modes) | 25 * "transfer-modes" in the drawing pipeline. The static function Create(Modes) |
25 * can be called to return an instance of any of the predefined subclasses as | 26 * can be called to return an instance of any of the predefined subclasses as |
26 * specified in the Modes enum. When an SkXfermode is assigned to an SkPaint, | 27 * specified in the Modes enum. When an SkXfermode is assigned to an SkPaint, |
27 * then objects drawn with that paint have the xfermode applied. | 28 * then objects drawn with that paint have the xfermode applied. |
28 * | 29 * |
29 * All subclasses are required to be reentrant-safe : it must be legal to share | 30 * All subclasses are required to be reentrant-safe : it must be legal to share |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
222 } | 223 } |
223 return true; | 224 return true; |
224 } | 225 } |
225 return xfermode->asXPFactory(xpf); | 226 return xfermode->asXPFactory(xpf); |
226 } | 227 } |
227 | 228 |
228 SK_TO_STRING_PUREVIRT() | 229 SK_TO_STRING_PUREVIRT() |
229 SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP() | 230 SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP() |
230 SK_DEFINE_FLATTENABLE_TYPE(SkXfermode) | 231 SK_DEFINE_FLATTENABLE_TYPE(SkXfermode) |
231 | 232 |
233 virtual SkValue represent() const = 0; | |
mtklein
2016/01/14 22:58:28
-> value(), asValue() ?
hal.canary
2016/01/14 23:43:10
asValue. done
| |
234 | |
232 protected: | 235 protected: |
233 SkXfermode() {} | 236 SkXfermode() {} |
234 /** The default implementation of xfer32/xfer16/xferA8 in turn call this | 237 /** The default implementation of xfer32/xfer16/xferA8 in turn call this |
235 method, 1 color at a time (upscaled to a SkPMColor). The default | 238 method, 1 color at a time (upscaled to a SkPMColor). The default |
236 implementation of this method just returns dst. If performance is | 239 implementation of this method just returns dst. If performance is |
237 important, your subclass should override xfer32/xfer16/xferA8 directly. | 240 important, your subclass should override xfer32/xfer16/xferA8 directly. |
238 | 241 |
239 This method will not be called directly by the client, so it need not | 242 This method will not be called directly by the client, so it need not |
240 be implemented if your subclass has overridden xfer32/xfer16/xferA8 | 243 be implemented if your subclass has overridden xfer32/xfer16/xferA8 |
241 */ | 244 */ |
242 virtual SkPMColor xferColor(SkPMColor src, SkPMColor dst) const; | 245 virtual SkPMColor xferColor(SkPMColor src, SkPMColor dst) const; |
243 | 246 |
244 private: | 247 private: |
245 enum { | 248 enum { |
246 kModeCount = kLastMode + 1 | 249 kModeCount = kLastMode + 1 |
247 }; | 250 }; |
248 | 251 |
249 typedef SkFlattenable INHERITED; | 252 typedef SkFlattenable INHERITED; |
250 }; | 253 }; |
251 | 254 |
252 #endif | 255 #endif |
OLD | NEW |