Flutter Engine
The Flutter Engine
Classes | Public Member Functions | List of all members
sktext::gpu::StrikeCache Class Reference

#include <StrikeCache.h>

Public Member Functions

 ~StrikeCache ()
 
sk_sp< TextStrikefindOrCreateStrike (const SkStrikeSpec &strikeSpec)
 
void freeAll ()
 

Detailed Description

Definition at line 55 of file StrikeCache.h.

Constructor & Destructor Documentation

◆ ~StrikeCache()

sktext::gpu::StrikeCache::~StrikeCache ( )

Definition at line 26 of file StrikeCache.cpp.

26 {
27 this->freeAll();
28}

Member Function Documentation

◆ findOrCreateStrike()

sk_sp< TextStrike > sktext::gpu::StrikeCache::findOrCreateStrike ( const SkStrikeSpec strikeSpec)

Definition at line 34 of file StrikeCache.cpp.

34 {
35 if (sk_sp<TextStrike>* cached = fCache.find(strikeSpec.descriptor())) {
36 return *cached;
37 }
38 return this->generateStrike(strikeSpec);
39}
const SkDescriptor & descriptor() const
Definition: SkStrikeSpec.h:96
T * find(const K &key) const
Definition: SkTHash.h:107

◆ freeAll()

void sktext::gpu::StrikeCache::freeAll ( )

Definition at line 30 of file StrikeCache.cpp.

30 {
31 fCache.reset();
32}

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