aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2015-04-30 13:09:24 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-04-30 13:09:25 -0700
commit1c2c441fede0ae9573afc098017011e3439624a9 (patch)
tree088df00ee48e5e6f6d0763c2962f25e61b25a80f /tests
parent4f7ec55f7128e971318adc11f07fc485c4d50bc5 (diff)
add heuristic to pour small pictures into recordings, rather than ref'ing
Diffstat (limited to 'tests')
-rw-r--r--tests/PictureTest.cpp2
-rw-r--r--tests/RecorderTest.cpp22
2 files changed, 1 insertions, 23 deletions
diff --git a/tests/PictureTest.cpp b/tests/PictureTest.cpp
index 4fe08379dd..16d98b3245 100644
--- a/tests/PictureTest.cpp
+++ b/tests/PictureTest.cpp
@@ -1127,7 +1127,7 @@ static void test_bytes_used(skiatest::Reporter* reporter) {
r2.getRecordingCanvas()->drawPicture(empty.get());
SkAutoTUnref<SkPicture> nested(r2.endRecording());
- REPORTER_ASSERT(reporter, SkPictureUtils::ApproximateBytesUsed(nested.get()) >
+ REPORTER_ASSERT(reporter, SkPictureUtils::ApproximateBytesUsed(nested.get()) >=
SkPictureUtils::ApproximateBytesUsed(empty.get()));
}
diff --git a/tests/RecorderTest.cpp b/tests/RecorderTest.cpp
index 4fac1af58c..e67de58acb 100644
--- a/tests/RecorderTest.cpp
+++ b/tests/RecorderTest.cpp
@@ -89,28 +89,6 @@ DEF_TEST(Recorder_RefLeaking, r) {
REPORTER_ASSERT(r, paint.getShader()->unique());
}
-DEF_TEST(Recorder_RefPictures, r) {
- SkAutoTUnref<SkPicture> pic;
-
- {
- SkPictureRecorder pr;
- SkCanvas* canvas = pr.beginRecording(100, 100);
- canvas->drawColor(SK_ColorRED);
- pic.reset(pr.endRecording());
- }
- REPORTER_ASSERT(r, pic->unique());
-
- {
- SkRecord record;
- SkRecorder recorder(&record, 100, 100);
- recorder.drawPicture(pic);
- // the recorder should now also be an owner
- REPORTER_ASSERT(r, !pic->unique());
- }
- // the recorder destructor should have released us (back to unique)
- REPORTER_ASSERT(r, pic->unique());
-}
-
DEF_TEST(Recorder_drawImage_takeReference, reporter) {
SkAutoTUnref<SkImage> image;