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

#include <SkTypeface_fontations_priv.h>

Inheritance diagram for sk_fontations::PathGeometrySink:
fontations_ffi::PathWrapper

Public Member Functions

void move_to (float x, float y) override
 
void line_to (float x, float y) override
 
void quad_to (float cx0, float cy0, float x, float y) override
 
void curve_to (float cx0, float cy0, float cx1, float cy1, float x, float y) override
 
void close () override
 
SkPath into_inner () &&
 
- Public Member Functions inherited from fontations_ffi::PathWrapper
virtual ~PathWrapper ()=default
 
virtual void move_to (float x, float y)=0
 
virtual void line_to (float x, float y)=0
 
virtual void quad_to (float cx0, float cy0, float x, float y)=0
 
virtual void curve_to (float cx0, float cy0, float cx1, float cy1, float x, float y)=0
 
virtual void close ()=0
 

Detailed Description

Implementation of PathWrapper FFI C++ interface which allows Rust to call back into C++ without exposing Skia types on the interface, see skpath_bridge.h.

Definition at line 30 of file SkTypeface_fontations_priv.h.

Member Function Documentation

◆ close()

void sk_fontations::PathGeometrySink::close ( )
overridevirtual

Implements fontations_ffi::PathWrapper.

Definition at line 237 of file SkTypeface_fontations.cpp.

237{ fPath.close(); }
SkPath & close()
Definition: SkPath.cpp:823

◆ curve_to()

void sk_fontations::PathGeometrySink::curve_to ( float  cx0,
float  cy0,
float  cx1,
float  cy1,
float  x,
float  y 
)
overridevirtual

Implements fontations_ffi::PathWrapper.

Definition at line 227 of file SkTypeface_fontations.cpp.

227 {
231 if (current_is_not(pt0) || current_is_not(pt1) || current_is_not(pt2)) {
232 going_to(pt2);
233 fPath.cubicTo(pt0, pt1, pt2);
234 }
235}
#define SkFloatToScalar(x)
Definition: SkScalar.h:62
SkPath & cubicTo(SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2, SkScalar x3, SkScalar y3)
Definition: SkPath.cpp:799
double y
double x
static constexpr SkPoint Make(float x, float y)
Definition: SkPoint_impl.h:173

◆ into_inner()

SkPath sk_fontations::PathGeometrySink::into_inner ( ) &&

Definition at line 239 of file SkTypeface_fontations.cpp.

239{ return std::move(fPath); }

◆ line_to()

void sk_fontations::PathGeometrySink::line_to ( float  x,
float  y 
)
overridevirtual

Implements fontations_ffi::PathWrapper.

Definition at line 211 of file SkTypeface_fontations.cpp.

211 {
213 if (current_is_not(pt0)) {
214 going_to(pt0);
215 fPath.lineTo(pt0);
216 }
217}
SkPath & lineTo(SkScalar x, SkScalar y)
Definition: SkPath.cpp:728

◆ move_to()

void sk_fontations::PathGeometrySink::move_to ( float  x,
float  y 
)
overridevirtual

Implements fontations_ffi::PathWrapper.

Definition at line 203 of file SkTypeface_fontations.cpp.

203 {
204 if (fStarted) {
205 fPath.close();
206 fStarted = false;
207 }
209}

◆ quad_to()

void sk_fontations::PathGeometrySink::quad_to ( float  cx0,
float  cy0,
float  x,
float  y 
)
overridevirtual

Implements fontations_ffi::PathWrapper.

Definition at line 219 of file SkTypeface_fontations.cpp.

219 {
222 if (current_is_not(pt0) || current_is_not(pt1)) {
223 going_to(pt1);
224 fPath.quadTo(pt0, pt1);
225 }
226}
SkPath & quadTo(SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2)
Definition: SkPath.cpp:746

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