8#ifndef SkStrikeCache_DEFINED
9#define SkStrikeCache_DEFINED
31#ifndef SK_DEFAULT_FONT_CACHE_COUNT_LIMIT
32 #define SK_DEFAULT_FONT_CACHE_COUNT_LIMIT 2048
35#ifndef SK_DEFAULT_FONT_CACHE_LIMIT
36 #define SK_DEFAULT_FONT_CACHE_LIMIT (2 * 1024 * 1024)
52 std::unique_ptr<SkStrikePinner> =
nullptr)
SK_EXCLUDES(fLock);
79 static constexpr
char kGlyphCacheDumpName[] = "
skia/sk_glyph_cache";
93 size_t internalPurge(
size_t minBytesNeeded = 0,
bool checkPinners =
false)
SK_REQUIRES(fLock);
100 mutable SkMutex fLock;
101 SkStrike* fHead SK_GUARDED_BY(fLock) {
nullptr};
102 SkStrike* fTail SK_GUARDED_BY(fLock) {
nullptr};
103 struct StrikeTraits {
108 SK_GUARDED_BY(fLock);
111 size_t fTotalMemoryUsed SK_GUARDED_BY(fLock) {0};
113 int32_t fCacheCount SK_GUARDED_BY(fLock) {0};
114 int32_t fPinnerCount SK_GUARDED_BY(fLock) {0};
#define SK_DEFAULT_FONT_CACHE_LIMIT
#define SK_DEFAULT_FONT_CACHE_COUNT_LIMIT
static void dump(const float m[20], SkYUVColorSpace cs, bool rgb2yuv)
static void DumpMemoryStatistics(SkTraceMemoryDump *dump)
size_t getCacheSizeLimit() const SK_EXCLUDES(fLock)
size_t setCacheSizeLimit(size_t limit) SK_EXCLUDES(fLock)
int setCacheCountLimit(int limit) SK_EXCLUDES(fLock)
sk_sp< SkStrike > createStrike(const SkStrikeSpec &strikeSpec, SkFontMetrics *maybeMetrics=nullptr, std::unique_ptr< SkStrikePinner >=nullptr) SK_EXCLUDES(fLock)
sk_sp< SkStrike > findOrCreateStrike(const SkStrikeSpec &strikeSpec) SK_EXCLUDES(fLock)
sk_sp< SkStrike > findStrike(const SkDescriptor &desc) SK_EXCLUDES(fLock)
void purgePinned(size_t minBytesNeeded=0) SK_EXCLUDES(fLock)
void purgeAll() SK_EXCLUDES(fLock)
sk_sp< sktext::StrikeForGPU > findOrCreateScopedStrike(const SkStrikeSpec &strikeSpec) override SK_EXCLUDES(fLock)
int getCacheCountLimit() const SK_EXCLUDES(fLock)
size_t getTotalMemoryUsed() const SK_EXCLUDES(fLock)
int getCacheCountUsed() const SK_EXCLUDES(fLock)
static SkStrikeCache * GlobalStrikeCache()
Dart_NativeFunction function
static uint32_t Hash(uint32_t key)