Flutter Engine
The Flutter Engine
SkPaintPriv.h
Go to the documentation of this file.
1/*
2 * Copyright 2013 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8#ifndef SkPaintPriv_DEFINED
9#define SkPaintPriv_DEFINED
10
13
14class SkColorSpace;
15class SkReadBuffer;
16class SkWriteBuffer;
17enum SkColorType : int;
18
20public:
22 kNone_ShaderOverrideOpacity, //!< there is no overriding shader (bitmap or image)
23 kOpaque_ShaderOverrideOpacity, //!< the overriding shader is opaque
24 kNotOpaque_ShaderOverrideOpacity, //!< the overriding shader may not be opaque
25 };
26
27 /**
28 * Returns true if drawing with this paint (or nullptr) will ovewrite all affected pixels.
29 *
30 * Note: returns conservative true, meaning it may return false even though the paint might
31 * in fact overwrite its pixels.
32 */
33 static bool Overwrites(const SkPaint* paint, ShaderOverrideOpacity);
34
35 static bool ShouldDither(const SkPaint&, SkColorType);
36
37 /*
38 * The luminance color is used to determine which Gamma Canonical color to map to. This is
39 * really only used by backends which want to cache glyph masks, and need some way to know if
40 * they need to generate new masks based off a given color.
41 */
43
44 /** Serializes SkPaint into a buffer. A companion unflatten() call
45 can reconstitute the paint at a later time.
46
47 @param buffer SkWriteBuffer receiving the flattened SkPaint data
48 */
49 static void Flatten(const SkPaint& paint, SkWriteBuffer& buffer);
50
51 /** Populates SkPaint, typically from a serialized stream, created by calling
52 flatten() at an earlier time.
53 */
55
56 // If this paint has any color filter, fold it into the shader and/or paint color
57 // so that it draws the same but getColorFilter() returns nullptr.
58 //
59 // Since we may be filtering now, we need to know what color space to filter in,
60 // typically the color space of the device we're drawing into.
61 static void RemoveColorFilter(SkPaint*, SkColorSpace* dstCS);
62
63};
64
65#endif
SkColorType
Definition: SkColorType.h:19
uint32_t SkColor
Definition: SkColor.h:37
static void RemoveColorFilter(SkPaint *, SkColorSpace *dstCS)
static SkPaint Unflatten(SkReadBuffer &buffer)
static bool Overwrites(const SkPaint *paint, ShaderOverrideOpacity)
Definition: SkPaintPriv.cpp:83
static bool ShouldDither(const SkPaint &, SkColorType)
@ kNone_ShaderOverrideOpacity
there is no overriding shader (bitmap or image)
Definition: SkPaintPriv.h:22
@ kOpaque_ShaderOverrideOpacity
the overriding shader is opaque
Definition: SkPaintPriv.h:23
@ kNotOpaque_ShaderOverrideOpacity
the overriding shader may not be opaque
Definition: SkPaintPriv.h:24
static SkColor ComputeLuminanceColor(const SkPaint &)
static void Flatten(const SkPaint &paint, SkWriteBuffer &buffer)
const Paint & paint
Definition: color_source.cc:38
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace buffer
Definition: switches.h:126