Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Classes | Typedefs | Enumerations | Functions | Variables
CmapBench.cpp File Reference
#include "bench/Benchmark.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkFont.h"
#include "include/core/SkTypeface.h"
#include "src/base/SkRandom.h"
#include "src/base/SkUTF.h"
#include "src/core/SkFontPriv.h"
#include "src/utils/SkCharToGlyphCache.h"
#include "tools/fonts/FontToolUtils.h"

Go to the source code of this file.

Classes

class  CMAPBench
 

Typedefs

typedef void(* TypefaceProc) (const Rec &r)
 

Enumerations

enum  { NGLYPHS = 100 }
 

Functions

static void textToGlyphs_proc (const Rec &r)
 
static void charsToGlyphs_proc (const Rec &r)
 
static void addcache_proc (const Rec &r)
 
static void findcache_proc (const Rec &r)
 

Variables

constexpr int SMALL = 10
 
constexpr int BIG = 100
 

Typedef Documentation

◆ TypefaceProc

typedef void(* TypefaceProc) (const Rec &r)

Definition at line 32 of file CmapBench.cpp.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
NGLYPHS 

Definition at line 18 of file CmapBench.cpp.

18 {
19 NGLYPHS = 100
20};
@ NGLYPHS
Definition CmapBench.cpp:19

Function Documentation

◆ addcache_proc()

static void addcache_proc ( const Rec r)
static

Definition at line 53 of file CmapBench.cpp.

53 {
54 for (int loop = 0; loop < r.fLoops; ++loop) {
56 for (int i = 0; i < r.fCount; ++i) {
57 cache.addCharAndGlyph(r.fText[i], i);
58 }
59 }
60}
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 to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace Enable an endless trace buffer The default is a ring buffer This is useful when very old events need to viewed For during application launch Memory usage will continue to grow indefinitely however Start app with an specific route defined on the framework flutter assets Path to the Flutter assets directory enable service port Allow the VM service to fallback to automatic port selection if binding to a specified port fails trace Trace early application lifecycle Automatically switches to an endless trace buffer trace skia Filters out all Skia trace event categories except those that are specified in this comma separated list dump skp on shader Automatically dump the skp that triggers new shader compilations This is useful for writing custom ShaderWarmUp to reduce jank By this is not enabled to reduce the overhead purge persistent cache
Definition switches.h:191

◆ charsToGlyphs_proc()

static void charsToGlyphs_proc ( const Rec r)
static

Definition at line 43 of file CmapBench.cpp.

43 {
44 uint16_t glyphs[NGLYPHS];
45 SkASSERT(r.fCount <= NGLYPHS);
46
47 SkTypeface* face = r.fFont.getTypeface();
48 for (int i = 0; i < r.fLoops; ++i) {
49 face->unicharsToGlyphs(r.fText, r.fCount, glyphs);
50 }
51}
uint16_t glyphs[5]
#define SkASSERT(cond)
Definition SkAssert.h:116
void unicharsToGlyphs(const SkUnichar uni[], int count, SkGlyphID glyphs[]) const

◆ findcache_proc()

static void findcache_proc ( const Rec r)
static

Definition at line 62 of file CmapBench.cpp.

62 {
63 for (int loop = 0; loop < r.fLoops; ++loop) {
64 for (int i = 0; i < r.fCount; ++i) {
65 r.fCache.findGlyphIndex(r.fText[i]);
66 }
67 }
68}

◆ textToGlyphs_proc()

static void textToGlyphs_proc ( const Rec r)
static

Definition at line 34 of file CmapBench.cpp.

34 {
35 uint16_t glyphs[NGLYPHS];
36 SkASSERT(r.fCount <= NGLYPHS);
37
38 for (int i = 0; i < r.fLoops; ++i) {
39 r.fFont.textToGlyphs(r.fText, r.fCount*4, SkTextEncoding::kUTF32, glyphs, NGLYPHS);
40 }
41}
@ kUTF32
uses four byte words to represent all of Unicode

Variable Documentation

◆ BIG

constexpr int BIG = 100
constexpr

Definition at line 121 of file CmapBench.cpp.

◆ SMALL

constexpr int SMALL = 10
constexpr

Definition at line 114 of file CmapBench.cpp.