OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 SkModeColorFilter_DEFINED | 8 #ifndef SkModeColorFilter_DEFINED |
9 #define SkModeColorFilter_DEFINED | 9 #define SkModeColorFilter_DEFINED |
10 | 10 |
(...skipping 10 matching lines...) Expand all Loading... |
21 this->updateCache(); | 21 this->updateCache(); |
22 }; | 22 }; |
23 | 23 |
24 SkColor getColor() const { return fColor; } | 24 SkColor getColor() const { return fColor; } |
25 SkXfermode::Mode getMode() const { return fMode; } | 25 SkXfermode::Mode getMode() const { return fMode; } |
26 SkPMColor getPMColor() const { return fPMColor; } | 26 SkPMColor getPMColor() const { return fPMColor; } |
27 | 27 |
28 bool asColorMode(SkColor*, SkXfermode::Mode*) const SK_OVERRIDE; | 28 bool asColorMode(SkColor*, SkXfermode::Mode*) const SK_OVERRIDE; |
29 uint32_t getFlags() const SK_OVERRIDE; | 29 uint32_t getFlags() const SK_OVERRIDE; |
30 void filterSpan(const SkPMColor shader[], int count, SkPMColor result[]) con
st SK_OVERRIDE; | 30 void filterSpan(const SkPMColor shader[], int count, SkPMColor result[]) con
st SK_OVERRIDE; |
31 void filterSpan16(const uint16_t shader[], int count, uint16_t result[]) con
st SK_OVERRIDE; | |
32 | 31 |
33 #ifndef SK_IGNORE_TO_STRING | 32 #ifndef SK_IGNORE_TO_STRING |
34 void toString(SkString* str) const SK_OVERRIDE { | 33 void toString(SkString* str) const SK_OVERRIDE { |
35 str->append("SkModeColorFilter: color: 0x"); | 34 str->append("SkModeColorFilter: color: 0x"); |
36 str->appendHex(fColor); | 35 str->appendHex(fColor); |
37 str->append(" mode: "); | 36 str->append(" mode: "); |
38 str->append(SkXfermode::ModeName(fMode)); | 37 str->append(SkXfermode::ModeName(fMode)); |
39 } | 38 } |
40 #endif | 39 #endif |
41 | 40 |
42 #if SK_SUPPORT_GPU | 41 #if SK_SUPPORT_GPU |
43 bool asFragmentProcessors(GrContext*, SkTDArray<GrFragmentProcessor*>*) cons
t SK_OVERRIDE; | 42 bool asFragmentProcessors(GrContext*, SkTDArray<GrFragmentProcessor*>*) cons
t SK_OVERRIDE; |
44 #endif | 43 #endif |
45 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkModeColorFilter) | 44 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkModeColorFilter) |
46 | 45 |
47 protected: | 46 protected: |
48 void flatten(SkWriteBuffer&) const SK_OVERRIDE; | 47 void flatten(SkWriteBuffer&) const SK_OVERRIDE; |
49 | 48 |
50 private: | 49 private: |
51 SkColor fColor; | 50 SkColor fColor; |
52 SkXfermode::Mode fMode; | 51 SkXfermode::Mode fMode; |
53 // cache | 52 // cache |
54 SkPMColor fPMColor; | 53 SkPMColor fPMColor; |
55 SkXfermodeProc fProc; | 54 SkXfermodeProc fProc; |
56 SkXfermodeProc16 fProc16; | |
57 | 55 |
58 void updateCache(); | 56 void updateCache(); |
59 | 57 |
60 typedef SkColorFilter INHERITED; | 58 typedef SkColorFilter INHERITED; |
61 }; | 59 }; |
62 | 60 |
63 #endif | 61 #endif |
OLD | NEW |