Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
SkMaskCache Class Reference

#include <SkMaskCache.h>

Static Public Member Functions

static SkCachedDataFindAndRef (SkScalar sigma, SkBlurStyle style, const SkRRect &rrect, SkTLazy< SkMask > *mask, SkResourceCache *localCache=nullptr)
 
static SkCachedDataFindAndRef (SkScalar sigma, SkBlurStyle style, const SkRect rects[], int count, SkTLazy< SkMask > *mask, SkResourceCache *localCache=nullptr)
 
static void Add (SkScalar sigma, SkBlurStyle style, const SkRRect &rrect, const SkMask &mask, SkCachedData *data, SkResourceCache *localCache=nullptr)
 
static void Add (SkScalar sigma, SkBlurStyle style, const SkRect rects[], int count, const SkMask &mask, SkCachedData *data, SkResourceCache *localCache=nullptr)
 

Detailed Description

Definition at line 21 of file SkMaskCache.h.

Member Function Documentation

◆ Add() [1/2]

void SkMaskCache::Add ( SkScalar  sigma,
SkBlurStyle  style,
const SkRect  rects[],
int  count,
const SkMask mask,
SkCachedData data,
SkResourceCache localCache = nullptr 
)
static

Definition at line 192 of file SkMaskCache.cpp.

194 {
195 RectsBlurKey key(sigma, style, rects, count);
196 return CHECK_LOCAL(localCache, add, Add, new RectsBlurRec(key, mask, data));
197}
int count
#define CHECK_LOCAL(localCache, localName, globalName,...)
static void Add(SkScalar sigma, SkBlurStyle style, const SkRRect &rrect, const SkMask &mask, SkCachedData *data, SkResourceCache *localCache=nullptr)

◆ Add() [2/2]

void SkMaskCache::Add ( SkScalar  sigma,
SkBlurStyle  style,
const SkRRect rrect,
const SkMask mask,
SkCachedData data,
SkResourceCache localCache = nullptr 
)
static

Add a mask and its pixel-data to the cache.

Definition at line 102 of file SkMaskCache.cpp.

104 {
105 RRectBlurKey key(sigma, rrect, style);
106 return CHECK_LOCAL(localCache, add, Add, new RRectBlurRec(key, mask, data));
107}

◆ FindAndRef() [1/2]

SkCachedData * SkMaskCache::FindAndRef ( SkScalar  sigma,
SkBlurStyle  style,
const SkRect  rects[],
int  count,
SkTLazy< SkMask > *  mask,
SkResourceCache localCache = nullptr 
)
static

Definition at line 178 of file SkMaskCache.cpp.

180 {
182 RectsBlurKey key(sigma, style, rects, count);
183 if (!CHECK_LOCAL(localCache, find, Find, key, RectsBlurRec::Visitor, &result)) {
184 return nullptr;
185 }
186
187 mask->init(static_cast<const uint8_t*>(result->fData->data()),
188 result->fMask.fBounds, result->fMask.fRowBytes, result->fMask.fFormat);
189 return result->fData;
190}
int find(T *array, int N, T item)
T * init(Args &&... args)
Definition SkTLazy.h:45
GAsyncResult * result

◆ FindAndRef() [2/2]

SkCachedData * SkMaskCache::FindAndRef ( SkScalar  sigma,
SkBlurStyle  style,
const SkRRect rrect,
SkTLazy< SkMask > *  mask,
SkResourceCache localCache = nullptr 
)
static

On success, return a ref to the SkCachedData that holds the pixels, and have mask already point to that memory.

On failure, return nullptr.

Definition at line 88 of file SkMaskCache.cpp.

90 {
92 RRectBlurKey key(sigma, rrect, style);
93 if (!CHECK_LOCAL(localCache, find, Find, key, RRectBlurRec::Visitor, &result)) {
94 return nullptr;
95 }
96
97 mask->init(static_cast<const uint8_t*>(result->fData->data()),
98 result->fMask.fBounds, result->fMask.fRowBytes, result->fMask.fFormat);
99 return result->fData;
100}

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