Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
skgpu::tess::AffineMatrix Class Reference

#include <AffineMatrix.h>

Public Member Functions

 AffineMatrix ()=default
 
 AffineMatrix (const SkMatrix &m)
 
AffineMatrixoperator= (const SkMatrix &m)
 
SK_ALWAYS_INLINE skvx::float4 map2Points (skvx::float4 p0p1) const
 
SK_ALWAYS_INLINE skvx::float4 map2Points (const SkPoint pts[2]) const
 
SK_ALWAYS_INLINE skvx::float4 map2Points (SkPoint p0, SkPoint p1) const
 
SK_ALWAYS_INLINE skvx::float2 mapPoint (skvx::float2 p) const
 
SK_ALWAYS_INLINE skvx::float2 map1Point (const SkPoint pt[1]) const
 
SK_ALWAYS_INLINE SkPoint mapPoint (SkPoint p) const
 

Detailed Description

Definition at line 24 of file AffineMatrix.h.

Constructor & Destructor Documentation

◆ AffineMatrix() [1/2]

skgpu::tess::AffineMatrix::AffineMatrix ( )
default

◆ AffineMatrix() [2/2]

skgpu::tess::AffineMatrix::AffineMatrix ( const SkMatrix m)
inline

Definition at line 27 of file AffineMatrix.h.

Member Function Documentation

◆ map1Point()

SK_ALWAYS_INLINE skvx::float2 skgpu::tess::AffineMatrix::map1Point ( const SkPoint  pt[1]) const
inline

Definition at line 55 of file AffineMatrix.h.

55 {
56 return this->mapPoint(skvx::float2::Load(pt));
57 }
SK_ALWAYS_INLINE skvx::float2 mapPoint(skvx::float2 p) const
Definition: AffineMatrix.h:51
static SKVX_ALWAYS_INLINE Vec Load(const void *ptr)
Definition: SkVx.h:109

◆ map2Points() [1/3]

SK_ALWAYS_INLINE skvx::float4 skgpu::tess::AffineMatrix::map2Points ( const SkPoint  pts[2]) const
inline

Definition at line 42 of file AffineMatrix.h.

42 {
43 return this->map2Points(skvx::float4::Load(pts));
44 }
SK_ALWAYS_INLINE skvx::float4 map2Points(skvx::float4 p0p1) const
Definition: AffineMatrix.h:38

◆ map2Points() [2/3]

SK_ALWAYS_INLINE skvx::float4 skgpu::tess::AffineMatrix::map2Points ( SkPoint  p0,
SkPoint  p1 
) const
inline

Definition at line 46 of file AffineMatrix.h.

46 {
47 return this->map2Points(skvx::float4(sk_bit_cast<skvx::float2>(p0),
48 sk_bit_cast<skvx::float2>(p1)));
49 }
Definition: SkVx.h:83

◆ map2Points() [3/3]

SK_ALWAYS_INLINE skvx::float4 skgpu::tess::AffineMatrix::map2Points ( skvx::float4  p0p1) const
inline

Definition at line 38 of file AffineMatrix.h.

38 {
39 return fScale * p0p1 + (fSkew * p0p1.yxwz() + fTrans);
40 }

◆ mapPoint() [1/2]

SK_ALWAYS_INLINE SkPoint skgpu::tess::AffineMatrix::mapPoint ( SkPoint  p) const
inline

Definition at line 59 of file AffineMatrix.h.

59 {
60 return sk_bit_cast<SkPoint>(this->mapPoint(sk_bit_cast<skvx::float2>(p)));
61 }

◆ mapPoint() [2/2]

SK_ALWAYS_INLINE skvx::float2 skgpu::tess::AffineMatrix::mapPoint ( skvx::float2  p) const
inline

Definition at line 51 of file AffineMatrix.h.

51 {
52 return fScale.lo * p + (fSkew.lo * p.yx() + fTrans.lo);
53 }
Vec< N/2, T > lo
Definition: SkVx.h:117

◆ operator=()

AffineMatrix & skgpu::tess::AffineMatrix::operator= ( const SkMatrix m)
inline

Definition at line 29 of file AffineMatrix.h.

29 {
30 SkASSERT(!m.hasPerspective());
31 // Duplicate the matrix in float4.lo and float4.hi so we can map two points at once.
32 fScale = skvx::float2(m.getScaleX(), m.getScaleY()).xyxy();
33 fSkew = skvx::float2(m.getSkewX(), m.getSkewY()).xyxy();
34 fTrans = skvx::float2(m.getTranslateX(), m.getTranslateY()).xyxy();
35 return *this;
36 }
#define SkASSERT(cond)
Definition: SkAssert.h:116
Vec< 2, float > float2
Definition: SkVx.h:1145

The documentation for this class was generated from the following file: