From 98b8485a4cc911420e20af2670d21a5478a06264 Mon Sep 17 00:00:00 2001 From: mtklein Date: Tue, 21 Apr 2015 15:23:59 -0700 Subject: O(1) SkPictureUtils::ApproxBytesUsed() Chrome wants to call this more often, and it's quite slow today. Seems like this could be clearer if SkPictureUtils::ApproxBytesUsed() were SkPicture::approxBytesUsed(). BUG=chromium:471873 Review URL: https://codereview.chromium.org/1090943004 --- include/core/SkPicture.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'include/core/SkPicture.h') diff --git a/include/core/SkPicture.h b/include/core/SkPicture.h index 8a6216e1aa..a565e415eb 100644 --- a/include/core/SkPicture.h +++ b/include/core/SkPicture.h @@ -260,7 +260,11 @@ private: static bool IsValidPictInfo(const SkPictInfo& info); // Takes ownership of the SkRecord and (optional) SnapshotArray, refs the (optional) BBH. - SkPicture(const SkRect& cullRect, SkRecord*, SnapshotArray*, SkBBoxHierarchy*); + SkPicture(const SkRect& cullRect, + SkRecord*, + SnapshotArray*, + SkBBoxHierarchy*, + size_t approxBytesUsedBySubPictures); static SkPicture* Forwardport(const SkPictInfo&, const SkPictureData*); static SkPictureData* Backport(const SkRecord&, const SkPictInfo&, @@ -273,6 +277,7 @@ private: SkAutoTUnref fRecord; SkAutoTUnref fBBH; SkAutoTDelete fDrawablePicts; + const size_t fApproxBytesUsedBySubPictures; // helpers for fDrawablePicts int drawableCount() const; @@ -302,6 +307,6 @@ private: friend class SkPictureUtils; friend class SkRecordedDrawable; }; -SK_COMPILE_ASSERT(sizeof(SkPicture) <= 96, SkPictureSize); +SK_COMPILE_ASSERT(sizeof(SkPicture) <= 104, SkPictureSize); #endif -- cgit v1.2.3