Flutter Engine
 
Loading...
Searching...
No Matches
Skwasm::TextStyle Struct Reference

#include <text_types.h>

Public Member Functions

void populatePaintIds (std::vector< flutter::DlPaint > &paints)
 

Public Attributes

skia::textlayout::TextStyle skiaStyle
 
std::optional< flutter::DlPaintforeground
 
std::optional< flutter::DlPaintbackground
 

Detailed Description

Definition at line 16 of file text_types.h.

Member Function Documentation

◆ populatePaintIds()

void Skwasm::TextStyle::populatePaintIds ( std::vector< flutter::DlPaint > &  paints)
inline

Definition at line 21 of file text_types.h.

21 {
22 if (background) {
23 skiaStyle.setBackgroundPaintID(paints.size());
24 paints.push_back(*background);
25 }
26 if (foreground) {
27 skiaStyle.setForegroundPaintID(paints.size());
28 paints.push_back(*foreground);
29 } else {
30 flutter::DlPaint paint;
31 paint.setColor(flutter::DlColor(skiaStyle.getColor()));
32 skiaStyle.setForegroundPaintID(paints.size());
33 paints.push_back(std::move(paint));
34 }
35 }
DlPaint & setColor(DlColor color)
Definition dl_paint.h:70
std::optional< flutter::DlPaint > background
Definition text_types.h:19
std::optional< flutter::DlPaint > foreground
Definition text_types.h:18
skia::textlayout::TextStyle skiaStyle
Definition text_types.h:17

References background, foreground, flutter::DlPaint::setColor(), and skiaStyle.

Member Data Documentation

◆ background

std::optional<flutter::DlPaint> Skwasm::TextStyle::background

Definition at line 19 of file text_types.h.

Referenced by populatePaintIds().

◆ foreground

std::optional<flutter::DlPaint> Skwasm::TextStyle::foreground

Definition at line 18 of file text_types.h.

Referenced by populatePaintIds().

◆ skiaStyle

skia::textlayout::TextStyle Skwasm::TextStyle::skiaStyle

Definition at line 17 of file text_types.h.

Referenced by populatePaintIds().


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