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

Unified Diff: src/effects/SkBlurMask.h

Issue 286273002: Optimize CSS box-shadow performance by caching the SkMask of the blur effect. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: rebase with latest skia in git instead of svn trunk Created 6 years, 6 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/effects/SkBlurMask.h
diff --git a/src/effects/SkBlurMask.h b/src/effects/SkBlurMask.h
index 71f60d91faabf5ab6642803f49660ca180119bd7..df695cf2e037c95259a76fd01e872330fb331dc3 100644
--- a/src/effects/SkBlurMask.h
+++ b/src/effects/SkBlurMask.h
@@ -7,6 +7,7 @@
#ifndef SkBlurMask_DEFINED
#define SkBlurMask_DEFINED
+#include <map>
#include "SkBlurTypes.h"
#include "SkShader.h"
@@ -75,8 +76,12 @@ public:
static void ComputeBlurredScanline(uint8_t* pixels, const uint8_t* profile,
unsigned int width, SkScalar sigma);
+ static bool addDiscardableMemoryMaskToMap(SkMask*, SkDiscardableMemoryMask*);
+ static bool removeDiscardableMemoryMaskFromMap(SkMask*);
+ static SkDiscardableMemoryMask* getDiscardableMemoryMaskFromMap(SkMask*);
Stephen White 2014/06/09 18:03:57 Naming nit: similarly, could this be getCachedMask
-
+private:
+ static std::map<SkMask*, SkDiscardableMemoryMask*> fDiscardableMemoryMaskMap;
};

Powered by Google App Engine
This is Rietveld 408576698