Flutter Engine
The Flutter Engine
Public Member Functions | Protected Member Functions | List of all members
FontPathBench Class Reference
Inheritance diagram for FontPathBench:
Benchmark SkRefCnt SkRefCntBase

Public Member Functions

 FontPathBench (bool oneAtATime)
 
- Public Member Functions inherited from Benchmark
 Benchmark ()
 
const char * getName ()
 
const char * getUniqueName ()
 
SkISize getSize ()
 
virtual bool isSuitableFor (Backend backend)
 
virtual void modifyGrContextOptions (GrContextOptions *)
 
virtual bool shouldLoop () const
 
void delayedSetup ()
 
void perCanvasPreDraw (SkCanvas *)
 
void perCanvasPostDraw (SkCanvas *)
 
void preDraw (SkCanvas *)
 
void postDraw (SkCanvas *)
 
void draw (int loops, SkCanvas *)
 
virtual void getGpuStats (SkCanvas *, skia_private::TArray< SkString > *keys, skia_private::TArray< double > *values)
 
virtual bool getDMSAAStats (GrRecordingContext *)
 
int getUnits () const
 
- Public Member Functions inherited from SkRefCntBase
 SkRefCntBase ()
 
virtual ~SkRefCntBase ()
 
bool unique () const
 
void ref () const
 
void unref () const
 

Protected Member Functions

const char * onGetName () override
 
bool isSuitableFor (Backend backend) override
 
void onDelayedSetup () override
 
void onDraw (int loops, SkCanvas *canvas) override
 
- Protected Member Functions inherited from Benchmark
void setUnits (int units)
 
virtual void setupPaint (SkPaint *paint)
 
virtual const char * onGetName ()=0
 
virtual const char * onGetUniqueName ()
 
virtual void onDelayedSetup ()
 
virtual void onPerCanvasPreDraw (SkCanvas *)
 
virtual void onPerCanvasPostDraw (SkCanvas *)
 
virtual void onPreDraw (SkCanvas *)
 
virtual void onPostDraw (SkCanvas *)
 
virtual void onDraw (int loops, SkCanvas *)=0
 
virtual SkISize onGetSize ()
 

Additional Inherited Members

- Public Types inherited from Benchmark
enum class  Backend {
  kNonRendering , kRaster , kGanesh , kGraphite ,
  kPDF , kHWUI
}
 

Detailed Description

Definition at line 151 of file FontCacheBench.cpp.

Constructor & Destructor Documentation

◆ FontPathBench()

FontPathBench::FontPathBench ( bool  oneAtATime)
inline

Definition at line 158 of file FontCacheBench.cpp.

158 : fOneAtATime(oneAtATime) {
159 fName.printf("font-path-%s", oneAtATime ? "loop" : "batch");
160 }
void printf(const char format[],...) SK_PRINTF_LIKE(2
Definition: SkString.cpp:534

Member Function Documentation

◆ isSuitableFor()

bool FontPathBench::isSuitableFor ( Backend  backend)
inlineoverrideprotectedvirtual

Reimplemented from Benchmark.

Definition at line 167 of file FontCacheBench.cpp.

167 {
169 }
const char * backend

◆ onDelayedSetup()

void FontPathBench::onDelayedSetup ( )
inlineoverrideprotectedvirtual

Reimplemented from Benchmark.

Definition at line 171 of file FontCacheBench.cpp.

171 {
172 fFont.setSize(32);
173 for (size_t i = 0; i < std::size(fGlyphs); ++i) {
174 fGlyphs[i] = i;
175 }
176 }
void setSize(SkScalar textSize)
Definition: SkFont.cpp:129
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 size
Definition: switches.h:259

◆ onDraw()

void FontPathBench::onDraw ( int  loops,
SkCanvas canvas 
)
inlineoverrideprotectedvirtual

Implements Benchmark.

Definition at line 178 of file FontCacheBench.cpp.

178 {
179 SkPath path;
180 for (int loop = 0; loop < loops; ++loop) {
181 if (fOneAtATime) {
182 for (size_t i = 0; i < std::size(fGlyphs); ++i) {
183 fFont.getPath(fGlyphs[i], &path);
184 }
185 } else {
186 fFont.getPaths(fGlyphs, std::size(fGlyphs),
187 [](const SkPath* src, const SkMatrix& mx, void* ctx) {
188 if (src) {
189 src->transform(mx, static_cast<SkPath*>(ctx));
190 }
191 }, &path);
192 }
193 }
194 }
bool getPath(SkGlyphID glyphID, SkPath *path) const
Definition: SkFont.cpp:300
void getPaths(const SkGlyphID glyphIDs[], int count, void(*glyphPathProc)(const SkPath *pathOrNull, const SkMatrix &mx, void *ctx), void *ctx) const
Definition: SkFont.cpp:285
Definition: SkPath.h:59
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
Definition: switches.h:57

◆ onGetName()

const char * FontPathBench::onGetName ( )
inlineoverrideprotectedvirtual

Implements Benchmark.

Definition at line 163 of file FontCacheBench.cpp.

163 {
164 return fName.c_str();
165 }
const char * c_str() const
Definition: SkString.h:133

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