aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core
diff options
context:
space:
mode:
authorGravatar mtklein <mtklein@chromium.org>2014-11-17 06:45:18 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2014-11-17 06:45:18 -0800
commitc6ad9eefa0f8d0c2ede9884b446c65dde9b04dd1 (patch)
tree9cb417cf39f9ce8e563fbdb5050547968cf16a4d /include/core
parent21c771b3fc827fa4d3e3ca337385870b50b81ff6 (diff)
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
Diffstat (limited to 'include/core')
-rw-r--r--include/core/SkPicture.h47
1 files changed, 16 insertions, 31 deletions
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<const SkPictureData> fData;
- const SkScalar fCullWidth;
- const SkScalar fCullHeight;
- mutable SkAutoTUnref<const AccelData> fAccelData;
-
- mutable SkTDArray<DeletionListener*> 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<const AccelData> fAccelData;
+ mutable SkTDArray<DeletionListener*> fDeletionListeners; // pointers are refed
SkAutoTDelete<SkRecord> fRecord;
SkAutoTUnref<SkBBoxHierarchy> 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