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/SkPicture.h

Issue 741793002: Add SkNVRefCnt, prune down SkPicture's size (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: tweak name Created 6 years, 1 month 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 | « gm/gmmain.cpp ('k') | include/core/SkRefCnt.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkPicture.h
diff --git a/include/core/SkPicture.h b/include/core/SkPicture.h
index eee1ea840141bf5145e93893ad1824eb1aa38512..dc522a5c9d9229c771041e5c7a1c98bd0fdfc3da 100644
--- a/include/core/SkPicture.h
+++ b/include/core/SkPicture.h
@@ -40,10 +40,8 @@ namespace SkRecords {
The SkPicture class records the drawing commands made to a canvas, to
be played back at a later time.
*/
-class SK_API SkPicture : public SkRefCnt {
+class SK_API SkPicture : public SkNVRefCnt<SkPicture> {
public:
- SK_DECLARE_INST_COUNT(SkPicture)
-
// AccelData provides a base class for device-specific acceleration
// data. It is added to the picture via EXPERIMENTAL_addAccelData.
class AccelData : public SkRefCnt {
@@ -60,8 +58,6 @@ public:
static Domain GenerateDomain();
private:
Key fKey;
-
- typedef SkRefCnt INHERITED;
};
/** PRIVATE / EXPERIMENTAL -- do not call */
@@ -104,7 +100,7 @@ public:
*/
static SkPicture* CreateFromBuffer(SkReadBuffer&);
- virtual ~SkPicture();
+ ~SkPicture();
/** Replays the drawing commands on the specified canvas. Note that
this has the effect of unfurling this picture into the destination
@@ -267,6 +263,8 @@ private:
static SkPictureData* Backport(const SkRecord&, const SkPictInfo&,
SkPicture const* const drawablePics[], int drawableCount);
+ // uint32_t fRefCnt; from SkNVRefCnt<SkPicture>
+ mutable uint32_t fUniqueID;
const SkRect fCullRect;
mutable SkAutoTUnref<const AccelData> fAccelData;
mutable SkTDArray<DeletionListener*> fDeletionListeners; // pointers are refed
@@ -295,14 +293,12 @@ private:
int fNumAAHairlineConcavePaths;
int fNumAADFEligibleConcavePaths;
} fAnalysis;
- mutable uint32_t fUniqueID;
friend class SkPictureRecorder; // SkRecord-based constructor.
friend class GrLayerHoister; // access to fRecord
friend class ReplaceDraw;
friend class SkPictureUtils;
-
- typedef SkRefCnt INHERITED;
};
+SK_COMPILE_ASSERT(sizeof(SkPicture) <= 96, SkPictureSize);
#endif
« no previous file with comments | « gm/gmmain.cpp ('k') | include/core/SkRefCnt.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698