93 const unsigned paintAlpha =
paint->getAlpha();
95 (!
paint->getShader() ||
paint->getShader()->isOpaque())) {
97 }
else if (0 == paintAlpha) {
106 const auto bm =
paint->asBlendMode();
129 return p.getImageFilter() ||
p.getMaskFilter() ||
138 const auto* shader =
as_SB(
paint.getShader());
139 if (shader && !shader->asLuminanceColor(&c)) {
142 if (
paint.getColorFilter()) {
145 c =
paint.getColorFilter()->filterColor4f(c, cs, cs);
156 c = { 0.5f, 0.5f, 0.5f, 1.0f};
158 return c.toSkColor();
166 p->setShader(sk_make_sp<SkColorFilterShader>(
sk_ref_sp(shader),
173 p->setColorFilter(
nullptr);
179 SkASSERT(bitCount > 0 && bitCount <= 32);
181 mask >>= (32 - bitCount);
185 #define ASSERT_FITS_IN(value, bitcount)
200 uint32_t v =
static_cast<uint32_t
>(
value);
219 const auto bm =
paint.asBlendMode();
220 const unsigned mode = bm ?
static_cast<unsigned>(bm.value())
224 (
unsigned)
paint.isAntiAlias(), 0, 8);
235 paint->setAntiAlias((packed & 1) != 0);
236 paint->setDither((packed & 2) != 0);
239 unsigned mode = packed & 0xFF;
262 uint8_t flatFlags = 0;
264 if (
paint.getPathEffect() ||
266 paint.getMaskFilter() ||
267 paint.getColorFilter() ||
268 paint.getImageFilter() ||
269 !
paint.asBlendMode()) {
305 paint.setPathEffect(
nullptr);
306 paint.setShader(
nullptr);
307 paint.setMaskFilter(
nullptr);
308 paint.setColorFilter(
nullptr);
309 paint.setImageFilter(
nullptr);
SK_API bool SkBlendMode_AsCoeff(SkBlendMode mode, SkBlendModeCoeff *src, SkBlendModeCoeff *dst)
@ kLastMode
last valid value
static SkColorFilterBase * as_CFB(SkColorFilter *filter)
SkColorSpace * sk_srgb_singleton()
@ 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
constexpr uint8_t CUSTOM_BLEND_MODE_SENTINEL
static bool blend_mode_is_opaque(SkBlendMode mode, SrcColorOpacity opacityType)
static bool just_a_color(const SkPaint &paint, SkColor4f *color)
static uint32_t pack_v68(const SkPaint &paint, unsigned flatFlags)
uint32_t shift_bits(T value, unsigned shift, unsigned bits)
@ kTransparentBlack_SrcColorOpacity
@ kTransparentAlpha_SrcColorOpacity
@ kUnknown_SrcColorOpacity
@ kOpaque_SrcColorOpacity
static bool changes_alpha(const SkPaint &paint)
static uint32_t unpack_v68(SkPaint *paint, uint32_t packed, SkSafeRange &safe)
#define ASSERT_FITS_IN(value, bitcount)
sk_sp< T > sk_ref_sp(T *obj)
SkShaderBase * as_SB(SkShader *shader)
bool isAlphaUnchanged() const
static void RemoveColorFilter(SkPaint *, SkColorSpace *dstCS)
static SkPaint Unflatten(SkReadBuffer &buffer)
static bool Overwrites(const SkPaint *paint, ShaderOverrideOpacity)
static bool ShouldDither(const SkPaint &, SkColorType)
@ kNone_ShaderOverrideOpacity
there is no overriding shader (bitmap or image)
@ kNotOpaque_ShaderOverrideOpacity
the overriding shader may not be opaque
static SkColor ComputeLuminanceColor(const SkPaint &)
static void Flatten(const SkPaint &paint, SkWriteBuffer &buffer)
@ kLast_Cap
largest Cap value
@ kStrokeAndFill_Style
sets to stroke and fill geometry
@ kLast_Join
equivalent to the largest value for Join
T checkLE(uint64_t value, T max)
virtual bool isConstant() const
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
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive mode