Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
skgpu::graphite::CoverageMaskShape Class Reference

#include <CoverageMaskShape.h>

Classes

struct  MaskInfo
 

Public Member Functions

 CoverageMaskShape ()=default
 
 CoverageMaskShape (const Shape &shape, const TextureProxy *proxy, const SkM44 &deviceToLocal, const MaskInfo &maskInfo)
 
 CoverageMaskShape (const CoverageMaskShape &)=default
 
 ~CoverageMaskShape ()=default
 
CoverageMaskShapeoperator= (CoverageMaskShape &&)=delete
 
CoverageMaskShapeoperator= (const CoverageMaskShape &)=default
 
Rect bounds () const
 
const SkM44deviceToLocal () const
 
const half2textureOrigin () const
 
const half2maskSize () const
 
const TextureProxytextureProxy () const
 
bool inverted () const
 

Detailed Description

CoverageMaskShape represents a shape for which per-pixel coverage data comes from a texture. This excludes font glyphs that are rendered to a persistent atlas, as those are represented by the SubRunData geometry type.

Coverage masks are defined relative to an intermediate coordinate space between the final device space and the original geometry and shading's local space. For atlases and simple cases this intermediate space is pixel-aligned with the final device space, meaning only an integer translation is necessary to align the mask with where the original geometry would have been rendered into the device. In complex cases, the remaining transform may include rotation, skew, or even perspective that has to be applied after some filter effect.

Regardless, the DrawParams that records the CoverageMaskShape stores this remaining transform as the "local-to-device" tranform, i.e. "local" refers to the mask's coordinate space. The CoverageMaskShape stores the original local-to-device inverse so that it can reconstruct coords for shading. Like other Geometry types, the bounds() returned by CoverageMaskShape are relative to its local space, so they are identical to its mask size.

Definition at line 37 of file CoverageMaskShape.h.

Constructor & Destructor Documentation

◆ CoverageMaskShape() [1/3]

skgpu::graphite::CoverageMaskShape::CoverageMaskShape ( )
default

◆ CoverageMaskShape() [2/3]

skgpu::graphite::CoverageMaskShape::CoverageMaskShape ( const Shape shape,
const TextureProxy proxy,
const SkM44 deviceToLocal,
const MaskInfo maskInfo 
)
inline

Definition at line 55 of file CoverageMaskShape.h.

59 : fTextureProxy(proxy)
60 , fDeviceToLocal(deviceToLocal)
61 , fInverted(shape.inverted())
62 , fMaskInfo(maskInfo) {
63 SkASSERT(proxy);
64 }
#define SkASSERT(cond)
Definition SkAssert.h:116

◆ CoverageMaskShape() [3/3]

skgpu::graphite::CoverageMaskShape::CoverageMaskShape ( const CoverageMaskShape )
default

◆ ~CoverageMaskShape()

skgpu::graphite::CoverageMaskShape::~CoverageMaskShape ( )
default

Member Function Documentation

◆ bounds()

Rect skgpu::graphite::CoverageMaskShape::bounds ( ) const
inline

Definition at line 76 of file CoverageMaskShape.h.

76 {
77 return Rect(0.f, 0.f, (float) this->maskSize().x(), (float) this->maskSize().y());
78 }
double y
double x
TRect< Scalar > Rect
Definition rect.h:746

◆ deviceToLocal()

const SkM44 & skgpu::graphite::CoverageMaskShape::deviceToLocal ( ) const
inline

Definition at line 81 of file CoverageMaskShape.h.

81{ return fDeviceToLocal; }

◆ inverted()

bool skgpu::graphite::CoverageMaskShape::inverted ( ) const
inline

Definition at line 94 of file CoverageMaskShape.h.

94{ return fInverted; }

◆ maskSize()

const half2 & skgpu::graphite::CoverageMaskShape::maskSize ( ) const
inline

Definition at line 88 of file CoverageMaskShape.h.

◆ operator=() [1/2]

CoverageMaskShape & skgpu::graphite::CoverageMaskShape::operator= ( const CoverageMaskShape )
default

◆ operator=() [2/2]

CoverageMaskShape & skgpu::graphite::CoverageMaskShape::operator= ( CoverageMaskShape &&  )
delete

◆ textureOrigin()

const half2 & skgpu::graphite::CoverageMaskShape::textureOrigin ( ) const
inline

Definition at line 85 of file CoverageMaskShape.h.

◆ textureProxy()

const TextureProxy * skgpu::graphite::CoverageMaskShape::textureProxy ( ) const
inline

Definition at line 91 of file CoverageMaskShape.h.

91{ return fTextureProxy; }

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