25#define CHECK_LOCAL(localCache, localName, globalName, ...) \
26 ((localCache) ? localCache->localName(__VA_ARGS__) : SkResourceCache::globalName(__VA_ARGS__))
34static unsigned gRRectBlurKeyNamespaceLabel;
43 this->
init(&gRRectBlurKeyNamespaceLabel, 0,
56 fValue.fData->attachToCacheAndRef();
58 ~RRectBlurRec()
override {
59 fValue.fData->detachFromCacheAndUnref();
65 const Key&
getKey()
const override {
return fKey; }
67 const char*
getCategory()
const override {
return "rrect-blur"; }
73 const RRectBlurRec& rec =
static_cast<const RRectBlurRec&
>(baseRec);
78 if (
nullptr == tmpData->
data()) {
92 RRectBlurKey
key(sigma,
rrect, style);
97 mask->
init(
static_cast<const uint8_t*
>(
result->fData->data()),
105 RRectBlurKey
key(sigma,
rrect, style);
112static unsigned gRectsBlurKeyNamespaceLabel;
126 fSizes[2] =
SkSize{rects[0].
x() - rects[1].
x(), rects[0].
y() - rects[1].
y()};
131 fSizes[3] =
SkSize{rects[0].
x() - ir.
x(), rects[0].
y() - ir.
y()};
133 this->
init(&gRectsBlurKeyNamespaceLabel, 0,
134 sizeof(fSigma) +
sizeof(
fStyle) +
sizeof(fSizes));
148 ~RectsBlurRec()
override {
155 const Key&
getKey()
const override {
return fKey; }
157 const char*
getCategory()
const override {
return "rects-blur"; }
163 const RectsBlurRec& rec =
static_cast<const RectsBlurRec&
>(baseRec);
168 if (
nullptr == tmpData->data()) {
182 RectsBlurKey
key(sigma, style, rects,
count);
187 mask->
init(
static_cast<const uint8_t*
>(
result->fData->data()),
195 RectsBlurKey
key(sigma, style, rects,
count);
SkStrokeRec::Style fStyle
#define CHECK_LOCAL(localCache, localName, globalName,...)
int find(T *array, int N, T item)
void detachFromCacheAndUnref() const
void attachToCacheAndRef() const
SkDiscardableMemory * diagnostic_only_getDiscardable() const
const void * data() const
static void Add(SkScalar sigma, SkBlurStyle style, const SkRRect &rrect, const SkMask &mask, SkCachedData *data, SkResourceCache *localCache=nullptr)
static SkCachedData * FindAndRef(SkScalar sigma, SkBlurStyle style, const SkRRect &rrect, SkTLazy< SkMask > *mask, SkResourceCache *localCache=nullptr)
void(* Visitor)(const Rec &, void *context)
T * init(Args &&... args)
Visitor(Ts...) -> Visitor< Ts... >
constexpr int32_t x() const
constexpr int32_t y() const
constexpr float x() const
constexpr float y() const
void roundOut(SkIRect *dst) const
constexpr float height() const
constexpr float width() const
void init(void *nameSpace, uint64_t sharedID, size_t dataSize)
virtual const char * getCategory() const =0
virtual SkDiscardableMemory * diagnostic_only_getDiscardable() const
virtual size_t bytesUsed() const =0
virtual const Key & getKey() const =0
std::shared_ptr< const fml::Mapping > data