Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(120)

Unified Diff: tests/PictureTest.cpp

Issue 338633011: Deprecate SkPicture::clone(). (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add define for chrome Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tests/PictureTest.cpp
diff --git a/tests/PictureTest.cpp b/tests/PictureTest.cpp
index 6ec1e0a0222abb8b8a0b681f2888f33300a4040b..e62a68ba9ac5d1666d4aea97c6f58dca06ae7b07 100644
--- a/tests/PictureTest.cpp
+++ b/tests/PictureTest.cpp
@@ -1274,19 +1274,6 @@ static void test_bitmap_with_encoded_data(skiatest::Reporter* reporter) {
SkSetErrorCallback(NULL, NULL);
}
-static void test_clone_empty(skiatest::Reporter* reporter) {
- // This is a regression test for crbug.com/172062
- // Before the fix, we used to crash accessing a null pointer when we
- // had a picture with no paints. This test passes by not crashing.
- {
- SkPictureRecorder recorder;
- recorder.beginRecording(1, 1);
- SkAutoTUnref<SkPicture> picture(recorder.endRecording());
- SkAutoTUnref<SkPicture> destPicture(picture->clone());
- REPORTER_ASSERT(reporter, NULL != destPicture);
- }
-}
-
static void test_draw_empty(skiatest::Reporter* reporter) {
SkBitmap result;
make_bm(&result, 2, 2, SK_ColorBLACK, false);
@@ -1556,15 +1543,6 @@ static void test_gen_id(skiatest::Reporter* reporter) {
SkPicture emptyCopy(empty);
REPORTER_ASSERT(reporter, empty.uniqueID() != emptyCopy.uniqueID());
-
- // test out clone
- {
- SkAutoTUnref<SkPicture> cloneWithData(hasData->clone());
- REPORTER_ASSERT(reporter, hasData->uniqueID() == cloneWithData->uniqueID());
-
- SkAutoTUnref<SkPicture> emptyClone(empty.clone());
- REPORTER_ASSERT(reporter, empty.uniqueID() != emptyClone->uniqueID());
- }
}
DEF_TEST(Picture, reporter) {
@@ -1582,7 +1560,6 @@ DEF_TEST(Picture, reporter) {
test_gatherpixelrefs(reporter);
test_gatherpixelrefsandrects(reporter);
test_bitmap_with_encoded_data(reporter);
- test_clone_empty(reporter);
test_draw_empty(reporter);
test_clip_bound_opt(reporter);
test_clip_expansion(reporter);

Powered by Google App Engine
This is Rietveld 408576698