Flutter Engine
The Flutter Engine
Public Member Functions | Protected Member Functions | List of all members
flutter::testing::PainterTestBase< T > Class Template Reference
Inheritance diagram for flutter::testing::PainterTestBase< T >:
flutter::testing::CanvasTestBase< T >

Public Member Functions

 PainterTestBase ()=default
 
void PretendImpellerIsEnabled (bool impeller)
 
- Public Member Functions inherited from flutter::testing::CanvasTestBase< T >
 CanvasTestBase ()=default
 
MockCanvasmock_canvas ()
 
sk_sp< SkColorSpacemock_color_space ()
 

Protected Member Functions

txt::TextStyle makeDecoratedStyle (txt::TextDecorationStyle style)
 
txt::TextStyle makeEmoji ()
 
txt::TextStyle makeStyle ()
 
sk_sp< DisplayListdrawText (txt::TextStyle style, std::u16string text) const
 
sk_sp< DisplayListdraw (txt::TextStyle style) const
 

Detailed Description

template<typename T>
class flutter::testing::PainterTestBase< T >

Definition at line 89 of file paragraph_unittests.cc.

Constructor & Destructor Documentation

◆ PainterTestBase()

template<typename T >
flutter::testing::PainterTestBase< T >::PainterTestBase ( )
default

Member Function Documentation

◆ draw()

template<typename T >
sk_sp< DisplayList > flutter::testing::PainterTestBase< T >::draw ( txt::TextStyle  style) const
inlineprotected

Definition at line 140 of file paragraph_unittests.cc.

140 {
141 auto pb_skia = makeParagraphBuilder();
142 pb_skia.PushStyle(style);
143 pb_skia.AddText(u"Hello World!");
144 pb_skia.Pop();
145
146 auto builder = DisplayListBuilder();
147 auto paragraph = pb_skia.Build();
148 paragraph->Layout(10000);
149 paragraph->Paint(&builder, 0, 0);
150
151 return builder.Build();
152 }

◆ drawText()

template<typename T >
sk_sp< DisplayList > flutter::testing::PainterTestBase< T >::drawText ( txt::TextStyle  style,
std::u16string  text 
) const
inlineprotected

Definition at line 126 of file paragraph_unittests.cc.

126 {
127 auto pb_skia = makeParagraphBuilder();
128 pb_skia.PushStyle(style);
129 pb_skia.AddText(text);
130 pb_skia.Pop();
131
132 auto builder = DisplayListBuilder();
133 auto paragraph = pb_skia.Build();
134 paragraph->Layout(10000);
135 paragraph->Paint(&builder, 0, 0);
136
137 return builder.Build();
138 }
std::u16string text

◆ makeDecoratedStyle()

template<typename T >
txt::TextStyle flutter::testing::PainterTestBase< T >::makeDecoratedStyle ( txt::TextDecorationStyle  style)
inlineprotected

Definition at line 96 of file paragraph_unittests.cc.

96 {
97 auto t_style = txt::TextStyle();
98 t_style.color = SK_ColorBLACK; // default
99 t_style.font_weight = txt::FontWeight::w400; // normal
100 t_style.font_size = 14; // default
101 t_style.decoration = txt::TextDecoration::kUnderline;
102 t_style.decoration_style = style;
103 t_style.decoration_color = SK_ColorBLACK;
104 t_style.font_families.push_back("ahem");
105 return t_style;
106 }
constexpr SkColor SK_ColorBLACK
Definition: SkColor.h:103

◆ makeEmoji()

template<typename T >
txt::TextStyle flutter::testing::PainterTestBase< T >::makeEmoji ( )
inlineprotected

Definition at line 108 of file paragraph_unittests.cc.

108 {
109 auto t_style = txt::TextStyle();
110 t_style.color = SK_ColorBLACK; // default
111 t_style.font_weight = txt::FontWeight::w400; // normal
112 t_style.font_size = 14; // default
113 t_style.font_families.push_back(kEmojiFontName);
114 return t_style;
115 }
static const std::string kEmojiFontName

◆ makeStyle()

template<typename T >
txt::TextStyle flutter::testing::PainterTestBase< T >::makeStyle ( )
inlineprotected

Definition at line 117 of file paragraph_unittests.cc.

117 {
118 auto t_style = txt::TextStyle();
119 t_style.color = SK_ColorBLACK; // default
120 t_style.font_weight = txt::FontWeight::w400; // normal
121 t_style.font_size = 14; // default
122 t_style.font_families.push_back("ahem");
123 return t_style;
124 }

◆ PretendImpellerIsEnabled()

template<typename T >
void flutter::testing::PainterTestBase< T >::PretendImpellerIsEnabled ( bool  impeller)
inline

Definition at line 93 of file paragraph_unittests.cc.

93{ impeller_ = impeller; }
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap The size limit in megabytes for the Dart VM old gen heap space enable impeller
Definition: switches.h:266

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