| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 |
| 7 #include "Test.h" | 8 #include "Test.h" |
| 9 #include "TestClassDef.h" |
| 8 #include "SkBitmapDevice.h" | 10 #include "SkBitmapDevice.h" |
| 9 #include "SkCanvas.h" | 11 #include "SkCanvas.h" |
| 10 #include "SkColorPriv.h" | 12 #include "SkColorPriv.h" |
| 11 #include "SkData.h" | 13 #include "SkData.h" |
| 12 #include "SkError.h" | 14 #include "SkError.h" |
| 13 #include "SkPaint.h" | 15 #include "SkPaint.h" |
| 14 #include "SkPicture.h" | 16 #include "SkPicture.h" |
| 15 #include "SkPictureUtils.h" | 17 #include "SkPictureUtils.h" |
| 16 #include "SkRandom.h" | 18 #include "SkRandom.h" |
| 17 #include "SkRRect.h" | 19 #include "SkRRect.h" |
| (...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 644 REPORTER_ASSERT(reporter, parentWBP.willPlayBackBitmaps()); // 1 | 646 REPORTER_ASSERT(reporter, parentWBP.willPlayBackBitmaps()); // 1 |
| 645 | 647 |
| 646 SkPicture parentWBWB; | 648 SkPicture parentWBWB; |
| 647 canvas = parentWBWB.beginRecording(10, 10); | 649 canvas = parentWBWB.beginRecording(10, 10); |
| 648 canvas->drawBitmap(bm, 0, 0); | 650 canvas->drawBitmap(bm, 0, 0); |
| 649 canvas->drawPicture(childWithBitmap); | 651 canvas->drawPicture(childWithBitmap); |
| 650 parentWBWB.endRecording(); | 652 parentWBWB.endRecording(); |
| 651 REPORTER_ASSERT(reporter, parentWBWB.willPlayBackBitmaps()); // 2 | 653 REPORTER_ASSERT(reporter, parentWBWB.willPlayBackBitmaps()); // 2 |
| 652 } | 654 } |
| 653 | 655 |
| 654 static void TestPicture(skiatest::Reporter* reporter) { | 656 DEF_TEST(Picture, reporter) { |
| 655 #ifdef SK_DEBUG | 657 #ifdef SK_DEBUG |
| 656 test_deleting_empty_playback(); | 658 test_deleting_empty_playback(); |
| 657 test_serializing_empty_picture(); | 659 test_serializing_empty_picture(); |
| 658 #else | 660 #else |
| 659 test_bad_bitmap(); | 661 test_bad_bitmap(); |
| 660 #endif | 662 #endif |
| 661 test_peephole(); | 663 test_peephole(); |
| 662 test_gatherpixelrefs(reporter); | 664 test_gatherpixelrefs(reporter); |
| 663 test_bitmap_with_encoded_data(reporter); | 665 test_bitmap_with_encoded_data(reporter); |
| 664 test_clone_empty(reporter); | 666 test_clone_empty(reporter); |
| 665 test_clip_bound_opt(reporter); | 667 test_clip_bound_opt(reporter); |
| 666 test_clip_expansion(reporter); | 668 test_clip_expansion(reporter); |
| 667 test_hierarchical(reporter); | 669 test_hierarchical(reporter); |
| 668 } | 670 } |
| 669 | |
| 670 #include "TestClassDef.h" | |
| 671 DEFINE_TESTCLASS("Pictures", PictureTestClass, TestPicture) | |
| OLD | NEW |