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

Unified Diff: include/core/SkCanvas.h

Issue 1060583007: reduce alloc overhead for SkCanvas (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 8 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/SkCanvas.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkCanvas.h
diff --git a/include/core/SkCanvas.h b/include/core/SkCanvas.h
index 8df29893ff9cf3574d28e86bc27a87409ce345c1..1dbca3a0a286448f25ed0c40a3ff6a8d00ce2f46 100644
--- a/include/core/SkCanvas.h
+++ b/include/core/SkCanvas.h
@@ -1089,7 +1089,7 @@ public:
* @return the current clip stack ("list" of individual clip elements)
*/
const SkClipStack* getClipStack() const {
- return fClipStack;
+ return &fClipStack;
}
typedef SkCanvasClipVisitor ClipVisitor;
@@ -1251,12 +1251,18 @@ protected:
private:
class MCRec;
- SkAutoTUnref<SkClipStack> fClipStack;
+ SkClipStack fClipStack;
SkDeque fMCStack;
// points to top of stack
MCRec* fMCRec;
// the first N recs that can fit here mean we won't call malloc
- uint32_t fMCRecStorage[32];
+ enum {
+ kMCRecSize = 128, // most recent measurement
+ kMCRecCount = 8, // common depth for save/restores
+ };
+ intptr_t fMCRecStorage[kMCRecSize * kMCRecCount / sizeof(intptr_t)];
+ // for our base DeviceCM
+ intptr_t fBaseLayerStorage[kMCRecSize / sizeof(intptr_t)];
const SkSurfaceProps fProps;
« no previous file with comments | « no previous file | src/core/SkCanvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698