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

Unified Diff: src/core/SkMaskCache.h

Issue 471473002: Optimize CSS box-shadow performance (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: store SkMask and SkCachedData in cache Created 6 years, 2 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
Index: src/core/SkMaskCache.h
diff --git a/src/core/SkMaskCache.h b/src/core/SkMaskCache.h
new file mode 100644
index 0000000000000000000000000000000000000000..3fa303fdceaab08a682492058d4143e778041e64
--- /dev/null
+++ b/src/core/SkMaskCache.h
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2014 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef SkMaskCache_DEFINED
+#define SkMaskCache_DEFINED
+
+#include "SkCachedData.h"
+#include "SkMask.h"
+#include "SkRect.h"
+#include "SkRRect.h"
+
+class SkMaskCache {
+public:
+ /**
+ * On success, return a ref to the SkCachedData that holds the pixels, and have mask
+ * already point to that memory.
+ *
+ * On failure, return NULL.
+ */
+ static SkCachedData* FindAndRef(SkScalar sigma, const SkRRect& rrect, SkMask* mask);
+ static void Add(SkScalar sigma, const SkRRect& rrect,
+ const SkMask& mask, SkCachedData* data);
+
+ /**
+ * On success, return a ref to the SkCachedData that holds the pixels, and have mask
+ * already point to that memory.
+ *
+ * On failure, return NULL.
+ */
+ static SkCachedData* FindAndRef(SkScalar sigma, int32_t count,
+ const SkRect rects[], SkMask* mask);
+ static void Add(SkScalar sigma, int32_t count, const SkRect rects[],
+ const SkMask& mask, SkCachedData* data);
+};
+
+#endif

Powered by Google App Engine
This is Rietveld 408576698