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

Public Member Functions

 FontCacheEfficiency ()
 
- 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
 
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 102 of file FontCacheBench.cpp.

Constructor & Destructor Documentation

◆ FontCacheEfficiency()

FontCacheEfficiency::FontCacheEfficiency ( )
inline

Definition at line 104 of file FontCacheBench.cpp.

104 {
105 if ((false)) dump_array(nullptr, 0);
106 if ((false)) rotr(0, 0);
107 }
static void dump_array(const uint16_t array[], int count)
static uint32_t rotr(uint32_t value, unsigned bits)

Member Function Documentation

◆ onDraw()

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

Implements Benchmark.

Definition at line 114 of file FontCacheBench.cpp.

114 {
115 static bool gDone;
116 if (gDone) {
117 return;
118 }
119 gDone = true;
120
121 for (int hashBits = 6; hashBits <= 12; hashBits += 1) {
122 int hashMask = ((1 << hashBits) - 1);
123 for (int limit = 32; limit <= 1024; limit <<= 1) {
124 for (size_t i = 0; i < std::size(gRec); ++i) {
125 int collisions = 0;
126 int glyphs = 0;
127 const uint16_t* array = gUniqueGlyphIDs;
128 while (*array != gUniqueGlyphIDs_Sentinel) {
129 int count = std::min(count_glyphs(array), limit);
130 collisions += count_collisions(array, count, gRec[i].fHasher, hashMask);
131 glyphs += count;
132 array += count + 1; // skip the sentinel
133 }
134 SkDebugf("hashBits [%d] limit [%d] collisions [%d / %d = %1.2g%%] using %s\n", hashBits, limit, collisions, glyphs,
135 collisions * 100.0 / glyphs, gRec[i].fName);
136 }
137 }
138 }
139 }
HasherProc fHasher
static int count_glyphs(const uint16_t start[])
static int count_collisions(const uint16_t array[], int count, HasherProc proc, unsigned hashMask)
const char * fName
static const struct @223 gRec[]
#define gUniqueGlyphIDs_Sentinel
uint16_t glyphs[5]
Definition: FontMgrTest.cpp:46
int count
Definition: FontMgrTest.cpp:50
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
static const uint16_t gUniqueGlyphIDs[]
static float min(float r, float g, float b)
Definition: hsl.cpp:48
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

◆ onGetName()

const char * FontCacheEfficiency::onGetName ( )
inlineoverrideprotectedvirtual

Implements Benchmark.

Definition at line 110 of file FontCacheBench.cpp.

110 {
111 return "fontefficiency";
112 }

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