Index: tests/PictureTest.cpp |
diff --git a/tests/PictureTest.cpp b/tests/PictureTest.cpp |
index c87d9c75ca4048d8dac024028bb03c58845285f7..7fa6b9684ffee49ea0b56999eddee8250715eb24 100644 |
--- a/tests/PictureTest.cpp |
+++ b/tests/PictureTest.cpp |
@@ -1698,6 +1698,17 @@ static void test_gen_id(skiatest::Reporter* reporter) { |
REPORTER_ASSERT(reporter, hasData->uniqueID() != empty->uniqueID()); |
} |
+static void test_bytes_used(skiatest::Reporter* reporter) { |
+ SkPictureRecorder recorder; |
+ |
+ recorder.beginRecording(0, 0); |
+ SkAutoTUnref<SkPicture> empty(recorder.endRecording()); |
+ |
+ // A SkPicture also has SkRecord and possibly SkBBHierarchy as members. |
+ REPORTER_ASSERT(reporter, SkPictureUtils::approximateBytesUsed(empty.get()) >= |
+ sizeof(SkPicture)); |
+} |
+ |
DEF_TEST(Picture, reporter) { |
#ifdef SK_DEBUG |
test_deleting_empty_picture(); |
@@ -1723,6 +1734,7 @@ DEF_TEST(Picture, reporter) { |
test_clip_expansion(reporter); |
test_hierarchical(reporter); |
test_gen_id(reporter); |
+ test_bytes_used(reporter); |
} |
#if SK_SUPPORT_GPU |
@@ -1829,6 +1841,7 @@ struct CountingBBH : public SkBBoxHierarchy { |
virtual int getCount() const { return 0; } |
virtual int getDepth() const { return 0; } |
virtual void rewindInserts() {} |
+ virtual size_t bytesUsed() const { return 0; } |
}; |
class SpoonFedBBHFactory : public SkBBHFactory { |