#include <SkPaintPriv.h>
Definition at line 19 of file SkPaintPriv.h.
◆ ShaderOverrideOpacity
Enumerator |
---|
kNone_ShaderOverrideOpacity | there is no overriding shader (bitmap or image)
|
kOpaque_ShaderOverrideOpacity | the overriding shader is opaque
|
kNotOpaque_ShaderOverrideOpacity | the overriding shader may not be opaque
|
Definition at line 21 of file SkPaintPriv.h.
21 {
25 };
@ kNone_ShaderOverrideOpacity
there is no overriding shader (bitmap or image)
@ kOpaque_ShaderOverrideOpacity
the overriding shader is opaque
@ kNotOpaque_ShaderOverrideOpacity
the overriding shader may not be opaque
◆ ComputeLuminanceColor()
Definition at line 152 of file SkPaintPriv.cpp.
152 {
155 c = { 0.5f, 0.5f, 0.5f, 1.0f};
156 }
157 return c.toSkColor();
158}
static bool just_a_color(const SkPaint &paint, SkColor4f *color)
◆ Flatten()
Serializes SkPaint into a buffer. A companion unflatten() call can reconstitute the paint at a later time.
- Parameters
-
Definition at line 260 of file SkPaintPriv.cpp.
260 {
261 uint8_t flatFlags = 0;
262
263 if (
paint.getPathEffect() ||
265 paint.getMaskFilter() ||
266 paint.getColorFilter() ||
267 paint.getImageFilter() ||
268 !
paint.asBlendMode()) {
270 }
271
275
277
285 }
286}
static uint32_t pack_v68(const SkPaint &paint, unsigned flatFlags)
static const uint8_t buffer[]
◆ Overwrites()
Returns true if drawing with this paint (or nullptr) will ovewrite all affected pixels.
Note: returns conservative true, meaning it may return false even though the paint might in fact overwrite its pixels.
Definition at line 82 of file SkPaintPriv.cpp.
82 {
84
85
87 }
88
90
92 const unsigned paintAlpha =
paint->getAlpha();
94 (!
paint->getShader() ||
paint->getShader()->isOpaque())) {
96 } else if (0 == paintAlpha) {
99 } else {
101 }
102 }
103 }
104
105 const auto bm =
paint->asBlendMode();
106 if (!bm) {
107 return false;
108 }
110}
static bool blend_mode_is_opaque(SkBlendMode mode, SrcColorOpacity opacityType)
@ kTransparentBlack_SrcColorOpacity
@ kTransparentAlpha_SrcColorOpacity
@ kUnknown_SrcColorOpacity
@ kOpaque_SrcColorOpacity
static bool changes_alpha(const SkPaint &paint)
◆ RemoveColorFilter()
Definition at line 160 of file SkPaintPriv.cpp.
160 {
163
164
165 p->setShader(sk_make_sp<SkColorFilterShader>(
sk_ref_sp(shader),
169 } else {
171 }
172 p->setColorFilter(
nullptr);
173 }
174}
SkColorSpace * sk_srgb_singleton()
sk_sp< T > sk_ref_sp(T *obj)
◆ ShouldDither()
Definition at line 112 of file SkPaintPriv.cpp.
112 {
113
115 return false;
116 }
117
119 return false;
120 }
121
122
124 return true;
125 }
126
127
128 return p.getImageFilter() ||
p.getMaskFilter() ||
130}
@ kARGB_4444_SkColorType
pixel with 4 bits for alpha, red, green, blue; in 16-bit word
@ kRGB_565_SkColorType
pixel with 5 bits red, 6 bits green, 5 bits blue, in 16-bit word
@ kUnknown_SkColorType
uninitialized
SkShaderBase * as_SB(SkShader *shader)
virtual bool isConstant() const
◆ Unflatten()
Populates SkPaint, typically from a serialized stream, created by calling flatten() at an earlier time.
Definition at line 288 of file SkPaintPriv.cpp.
288 {
290
293 {
297 }
298
301
303
304 paint.setPathEffect(
nullptr);
305 paint.setShader(
nullptr);
306 paint.setMaskFilter(
nullptr);
307 paint.setColorFilter(
nullptr);
308 paint.setImageFilter(
nullptr);
310
317 } else {
324 }
325
328 }
330}
static uint32_t unpack_v68(SkPaint *paint, uint32_t packed, SkSafeRange &safe)
The documentation for this class was generated from the following files: