8#ifndef SkTypeface_Fontations_priv_DEFINED
9#define SkTypeface_Fontations_priv_DEFINED
19#include "src/ports/fontations/src/ffi.rs.h"
35 void quad_to(
float cx0,
float cy0,
float x,
float y)
override;
36 void curve_to(
float cx0,
float cy0,
float cx1,
float cy1,
float x,
float y)
override;
37 void close()
override;
58 size_t i, uint32_t axisTag,
float min,
float def,
float max,
bool hidden)
override;
59 size_t size()
const override;
80 virtual void push_clip_rectangle(
float x_min,
float y_min,
float x_max,
float y_max)
override;
84 virtual void fill_solid(uint16_t palette_index,
float alpha)
override;
85 virtual void fill_radial(
const fontations_ffi::FillRadialParams& fill_radial_params,
86 fontations_ffi::BridgeColorStops&,
88 virtual void fill_linear(
const fontations_ffi::FillLinearParams& fill_linear_params,
89 fontations_ffi::BridgeColorStops&,
91 virtual void fill_sweep(
const fontations_ffi::FillSweepParams& fill_sweep_params,
92 fontations_ffi::BridgeColorStops&,
96 virtual void fill_glyph_solid(uint16_t glyph_id, uint16_t palette_index,
float alpha)
override;
99 const fontations_ffi::FillRadialParams& fill_radial_params,
100 fontations_ffi::BridgeColorStops& stops,
104 const fontations_ffi::FillLinearParams& fill_linear_params,
105 fontations_ffi::BridgeColorStops& stops,
109 const fontations_ffi::FillSweepParams& fill_sweep_params,
110 fontations_ffi::BridgeColorStops& stops,
114 virtual void push_layer(uint8_t compositeMode)
override;
118 void configure_solid_paint(uint16_t palette_index,
float alpha,
SkPaint&
paint);
119 void configure_linear_paint(
const fontations_ffi::FillLinearParams& fill_linear_params,
120 fontations_ffi::BridgeColorStops& bridge_stops,
124 void configure_radial_paint(
const fontations_ffi::FillRadialParams& fill_radial_params,
125 fontations_ffi::BridgeColorStops& bridge_stops,
129 void configure_sweep_paint(
const fontations_ffi::FillSweepParams& sweep_params,
130 fontations_ffi::BridgeColorStops& bridge_stops,
156 virtual void push_clip_rectangle(
float x_min,
float y_min,
float x_max,
float y_max)
override;
160 virtual void fill_solid(uint16_t palette_index,
float alpha)
override {}
161 virtual void fill_radial(
const fontations_ffi::FillRadialParams& fill_radial_params,
162 fontations_ffi::BridgeColorStops& stops,
164 virtual void fill_linear(
const fontations_ffi::FillLinearParams& fill_linear_params,
165 fontations_ffi::BridgeColorStops& stops,
167 virtual void fill_sweep(
const fontations_ffi::FillSweepParams& fill_sweep_params,
168 fontations_ffi::BridgeColorStops& stops,
179 const fontations_ffi::FillRadialParams&,
180 fontations_ffi::BridgeColorStops&,
184 const fontations_ffi::FillLinearParams&,
185 fontations_ffi::BridgeColorStops&,
189 const fontations_ffi::FillSweepParams&,
190 fontations_ffi::BridgeColorStops&,
210 rust::Box<fontations_ffi::BridgeFontRef>&& fontRef,
211 rust::Box<fontations_ffi::BridgeMappingIndex>&& mappingIndex,
212 rust::Box<fontations_ffi::BridgeNormalizedCoords>&& normalizedCoords,
213 rust::Box<fontations_ffi::BridgeOutlineCollection>&& outlines,
214 rust::Vec<uint32_t>&& palette);
219 return *fBridgeNormalizedCoords;
221 const fontations_ffi::BridgeOutlineCollection&
getOutlines() {
return *fOutlines; }
223 return SkSpan(
reinterpret_cast<const SkColor*
>(fPalette.data()), fPalette.size());
232 std::unique_ptr<SkStreamAsset>
onOpenStream(
int* ttcIndex)
const override;
249 int coordinateCount)
const override;
251 int parameterCount)
const override;
258 uint32_t fTtcIndex = 0;
261 rust::Box<fontations_ffi::BridgeFontRef> fBridgeFontRef;
262 rust::Box<fontations_ffi::BridgeMappingIndex> fMappingIndex;
263 rust::Box<fontations_ffi::BridgeNormalizedCoords> fBridgeNormalizedCoords;
264 rust::Box<fontations_ffi::BridgeOutlineCollection> fOutlines;
265 rust::Vec<uint32_t> fPalette;
267 mutable SkOnce fGlyphMasksMayNeedCurrentColorOnce;
268 mutable bool fGlyphMasksMayNeedCurrentColor;
SkSpan(Container &&) -> SkSpan< std::remove_pointer_t< decltype(std::data(std::declval< Container >()))> >
static constexpr SkFourByteTag SkSetFourByteTag(char a, char b, char c, char d)
void onGetFontDescriptor(SkFontDescriptor *, bool *) const override
int onGetVariationDesignPosition(SkFontArguments::VariationPosition::Coordinate coordinates[], int coordinateCount) const override
static sk_sp< SkTypeface > MakeFromStream(std::unique_ptr< SkStreamAsset >, const SkFontArguments &)
int onCountGlyphs() const override
SkSpan< const SkColor > getPalette() const
int onGetUPEM() const override
void onCharsToGlyphs(const SkUnichar *chars, int count, SkGlyphID glyphs[]) const override
std::unique_ptr< SkAdvancedTypefaceMetrics > onGetAdvancedMetrics() const override
bool onGlyphMaskNeedsCurrentColor() const override
void getPostScriptGlyphNames(SkString *) const override
int onGetVariationDesignParameters(SkFontParameters::Variation::Axis parameters[], int parameterCount) const override
sk_sp< SkTypeface > onMakeClone(const SkFontArguments &args) const override
const fontations_ffi::BridgeFontRef & getBridgeFontRef()
void onFilterRec(SkScalerContextRec *) const override
int onGetTableTags(SkFontTableTag tags[]) const override
void getGlyphToUnicodeMap(SkUnichar *) const override
std::unique_ptr< SkScalerContext > onCreateScalerContext(const SkScalerContextEffects &effects, const SkDescriptor *desc) const override
void onGetFamilyName(SkString *familyName) const override
const fontations_ffi::BridgeNormalizedCoords & getBridgeNormalizedCoords()
static sk_sp< SkTypeface > MakeFromData(sk_sp< SkData > fontData, const SkFontArguments &)
size_t onGetTableData(SkFontTableTag, size_t, size_t, void *) const override
const fontations_ffi::BridgeOutlineCollection & getOutlines()
std::unique_ptr< SkStreamAsset > onOpenStream(int *ttcIndex) const override
bool onGetPostScriptName(SkString *) const override
SkTypeface::LocalizedStrings * onCreateFamilyNameIterator() const override
size_t size() const override
bool populate_axis(size_t i, uint32_t axisTag, float min, float def, float max, bool hidden) 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_solid(uint16_t palette_index, float alpha) override
virtual void push_transform(const fontations_ffi::Transform &transform) override
virtual void push_clip_rectangle(float x_min, float y_min, float x_max, float y_max) override
virtual void pop_layer() 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 fill_linear(const fontations_ffi::FillLinearParams &fill_linear_params, fontations_ffi::BridgeColorStops &stops, 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
virtual void pop_clip() override
virtual void fill_radial(const fontations_ffi::FillRadialParams &fill_radial_params, fontations_ffi::BridgeColorStops &stops, uint8_t) override
virtual void fill_glyph_solid(uint16_t glyph_id, uint16_t, float) override
virtual void push_clip_glyph(uint16_t glyph_id) override
virtual void pop_transform() override
virtual void fill_radial(const fontations_ffi::FillRadialParams &fill_radial_params, fontations_ffi::BridgeColorStops &, uint8_t extend_mode) override
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) override
virtual void pop_clip() override
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) override
virtual void fill_solid(uint16_t palette_index, float alpha) override
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) override
virtual void pop_layer() override
virtual void push_layer(uint8_t compositeMode) override
virtual void pop_transform() override
virtual void fill_sweep(const fontations_ffi::FillSweepParams &fill_sweep_params, fontations_ffi::BridgeColorStops &, uint8_t extend_mode) override
virtual void fill_linear(const fontations_ffi::FillLinearParams &fill_linear_params, fontations_ffi::BridgeColorStops &, uint8_t extend_mode) override
virtual void fill_glyph_solid(uint16_t glyph_id, uint16_t palette_index, float alpha) override
virtual void push_clip_rectangle(float x_min, float y_min, float x_max, float y_max) override
virtual void push_transform(const fontations_ffi::Transform &transform) override
virtual void push_clip_glyph(uint16_t glyph_id) override
void line_to(float x, float y) override
void move_to(float x, float y) override
void curve_to(float cx0, float cy0, float cx1, float cy1, float x, float y) override
void quad_to(float cx0, float cy0, float x, float y) override
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
static float max(float r, float g, float b)
static float min(float r, float g, float b)
const uint32_t extend_mode[]
skgpu::graphite::Transform Transform
static SkColor4f transform(SkColor4f c, SkColorSpace *src, SkColorSpace *dst)