Flutter Engine
The Flutter Engine
Classes | Functions
sksg Namespace Reference

Classes

class  BlenderEffect
 
class  BlurImageFilter
 
class  ClipEffect
 
class  Color
 
class  ColorFilter
 
class  CustomRenderNode
 
class  DashEffect
 
class  Draw
 
class  DropShadowImageFilter
 
class  EffectNode
 
class  ExternalColorFilter
 
class  ExternalImageFilter
 
class  GeometryEffect
 
class  GeometryNode
 
class  GeometryTransform
 
class  Gradient
 
class  GradientColorFilter
 
class  Group
 
class  Image
 
class  ImageFilter
 
class  ImageFilterEffect
 
class  InvalidationController
 
class  LayerEffect
 
class  LinearGradient
 
class  MaskEffect
 
class  MaskShaderEffect
 
class  Matrix
 
class  Merge
 
class  ModeColorFilter
 
class  Node
 
class  NodePriv
 
class  OffsetEffect
 
class  OpacityEffect
 
class  PaintNode
 
class  Path
 
class  Plane
 
class  RadialGradient
 
class  Rect
 
class  RenderNode
 
class  RoundEffect
 
class  RRect
 
class  Scene
 
class  Shader
 
class  ShaderEffect
 
class  ShaderPaint
 
class  Text
 
class  Transform
 
class  TransformEffect
 
class  TransformPriv
 
class  TrimEffect
 

Functions

static bool is_inverted (sksg::MaskEffect::Mode mode)
 
static bool is_luma (sksg::MaskEffect::Mode mode)
 
static SkPathOp mode_to_op (Merge::Mode mode)
 
static SkAlpha ScaleAlpha (SkAlpha alpha, float opacity)
 
static sk_sp< SkShaderLocalShader (const sk_sp< SkShader > &shader, const SkMatrix &base, const SkMatrix &ctm)
 

Function Documentation

◆ is_inverted()

static bool sksg::is_inverted ( sksg::MaskEffect::Mode  mode)
static

Definition at line 24 of file SkSGMaskEffect.cpp.

24 {
25 return static_cast<uint32_t>(mode) & 1;
26}
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
Definition: switches.h:228

◆ is_luma()

static bool sksg::is_luma ( sksg::MaskEffect::Mode  mode)
static

Definition at line 28 of file SkSGMaskEffect.cpp.

28 {
29 return static_cast<uint32_t>(mode) & 2;
30}

◆ LocalShader()

static sk_sp< SkShader > sksg::LocalShader ( const sk_sp< SkShader > &  shader,
const SkMatrix base,
const SkMatrix ctm 
)
static

Definition at line 65 of file SkSGRenderNode.cpp.

67 {
68 // Mask filters / shaders are declared to operate under a specific transform, but due to the
69 // deferral mechanism, other transformations might have been pushed to the state.
70 // We want to undo these transforms (T):
71 //
72 // baseCTM x T = ctm
73 //
74 // => T = Inv(baseCTM) x ctm
75 //
76 // => Inv(T) = Inv(Inv(baseCTM) x ctm)
77 //
78 // => Inv(T) = Inv(ctm) x baseCTM
79
80 SkMatrix lm;
81 if (base != ctm && ctm.invert(&lm)) {
82 lm.preConcat(base);
83 } else {
84 lm = SkMatrix::I();
85 }
86
87 // Note: this doesn't play ball with existing shader local matrices (what we really want is
88 // SkShader::makeWithPostLocalMatrix). Probably a good signal that the whole mechanism is
89 // contrived and should be redesigned (use SkCanvas::clipShader when available, drop shader
90 // "effects" completely, etc).
91 return shader->makeWithLocalMatrix(lm);
92}
bool invert(SkMatrix *inverse) const
Definition: SkMatrix.h:1206
static const SkMatrix & I()
Definition: SkMatrix.cpp:1544
SkMatrix & preConcat(const SkMatrix &other)
Definition: SkMatrix.cpp:674
sk_sp< SkShader > makeWithLocalMatrix(const SkMatrix &) const
Definition: SkShader.cpp:26

◆ mode_to_op()

static SkPathOp sksg::mode_to_op ( Merge::Mode  mode)
static

Definition at line 51 of file SkSGMerge.cpp.

51 {
52 switch (mode) {
53 case Merge::Mode::kUnion:
54 return kUnion_SkPathOp;
55 case Merge::Mode::kIntersect:
57 case Merge::Mode::kDifference:
59 case Merge::Mode::kReverseDifference:
61 case Merge::Mode::kXOR:
62 return kXOR_SkPathOp;
63 default:
64 break;
65 }
66
67 return kUnion_SkPathOp;
68}
@ kReverseDifference_SkPathOp
subtract the first path from the op path
Definition: SkPathOps.h:27
@ kDifference_SkPathOp
subtract the op path from the first path
Definition: SkPathOps.h:23
@ kIntersect_SkPathOp
intersect the two paths
Definition: SkPathOps.h:24
@ kUnion_SkPathOp
union (inclusive-or) the two paths
Definition: SkPathOps.h:25
@ kXOR_SkPathOp
exclusive-or the two paths
Definition: SkPathOps.h:26

◆ ScaleAlpha()

static SkAlpha sksg::ScaleAlpha ( SkAlpha  alpha,
float  opacity 
)
static

Definition at line 61 of file SkSGRenderNode.cpp.

61 {
62 return SkToU8(sk_float_round2int(alpha * opacity));
63}
#define sk_float_round2int(x)
constexpr uint8_t SkToU8(S x)
Definition: SkTo.h:22