Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(708)

Unified Diff: src/core/SkMaskCache.h

Issue 729463002: Cache blur mask for rects which can not break into nine-patch (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: handle clipped path Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/core/SkMaskCache.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkMaskCache.h
diff --git a/src/core/SkMaskCache.h b/src/core/SkMaskCache.h
index f98387b2067dd03745ba2eb9ffaf5cc49d56ff5c..2cfb971dde14a967a8699ad512812759c1736799 100644
--- a/src/core/SkMaskCache.h
+++ b/src/core/SkMaskCache.h
@@ -39,6 +39,25 @@ public:
static void Add(SkScalar sigma, SkBlurStyle style, SkBlurQuality quality,
const SkRect rects[], int count, const SkMask& mask, SkCachedData* data,
SkResourceCache* localCache = NULL);
+
+ /**
+ * On success, set mask with cached value, allocate memory for mask->fImage,
+ * copy pixels from SkCachedData in the cache to mask->fImage, then return true.
+ *
+ * On failure, return false, no memory allocated for mask->fImage.
+ */
+ static bool FindAndCopy(SkScalar sigma, SkBlurStyle style, SkBlurQuality quality,
+ const SkRRect& rrect, SkMask* mask);
+ static bool FindAndCopy(SkScalar sigma, SkBlurStyle style, SkBlurQuality quality,
+ const SkRect rects[], int count, SkMask* mask);
+
+ /**
+ * Create a new SkCachedData, copy pixels from mask.fImage to it, then add it into cache.
+ */
+ static void AddAndCopy(SkScalar sigma, SkBlurStyle style, SkBlurQuality quality,
+ const SkRRect& rrect, const SkMask& mask);
+ static void AddAndCopy(SkScalar sigma, SkBlurStyle style, SkBlurQuality quality,
+ const SkRect rects[], int count, const SkMask& mask);
};
#endif
« no previous file with comments | « no previous file | src/core/SkMaskCache.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698