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

Public Member Functions

 SkGlyphCacheBasic (size_t cacheSize)
 
- 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 onDraw (int loops, SkCanvas *) 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 47 of file SkGlyphCacheBench.cpp.

Constructor & Destructor Documentation

◆ SkGlyphCacheBasic()

SkGlyphCacheBasic::SkGlyphCacheBasic ( size_t  cacheSize)
inlineexplicit

Definition at line 49 of file SkGlyphCacheBench.cpp.

49: fCacheSize(cacheSize) { }

Member Function Documentation

◆ isSuitableFor()

bool SkGlyphCacheBasic::isSuitableFor ( Backend  backend)
inlineoverrideprotectedvirtual

Reimplemented from Benchmark.

Definition at line 57 of file SkGlyphCacheBench.cpp.

57 {
59 }
const char * backend

◆ onDraw()

void SkGlyphCacheBasic::onDraw ( int  loops,
SkCanvas  
)
inlineoverrideprotectedvirtual

Implements Benchmark.

Definition at line 61 of file SkGlyphCacheBench.cpp.

61 {
62 size_t oldCacheLimitSize = SkGraphics::GetFontCacheLimit();
66 font.setSubpixel(true);
68
69 for (int work = 0; work < loops; work++) {
71 }
72 SkGraphics::SetFontCacheLimit(oldCacheLimitSize);
73 }
static void do_font_stuff(SkFont *font)
static constexpr SkFontStyle Italic()
Definition: SkFontStyle.h:72
Definition: SkFont.h:35
@ kAntiAlias
may have transparent pixels on glyph edges
static size_t GetFontCacheLimit()
Definition: SkGraphics.cpp:48
static size_t SetFontCacheLimit(size_t bytes)
Definition: SkGraphics.cpp:52
sk_sp< SkTypeface > CreatePortableTypeface(const char *name, SkFontStyle style)
SkFont DefaultFont()
font
Font Metadata and Metrics.

◆ onGetName()

const char * SkGlyphCacheBasic::onGetName ( )
inlineoverrideprotectedvirtual

Implements Benchmark.

Definition at line 52 of file SkGlyphCacheBench.cpp.

52 {
53 fName.printf("SkGlyphCacheBasic%dK", (int)(fCacheSize >> 10));
54 return fName.c_str();
55 }
void printf(const char format[],...) SK_PRINTF_LIKE(2
Definition: SkString.cpp:534
const char * c_str() const
Definition: SkString.h:133

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