diff options
Diffstat (limited to 'tests/PictureTest.cpp')
-rw-r--r-- | tests/PictureTest.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/PictureTest.cpp b/tests/PictureTest.cpp index a4dc7d7102..cc5d880297 100644 --- a/tests/PictureTest.cpp +++ b/tests/PictureTest.cpp @@ -1521,12 +1521,12 @@ static void test_hierarchical(skiatest::Reporter* reporter) { static void test_gen_id(skiatest::Reporter* reporter) { - SkPicture empty; + SkPictureRecorder recorder; + recorder.beginRecording(0, 0); + SkAutoTUnref<SkPicture> empty(recorder.endRecording()); // Empty pictures should still have a valid ID - REPORTER_ASSERT(reporter, empty.uniqueID() != SK_InvalidGenID); - - SkPictureRecorder recorder; + REPORTER_ASSERT(reporter, empty->uniqueID() != SK_InvalidGenID); SkCanvas* canvas = recorder.beginRecording(1, 1); canvas->drawARGB(255, 255, 255, 255); @@ -1535,7 +1535,7 @@ static void test_gen_id(skiatest::Reporter* reporter) { REPORTER_ASSERT(reporter, hasData->uniqueID() != SK_InvalidGenID); // both pictures should have different ids - REPORTER_ASSERT(reporter, hasData->uniqueID() != empty.uniqueID()); + REPORTER_ASSERT(reporter, hasData->uniqueID() != empty->uniqueID()); } DEF_TEST(Picture, reporter) { |