Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
sk_fontations::BoundsPainter Class Reference

#include <SkTypeface_fontations_priv.h>

Inheritance diagram for sk_fontations::BoundsPainter:
fontations_ffi::ColorPainterWrapper

Public Member Functions

 BoundsPainter ()=delete
 
 BoundsPainter (SkFontationsScalerContext &scaler_context, SkMatrix initialTransfom, uint16_t upem)
 
SkRect getBoundingBox ()
 
virtual void push_transform (const fontations_ffi::Transform &transform) override
 
virtual void pop_transform () override
 
virtual void push_clip_glyph (uint16_t glyph_id) override
 
virtual void push_clip_rectangle (float x_min, float y_min, float x_max, float y_max) override
 
virtual void pop_clip () override
 
virtual void fill_solid (uint16_t palette_index, float alpha) override
 
virtual void fill_radial (const fontations_ffi::FillRadialParams &fill_radial_params, fontations_ffi::BridgeColorStops &stops, uint8_t) override
 
virtual void fill_linear (const fontations_ffi::FillLinearParams &fill_linear_params, fontations_ffi::BridgeColorStops &stops, uint8_t) override
 
virtual void fill_sweep (const fontations_ffi::FillSweepParams &fill_sweep_params, fontations_ffi::BridgeColorStops &stops, uint8_t extend_mode) override
 
virtual void push_layer (uint8_t) override
 
virtual void pop_layer () override
 
virtual void fill_glyph_solid (uint16_t glyph_id, uint16_t, float) override
 
virtual void fill_glyph_radial (uint16_t glyph_id, const fontations_ffi::Transform &, const fontations_ffi::FillRadialParams &, fontations_ffi::BridgeColorStops &, uint8_t) override
 
virtual void fill_glyph_linear (uint16_t glyph_id, const fontations_ffi::Transform &, const fontations_ffi::FillLinearParams &, fontations_ffi::BridgeColorStops &, uint8_t) override
 
virtual void fill_glyph_sweep (uint16_t glyph_id, const fontations_ffi::Transform &, const fontations_ffi::FillSweepParams &, fontations_ffi::BridgeColorStops &, uint8_t) override
 
- Public Member Functions inherited from fontations_ffi::ColorPainterWrapper
virtual ~ColorPainterWrapper ()=default
 
virtual void push_transform (const Transform &transform)=0
 
virtual void pop_transform ()=0
 
virtual void push_clip_glyph (uint16_t glyph_id)=0
 
virtual void push_clip_rectangle (float x_min, float y_min, float x_max, float y_max)=0
 
virtual void pop_clip ()=0
 
virtual void fill_solid (uint16_t palette_index, float alpha)=0
 
virtual void fill_linear (const FillLinearParams &fill_linear_params, BridgeColorStops &stops, uint8_t extend_mode)=0
 
virtual void fill_radial (const FillRadialParams &fill_radial_params, BridgeColorStops &stops, uint8_t extend_mode)=0
 
virtual void fill_sweep (const FillSweepParams &, BridgeColorStops &stops, uint8_t extend_mode)=0
 
virtual void fill_glyph_solid (uint16_t glyph_id, uint16_t palette_index, float alpha)=0
 
virtual void fill_glyph_radial (uint16_t glyph_id, const fontations_ffi::Transform &transform, const fontations_ffi::FillRadialParams &fill_radial_params, fontations_ffi::BridgeColorStops &stops, uint8_t)=0
 
virtual void fill_glyph_linear (uint16_t glyph_id, const fontations_ffi::Transform &transform, const fontations_ffi::FillLinearParams &fill_linear_params, fontations_ffi::BridgeColorStops &stops, uint8_t)=0
 
virtual void fill_glyph_sweep (uint16_t glyph_id, const fontations_ffi::Transform &transform, const fontations_ffi::FillSweepParams &fill_sweep_params, fontations_ffi::BridgeColorStops &stops, uint8_t)=0
 
virtual void push_layer (uint8_t colrV1CompositeMode)=0
 
virtual void pop_layer ()=0
 

Detailed Description

Tracks transforms and clips to compute a bounding box without drawing pixels.

Definition at line 143 of file SkTypeface_fontations_priv.h.

Constructor & Destructor Documentation

◆ BoundsPainter() [1/2]

sk_fontations::BoundsPainter::BoundsPainter ( )
delete

◆ BoundsPainter() [2/2]

sk_fontations::BoundsPainter::BoundsPainter ( SkFontationsScalerContext scaler_context,
SkMatrix  initialTransfom,
uint16_t  upem 
)

Definition at line 1546 of file SkTypeface_fontations.cpp.

1549 : fScalerContext(scaler_context)
1550 , fCurrentTransform(initialTransfom)
1551 , fUpem(upem)
1552 , fBounds(SkRect::MakeEmpty()) {}
static constexpr SkRect MakeEmpty()
Definition: SkRect.h:595

Member Function Documentation

◆ fill_glyph_linear()

void sk_fontations::BoundsPainter::fill_glyph_linear ( uint16_t  glyph_id,
const fontations_ffi::Transform &  ,
const fontations_ffi::FillLinearParams &  ,
fontations_ffi::BridgeColorStops &  ,
uint8_t   
)
overridevirtual

Implements fontations_ffi::ColorPainterWrapper.

Definition at line 1603 of file SkTypeface_fontations.cpp.

1607 {
1608 push_clip_glyph(glyph_id);
1609 pop_clip();
1610}
virtual void push_clip_glyph(uint16_t glyph_id) override

◆ fill_glyph_radial()

void sk_fontations::BoundsPainter::fill_glyph_radial ( uint16_t  glyph_id,
const fontations_ffi::Transform &  ,
const fontations_ffi::FillRadialParams &  ,
fontations_ffi::BridgeColorStops &  ,
uint8_t   
)
overridevirtual

Implements fontations_ffi::ColorPainterWrapper.

Definition at line 1595 of file SkTypeface_fontations.cpp.

1599 {
1600 push_clip_glyph(glyph_id);
1601 pop_clip();
1602}

◆ fill_glyph_solid()

void sk_fontations::BoundsPainter::fill_glyph_solid ( uint16_t  glyph_id,
uint16_t  ,
float   
)
overridevirtual

Implements fontations_ffi::ColorPainterWrapper.

Definition at line 1590 of file SkTypeface_fontations.cpp.

1590 {
1591 push_clip_glyph(glyph_id);
1592 pop_clip();
1593}

◆ fill_glyph_sweep()

void sk_fontations::BoundsPainter::fill_glyph_sweep ( uint16_t  glyph_id,
const fontations_ffi::Transform &  ,
const fontations_ffi::FillSweepParams &  ,
fontations_ffi::BridgeColorStops &  ,
uint8_t   
)
overridevirtual

Implements fontations_ffi::ColorPainterWrapper.

Definition at line 1612 of file SkTypeface_fontations.cpp.

1616 {
1617 push_clip_glyph(glyph_id);
1618 pop_clip();
1619}

◆ fill_linear()

virtual void sk_fontations::BoundsPainter::fill_linear ( const fontations_ffi::FillLinearParams &  fill_linear_params,
fontations_ffi::BridgeColorStops &  stops,
uint8_t   
)
inlineoverridevirtual

Definition at line 164 of file SkTypeface_fontations_priv.h.

166 {}

◆ fill_radial()

virtual void sk_fontations::BoundsPainter::fill_radial ( const fontations_ffi::FillRadialParams &  fill_radial_params,
fontations_ffi::BridgeColorStops &  stops,
uint8_t   
)
inlineoverridevirtual

Definition at line 161 of file SkTypeface_fontations_priv.h.

163 {}

◆ fill_solid()

virtual void sk_fontations::BoundsPainter::fill_solid ( uint16_t  palette_index,
float  alpha 
)
inlineoverridevirtual

Implements fontations_ffi::ColorPainterWrapper.

Definition at line 160 of file SkTypeface_fontations_priv.h.

160{}

◆ fill_sweep()

virtual void sk_fontations::BoundsPainter::fill_sweep ( const fontations_ffi::FillSweepParams &  fill_sweep_params,
fontations_ffi::BridgeColorStops &  stops,
uint8_t  extend_mode 
)
inlineoverridevirtual

Definition at line 167 of file SkTypeface_fontations_priv.h.

169 {}

◆ getBoundingBox()

SkRect sk_fontations::BoundsPainter::getBoundingBox ( )

Definition at line 1554 of file SkTypeface_fontations.cpp.

1554{ return fBounds; }

◆ pop_clip()

virtual void sk_fontations::BoundsPainter::pop_clip ( )
inlineoverridevirtual

Implements fontations_ffi::ColorPainterWrapper.

Definition at line 157 of file SkTypeface_fontations_priv.h.

157{}

◆ pop_layer()

virtual void sk_fontations::BoundsPainter::pop_layer ( )
inlineoverridevirtual

Implements fontations_ffi::ColorPainterWrapper.

Definition at line 172 of file SkTypeface_fontations_priv.h.

172{}

◆ pop_transform()

void sk_fontations::BoundsPainter::pop_transform ( )
overridevirtual

Implements fontations_ffi::ColorPainterWrapper.

Definition at line 1571 of file SkTypeface_fontations.cpp.

1571 {
1572 fCurrentTransform.preConcat(fStackTopTransformInverse);
1573 fStackTopTransformInverse = SkMatrix();
1574}
SkMatrix & preConcat(const SkMatrix &other)
Definition: SkMatrix.cpp:674

◆ push_clip_glyph()

void sk_fontations::BoundsPainter::push_clip_glyph ( uint16_t  glyph_id)
overridevirtual

Implements fontations_ffi::ColorPainterWrapper.

Definition at line 1576 of file SkTypeface_fontations.cpp.

1576 {
1577 SkPath path;
1578 fScalerContext.generateYScalePathForGlyphId(glyph_id, &path, fUpem, *fontations_ffi::no_hinting_instance());
1579 path.transform(fCurrentTransform);
1580 fBounds.join(path.getBounds());
1581}
bool generateYScalePathForGlyphId(uint16_t glyphId, SkPath *path, float yScale, const fontations_ffi::BridgeHintingInstance &hintingInstance)
Definition: SkPath.h:59
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
Definition: switches.h:57
void join(const SkRect &r)
Definition: SkRect.cpp:126

◆ push_clip_rectangle()

void sk_fontations::BoundsPainter::push_clip_rectangle ( float  x_min,
float  y_min,
float  x_max,
float  y_max 
)
overridevirtual

Implements fontations_ffi::ColorPainterWrapper.

Definition at line 1583 of file SkTypeface_fontations.cpp.

1583 {
1584 SkRect clipRect = SkRect::MakeLTRB(x_min, -y_min, x_max, -y_max);
1585 SkPath rectPath = SkPath::Rect(clipRect);
1586 rectPath.transform(fCurrentTransform);
1587 fBounds.join(rectPath.getBounds());
1588}
static SkPath Rect(const SkRect &, SkPathDirection=SkPathDirection::kCW, unsigned startIndex=0)
Definition: SkPath.cpp:3586
const SkRect & getBounds() const
Definition: SkPath.cpp:430
void transform(const SkMatrix &matrix, SkPath *dst, SkApplyPerspectiveClip pc=SkApplyPerspectiveClip::kYes) const
Definition: SkPath.cpp:1711
clipRect(r.rect, r.opAA.op(), r.opAA.aa())) template<> void Draw
static constexpr SkRect MakeLTRB(float l, float t, float r, float b)
Definition: SkRect.h:646

◆ push_layer()

virtual void sk_fontations::BoundsPainter::push_layer ( uint8_t  )
inlineoverridevirtual

Implements fontations_ffi::ColorPainterWrapper.

Definition at line 171 of file SkTypeface_fontations_priv.h.

171{}

◆ push_transform()

void sk_fontations::BoundsPainter::push_transform ( const fontations_ffi::Transform &  transform)
overridevirtual

Definition at line 1557 of file SkTypeface_fontations.cpp.

1557 {
1558 SkMatrix transform = SkMatrix::MakeAll(transform_arg.xx,
1559 -transform_arg.xy,
1560 transform_arg.dx,
1561 -transform_arg.yx,
1562 transform_arg.yy,
1563 -transform_arg.dy,
1564 0.f,
1565 0.f,
1566 1.0f);
1567 fCurrentTransform.preConcat(transform);
1568 bool invertResult = transform.invert(&fStackTopTransformInverse);
1569 SkASSERT(invertResult);
1570}
#define SkASSERT(cond)
Definition: SkAssert.h:116
static SkMatrix MakeAll(SkScalar scaleX, SkScalar skewX, SkScalar transX, SkScalar skewY, SkScalar scaleY, SkScalar transY, SkScalar pers0, SkScalar pers1, SkScalar pers2)
Definition: SkMatrix.h:179
static SkColor4f transform(SkColor4f c, SkColorSpace *src, SkColorSpace *dst)
Definition: p3.cpp:47

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