diff options
author | mtklein <mtklein@chromium.org> | 2015-04-21 15:23:59 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-04-21 15:24:00 -0700 |
commit | 98b8485a4cc911420e20af2670d21a5478a06264 (patch) | |
tree | 4a2fa7f3eba5368bd32656d4e1cffdfa8287f870 /include/core/SkPicture.h | |
parent | 5ae0e2b56373b67a0fe6a0f9d7a0373712d1fa63 (diff) |
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
Diffstat (limited to 'include/core/SkPicture.h')
-rw-r--r-- | include/core/SkPicture.h | 9 |
1 files changed, 7 insertions, 2 deletions
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<const SkRecord> fRecord; SkAutoTUnref<const SkBBoxHierarchy> fBBH; SkAutoTDelete<const SnapshotArray> 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 |