Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
SkBlendModePriv.h
Go to the documentation of this file.
1/*
2 * Copyright 2016 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 SkBlendModePriv_DEFINED
9#define SkBlendModePriv_DEFINED
10
14
16class SkPaint;
17
18/**
19 * Sentinel value for SkBlendMode enum.
20 *
21 * Will never be a valid enum value, but will be storable in a byte.
22 */
23constexpr uint8_t kCustom_SkBlendMode = 0xFF;
24
26
28 return (mode > SkBlendMode::kLastSeparableMode);
29}
30
31bool SkBlendMode_ShouldPreScaleCoverage(SkBlendMode, bool rgb_coverage);
33
35
36enum class SkBlendFastPath {
37 kNormal, // draw normally
38 kSrcOver, //< draw as if in srcover mode
39 kSkipDrawing //< draw nothing
40};
41
42/**
43 * Given a paint, determine whether the paint's blend mode can be
44 * replaced with kSrcOver or not drawn at all. This can inform drawing optimizations.
45 */
46SkBlendFastPath CheckFastPath(const SkPaint&, bool dstIsOpaque);
47
48#endif
void SkBlendMode_AppendStages(SkBlendMode, SkRasterPipeline *)
SkBlendFastPath
SkPMColor4f SkBlendMode_Apply(SkBlendMode, const SkPMColor4f &src, const SkPMColor4f &dst)
constexpr uint8_t kCustom_SkBlendMode
static bool SkBlendMode_CaresAboutRBOrder(SkBlendMode mode)
bool SkBlendMode_ShouldPreScaleCoverage(SkBlendMode, bool rgb_coverage)
SkBlendFastPath CheckFastPath(const SkPaint &, bool dstIsOpaque)
bool SkBlendMode_SupportsCoverageAsAlpha(SkBlendMode)
SkBlendMode
Definition SkBlendMode.h:38
@ kLastSeparableMode
last blend mode operating separately on components