| Index: src/utils/SkPictureUtils.cpp
|
| diff --git a/src/utils/SkPictureUtils.cpp b/src/utils/SkPictureUtils.cpp
|
| index dfa772a2da5be93e24bc645608c41052218f6822..b8aa52b3961028deedd356ec44936c62a550efa9 100644
|
| --- a/src/utils/SkPictureUtils.cpp
|
| +++ b/src/utils/SkPictureUtils.cpp
|
| @@ -5,6 +5,7 @@
|
| * found in the LICENSE file.
|
| */
|
|
|
| +#include "SkBBoxHierarchy.h"
|
| #include "SkBitmapDevice.h"
|
| #include "SkCanvas.h"
|
| #include "SkData.h"
|
| @@ -12,6 +13,7 @@
|
| #include "SkPictureUtils.h"
|
| #include "SkPixelRef.h"
|
| #include "SkRRect.h"
|
| +#include "SkRecord.h"
|
| #include "SkShader.h"
|
|
|
| class PixelRefSet {
|
| @@ -215,3 +217,16 @@ SkData* SkPictureUtils::GatherPixelRefs(const SkPicture* pict, const SkRect& are
|
| }
|
| return data;
|
| }
|
| +
|
| +size_t SkPictureUtils::ApproximateBytesUsed(const SkPicture* pict) {
|
| + size_t byteCount = sizeof(*pict);
|
| +
|
| + byteCount += pict->fRecord->bytesUsed();
|
| + if (pict->fBBH.get()) {
|
| + byteCount += pict->fBBH->bytesUsed();
|
| + }
|
| + byteCount +=
|
| + pict->fDeletionListeners.reserved() * sizeof(SkPicture::DeletionListener*) +
|
| + pict->fDeletionListeners.count() * sizeof(SkPicture::DeletionListener);
|
| + return byteCount;
|
| +}
|
|
|