Flutter Engine
The Flutter Engine
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
SkRSXform Struct Reference

#include <SkRSXform.h>

Public Member Functions

bool rectStaysRect () const
 
void setIdentity ()
 
void set (SkScalar scos, SkScalar ssin, SkScalar tx, SkScalar ty)
 
void toQuad (SkScalar width, SkScalar height, SkPoint quad[4]) const
 
void toQuad (const SkSize &size, SkPoint quad[4]) const
 
void toTriStrip (SkScalar width, SkScalar height, SkPoint strip[4]) const
 

Static Public Member Functions

static SkRSXform Make (SkScalar scos, SkScalar ssin, SkScalar tx, SkScalar ty)
 
static SkRSXform MakeFromRadians (SkScalar scale, SkScalar radians, SkScalar tx, SkScalar ty, SkScalar ax, SkScalar ay)
 

Public Attributes

SkScalar fSCos
 
SkScalar fSSin
 
SkScalar fTx
 
SkScalar fTy
 

Detailed Description

A compressed form of a rotation+scale matrix.

[ fSCos -fSSin fTx ] [ fSSin fSCos fTy ] [ 0 0 1 ]

Definition at line 23 of file SkRSXform.h.

Member Function Documentation

◆ Make()

static SkRSXform SkRSXform::Make ( SkScalar  scos,
SkScalar  ssin,
SkScalar  tx,
SkScalar  ty 
)
inlinestatic

Definition at line 24 of file SkRSXform.h.

24 {
25 SkRSXform xform = { scos, ssin, tx, ty };
26 return xform;
27 }

◆ MakeFromRadians()

static SkRSXform SkRSXform::MakeFromRadians ( SkScalar  scale,
SkScalar  radians,
SkScalar  tx,
SkScalar  ty,
SkScalar  ax,
SkScalar  ay 
)
inlinestatic

Definition at line 35 of file SkRSXform.h.

36 {
37 const SkScalar s = SkScalarSin(radians) * scale;
38 const SkScalar c = SkScalarCos(radians) * scale;
39 return Make(c, s, tx + -c * ax + s * ay, ty + -s * ax - c * ay);
40 }
#define SkScalarSin(radians)
Definition: SkScalar.h:45
#define SkScalarCos(radians)
Definition: SkScalar.h:46
float SkScalar
Definition: extension.cpp:12
struct MyStruct s
const Scalar scale
static SkRSXform Make(SkScalar scos, SkScalar ssin, SkScalar tx, SkScalar ty)
Definition: SkRSXform.h:24

◆ rectStaysRect()

bool SkRSXform::rectStaysRect ( ) const
inline

Definition at line 47 of file SkRSXform.h.

47 {
48 return 0 == fSCos || 0 == fSSin;
49 }
SkScalar fSCos
Definition: SkRSXform.h:42
SkScalar fSSin
Definition: SkRSXform.h:43

◆ set()

void SkRSXform::set ( SkScalar  scos,
SkScalar  ssin,
SkScalar  tx,
SkScalar  ty 
)
inline

Definition at line 56 of file SkRSXform.h.

56 {
57 fSCos = scos;
58 fSSin = ssin;
59 fTx = tx;
60 fTy = ty;
61 }
SkScalar fTy
Definition: SkRSXform.h:45
SkScalar fTx
Definition: SkRSXform.h:44

◆ setIdentity()

void SkRSXform::setIdentity ( )
inline

Definition at line 51 of file SkRSXform.h.

51 {
52 fSCos = 1;
53 fSSin = fTx = fTy = 0;
54 }

◆ toQuad() [1/2]

void SkRSXform::toQuad ( const SkSize size,
SkPoint  quad[4] 
) const
inline

Definition at line 64 of file SkRSXform.h.

64 {
65 this->toQuad(size.width(), size.height(), quad);
66 }
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 keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
Definition: switches.h:259
void toQuad(SkScalar width, SkScalar height, SkPoint quad[4]) const
Definition: SkRSXform.cpp:9
SkScalar width() const
Definition: SkSize.h:76

◆ toQuad() [2/2]

void SkRSXform::toQuad ( SkScalar  width,
SkScalar  height,
SkPoint  quad[4] 
) const

Definition at line 9 of file SkRSXform.cpp.

9 {
10#if 0
11 // This is the slow way, but it documents what we're doing
12 quad[0].set(0, 0);
13 quad[1].set(width, 0);
14 quad[2].set(width, height);
15 quad[3].set(0, height);
16 SkMatrix m;
17 m.setRSXform(*this).mapPoints(quad, quad, 4);
18#else
19 const SkScalar m00 = fSCos;
20 const SkScalar m01 = -fSSin;
21 const SkScalar m02 = fTx;
22 const SkScalar m10 = -m01;
23 const SkScalar m11 = m00;
24 const SkScalar m12 = fTy;
25
26 quad[0].set(m02, m12);
27 quad[1].set(m00 * width + m02, m10 * width + m12);
28 quad[2].set(m00 * width + m01 * height + m02, m10 * width + m11 * height + m12);
29 quad[3].set(m01 * height + m02, m11 * height + m12);
30#endif
31}
int32_t height
int32_t width
void set(float x, float y)
Definition: SkPoint_impl.h:200

◆ toTriStrip()

void SkRSXform::toTriStrip ( SkScalar  width,
SkScalar  height,
SkPoint  strip[4] 
) const

Definition at line 33 of file SkRSXform.cpp.

33 {
34 const SkScalar m00 = fSCos;
35 const SkScalar m01 = -fSSin;
36 const SkScalar m02 = fTx;
37 const SkScalar m10 = -m01;
38 const SkScalar m11 = m00;
39 const SkScalar m12 = fTy;
40
41 strip[0].set(m02, m12);
42 strip[1].set(m01 * height + m02, m11 * height + m12);
43 strip[2].set(m00 * width + m02, m10 * width + m12);
44 strip[3].set(m00 * width + m01 * height + m02, m10 * width + m11 * height + m12);
45}

Member Data Documentation

◆ fSCos

SkScalar SkRSXform::fSCos

Definition at line 42 of file SkRSXform.h.

◆ fSSin

SkScalar SkRSXform::fSSin

Definition at line 43 of file SkRSXform.h.

◆ fTx

SkScalar SkRSXform::fTx

Definition at line 44 of file SkRSXform.h.

◆ fTy

SkScalar SkRSXform::fTy

Definition at line 45 of file SkRSXform.h.


The documentation for this struct was generated from the following files: