OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 SkPaintPriv_DEFINED | 8 #ifndef SkPaintPriv_DEFINED |
9 #define SkPaintPriv_DEFINED | 9 #define SkPaintPriv_DEFINED |
10 | 10 |
11 #include "SkTypes.h" | 11 #include "SkTypes.h" |
12 | 12 |
13 class SkBitmap; | 13 class SkBitmap; |
14 class SkImage; | 14 class SkImage; |
15 class SkPaint; | 15 class SkPaint; |
16 | 16 |
17 class SkPaintPriv { | 17 class SkPaintPriv { |
18 public: | 18 public: |
19 enum ShaderOverrideOpacity { | 19 enum ShaderOverrideOpacity { |
20 kNone_ShaderOverrideOpacity, //!< there is no overriding shader (
bitmap or image) | 20 kNone_ShaderOverrideOpacity, //!< there is no overriding shader (
bitmap or image) |
21 kOpaque_ShaderOverrideOpacity, //!< the overriding shader is opaque | 21 kOpaque_ShaderOverrideOpacity, //!< the overriding shader is opaque |
22 kNotOpaque_ShaderOverrideOpacity, //!< the overriding shader may not b
e opaque | 22 kNotOpaque_ShaderOverrideOpacity, //!< the overriding shader may not b
e opaque |
23 }; | 23 }; |
24 | 24 |
25 /** | 25 /** |
26 * Returns true if drawing with this paint (or NULL) will ovewrite all affe
cted pixels. | 26 * Returns true if drawing with this paint (or nullptr) will ovewrite all a
ffected pixels. |
27 * | 27 * |
28 * Note: returns conservative true, meaning it may return false even though
the paint might | 28 * Note: returns conservative true, meaning it may return false even though
the paint might |
29 * in fact overwrite its pixels. | 29 * in fact overwrite its pixels. |
30 */ | 30 */ |
31 static bool Overwrites(const SkPaint* paint, ShaderOverrideOpacity); | 31 static bool Overwrites(const SkPaint* paint, ShaderOverrideOpacity); |
32 | 32 |
33 static bool Overwrites(const SkPaint& paint) { | 33 static bool Overwrites(const SkPaint& paint) { |
34 return Overwrites(&paint, kNone_ShaderOverrideOpacity); | 34 return Overwrites(&paint, kNone_ShaderOverrideOpacity); |
35 } | 35 } |
36 | 36 |
37 /** | 37 /** |
38 * Returns true if drawing this bitmap with this paint (or NULL) will ovewr
ite all affected | 38 * Returns true if drawing this bitmap with this paint (or nullptr) will ov
ewrite all affected |
39 * pixels. | 39 * pixels. |
40 */ | 40 */ |
41 static bool Overwrites(const SkBitmap&, const SkPaint* paint); | 41 static bool Overwrites(const SkBitmap&, const SkPaint* paint); |
42 | 42 |
43 /** | 43 /** |
44 * Returns true if drawing this image with this paint (or NULL) will ovewri
te all affected | 44 * Returns true if drawing this image with this paint (or nullptr) will ove
write all affected |
45 * pixels. | 45 * pixels. |
46 */ | 46 */ |
47 static bool Overwrites(const SkImage*, const SkPaint* paint); | 47 static bool Overwrites(const SkImage*, const SkPaint* paint); |
48 }; | 48 }; |
49 | 49 |
50 #endif | 50 #endif |
OLD | NEW |