Flutter Engine
Loading...
Searching...
No Matches
text_types.h
Go to the documentation of this file.
1
// Copyright 2013 The Flutter Authors. All rights reserved.
2
// Use of this source code is governed by a BSD-style license that can be
3
// found in the LICENSE file.
4
5
#ifndef FLUTTER_LIB_WEB_UI_SKWASM_TEXT_TEXT_TYPES_H_
6
#define FLUTTER_LIB_WEB_UI_SKWASM_TEXT_TEXT_TYPES_H_
7
8
#include "
flutter/display_list/dl_paint.h
"
9
#include "third_party/skia/modules/skparagraph/include/Paragraph.h"
10
#include "third_party/skia/modules/skparagraph/include/ParagraphBuilder.h"
11
12
#include <optional>
13
#include <vector>
14
15
namespace
Skwasm
{
16
struct
TextStyle
{
17
skia::textlayout::TextStyle
skiaStyle
;
18
std::optional<flutter::DlPaint>
foreground
;
19
std::optional<flutter::DlPaint>
background
;
20
21
void
populatePaintIds
(std::vector<flutter::DlPaint>& paints) {
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
}
36
};
37
38
struct
ParagraphStyle
{
39
skia::textlayout::ParagraphStyle
skiaParagraphStyle
;
40
TextStyle
textStyle
;
41
};
42
43
struct
ParagraphBuilder
{
44
std::unique_ptr<skia::textlayout::ParagraphBuilder>
skiaParagraphBuilder
;
45
std::vector<flutter::DlPaint>
paints
;
46
};
47
48
struct
Paragraph
{
49
std::unique_ptr<skia::textlayout::Paragraph>
skiaParagraph
;
50
std::vector<flutter::DlPaint>
paints
;
51
};
52
}
// namespace Skwasm
53
54
#endif
// FLUTTER_LIB_WEB_UI_SKWASM_TEXT_TEXT_TYPES_H_
flutter::DlPaint
Definition
dl_paint.h:46
flutter::DlPaint::setColor
DlPaint & setColor(DlColor color)
Definition
dl_paint.h:70
dl_paint.h
Skwasm
Definition
helpers.h:15
Skwasm::ParagraphBuilder
Definition
text_types.h:43
Skwasm::ParagraphBuilder::paints
std::vector< flutter::DlPaint > paints
Definition
text_types.h:45
Skwasm::ParagraphBuilder::skiaParagraphBuilder
std::unique_ptr< skia::textlayout::ParagraphBuilder > skiaParagraphBuilder
Definition
text_types.h:44
Skwasm::Paragraph
Definition
text_types.h:48
Skwasm::Paragraph::skiaParagraph
std::unique_ptr< skia::textlayout::Paragraph > skiaParagraph
Definition
text_types.h:49
Skwasm::Paragraph::paints
std::vector< flutter::DlPaint > paints
Definition
text_types.h:50
Skwasm::ParagraphStyle
Definition
text_types.h:38
Skwasm::ParagraphStyle::textStyle
TextStyle textStyle
Definition
text_types.h:40
Skwasm::ParagraphStyle::skiaParagraphStyle
skia::textlayout::ParagraphStyle skiaParagraphStyle
Definition
text_types.h:39
Skwasm::TextStyle
Definition
text_types.h:16
Skwasm::TextStyle::background
std::optional< flutter::DlPaint > background
Definition
text_types.h:19
Skwasm::TextStyle::foreground
std::optional< flutter::DlPaint > foreground
Definition
text_types.h:18
Skwasm::TextStyle::populatePaintIds
void populatePaintIds(std::vector< flutter::DlPaint > &paints)
Definition
text_types.h:21
Skwasm::TextStyle::skiaStyle
skia::textlayout::TextStyle skiaStyle
Definition
text_types.h:17
flutter::DlColor
Definition
dl_color.h:21
lib
web_ui
skwasm
text
text_types.h
Generated on Thu Nov 6 2025 16:11:25 for Flutter Engine by
1.9.8