Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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 makeStyle ()
 
sk_sp< DisplayListdraw (txt::TextStyle style) const
 

Detailed Description

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

Definition at line 69 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 97 of file paragraph_unittests.cc.

97 {
98 auto pb_skia = makeParagraphBuilder();
99 pb_skia.PushStyle(style);
100 pb_skia.AddText(u"Hello World!");
101 pb_skia.Pop();
102
103 auto builder = DisplayListBuilder();
104 auto paragraph = pb_skia.Build();
105 paragraph->Layout(10000);
106 paragraph->Paint(&builder, 0, 0);
107
108 return builder.Build();
109 }

◆ makeDecoratedStyle()

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

Definition at line 76 of file paragraph_unittests.cc.

76 {
77 auto t_style = txt::TextStyle();
78 t_style.color = SK_ColorBLACK; // default
79 t_style.font_weight = txt::FontWeight::w400; // normal
80 t_style.font_size = 14; // default
81 t_style.decoration = txt::TextDecoration::kUnderline;
82 t_style.decoration_style = style;
83 t_style.decoration_color = SK_ColorBLACK;
84 t_style.font_families.push_back("ahem");
85 return t_style;
86 }
constexpr SkColor SK_ColorBLACK
Definition SkColor.h:103

◆ makeStyle()

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

Definition at line 88 of file paragraph_unittests.cc.

88 {
89 auto t_style = txt::TextStyle();
90 t_style.color = SK_ColorBLACK; // default
91 t_style.font_weight = txt::FontWeight::w400; // normal
92 t_style.font_size = 14; // default
93 t_style.font_families.push_back("ahem");
94 return t_style;
95 }

◆ PretendImpellerIsEnabled()

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

Definition at line 73 of file paragraph_unittests.cc.

73{ 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: