aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorGravatar mtklein <mtklein@chromium.org>2014-11-20 09:18:31 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2014-11-20 09:18:32 -0800
commit08d1fccf6eeec0a9fd5421e59e4d05daccf6e339 (patch)
tree4b4e6e07b4f4371a443d057591665a5ac0bcbdd3 /tests
parentcdeeb095a629b0db9f0ddff09516f2b78255c047 (diff)
Add SkNVRefCnt, prune down SkPicture's size
SkNVRefCnt is a variant of SkRefCnt that's Not Virtual, so weighs 4 bytes instead of 8 or 16. There's only benefit to doing this if the deriving class does not otherwise need a vtable, e.g. SkPicture. I've stripped out some cruft from SkPicture, rearranged fields to pack tightly, and added compile asserts for the sizes of SkPicture, SkRecord, and SkVarAlloc. BUG=skia:3144 Review URL: https://codereview.chromium.org/741793002
Diffstat (limited to 'tests')
-rw-r--r--tests/PictureTest.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/PictureTest.cpp b/tests/PictureTest.cpp
index c2c19c546b..ce10f56fd6 100644
--- a/tests/PictureTest.cpp
+++ b/tests/PictureTest.cpp
@@ -1503,7 +1503,7 @@ static void test_bitmap_with_encoded_data(skiatest::Reporter* reporter) {
SkSetErrorCallback(assert_one_parse_error_cb, &context);
SkMemoryStream pictureStream(picture1);
SkClearLastError();
- SkAutoUnref pictureFromStream(SkPicture::CreateFromStream(&pictureStream, NULL));
+ SkAutoTUnref<SkPicture> pictureFromStream(SkPicture::CreateFromStream(&pictureStream, NULL));
REPORTER_ASSERT(reporter, pictureFromStream.get() != NULL);
SkClearLastError();
SkSetErrorCallback(NULL, NULL);
@@ -1733,7 +1733,7 @@ static void test_bytes_used(skiatest::Reporter* reporter) {
sizeof(SkPicture) + sizeof(SkRecord));
// Protect against any unintentional bloat.
- REPORTER_ASSERT(reporter, SkPictureUtils::ApproximateBytesUsed(empty.get()) <= 184);
+ REPORTER_ASSERT(reporter, SkPictureUtils::ApproximateBytesUsed(empty.get()) <= 144);
// Sanity check of nested SkPictures.
SkPictureRecorder r2;