From c6ad9eefa0f8d0c2ede9884b446c65dde9b04dd1 Mon Sep 17 00:00:00 2001 From: mtklein Date: Mon, 17 Nov 2014 06:45:18 -0800 Subject: More SkPicture cleanup - move field declarations together and pack them a little tighter - get rid of fData - remove dead code in debugger, including unused SkPicturePlayback subclass There are now no more long-lived SkPictureData! (Really, there never were, but now we don't pretend to support them.) BUG=skia: No API changes. TBR=reed@google.com Review URL: https://codereview.chromium.org/725143002 --- include/core/SkPicture.h | 47 ++++++++++++++++------------------------------- 1 file changed, 16 insertions(+), 31 deletions(-) (limited to 'include/core') diff --git a/include/core/SkPicture.h b/include/core/SkPicture.h index 4bef2b0d2f..c4c6f20326 100644 --- a/include/core/SkPicture.h +++ b/include/core/SkPicture.h @@ -24,7 +24,6 @@ class SkBBoxHierarchy; class SkCanvas; class SkData; class SkPictureData; -class SkPictureRecord; class SkStream; class SkWStream; @@ -254,47 +253,24 @@ private: static const uint32_t MIN_PICTURE_VERSION = 19; static const uint32_t CURRENT_PICTURE_VERSION = 37; - mutable uint32_t fUniqueID; - - SkAutoTDelete fData; - const SkScalar fCullWidth; - const SkScalar fCullHeight; - mutable SkAutoTUnref fAccelData; - - mutable SkTDArray fDeletionListeners; // pointers are refed - void needsNewGenID() { fUniqueID = SK_InvalidGenID; } void callDeletionListeners(); - // Create a new SkPicture from an existing SkPictureData. The new picture - // takes ownership of 'data'. - SkPicture(SkPictureData* data, SkScalar width, SkScalar height); - - SkPicture(SkScalar width, SkScalar height, const SkPictureRecord& record, bool deepCopyOps); - void createHeader(SkPictInfo* info) const; static bool IsValidPictInfo(const SkPictInfo& info); - friend class SkPictureRecorder; // SkRecord-based constructor. - friend class SkGpuDevice; // for fData access - friend class GrLayerHoister; // access to fRecord - friend class SkPicturePlayback; // to get fData - friend class ReplaceDraw; - - typedef SkRefCnt INHERITED; - // Takes ownership of the SkRecord, refs the (optional) BBH. SkPicture(SkScalar width, SkScalar height, SkRecord*, SkBBoxHierarchy*); - // Return as a new SkPicture that's backed by SkRecord. - static SkPicture* Forwardport(const SkPicture&); - // Return as a new SkPicture that's backed by the old backend. - static SkPicture* Backport(const SkRecord& src, const SkRect& cullRect); + static SkPicture* Forwardport(const SkPictInfo&, const SkPictureData*); + static SkPictureData* Backport(const SkRecord&, const SkPictInfo&); + + const SkScalar fCullWidth; + const SkScalar fCullHeight; + mutable SkAutoTUnref fAccelData; + mutable SkTDArray fDeletionListeners; // pointers are refed SkAutoTDelete fRecord; SkAutoTUnref fBBH; - - struct PathCounter; - struct Analysis { Analysis() {} // Only used by SkPictureData codepath. explicit Analysis(const SkRecord&); @@ -309,6 +285,15 @@ private: int fNumAAHairlineConcavePaths; int fNumAADFEligibleConcavePaths; } fAnalysis; + mutable uint32_t fUniqueID; + + struct PathCounter; + + friend class SkPictureRecorder; // SkRecord-based constructor. + friend class GrLayerHoister; // access to fRecord + friend class ReplaceDraw; + + typedef SkRefCnt INHERITED; }; #endif -- cgit v1.2.3