Index: tests/PictureTest.cpp |
diff --git a/tests/PictureTest.cpp b/tests/PictureTest.cpp |
index 2afb0dd73d1ebe5762a76ed4f40986e355768730..ce14213e820aed0067fd33bb00a6ef6d73b75070 100644 |
--- a/tests/PictureTest.cpp |
+++ b/tests/PictureTest.cpp |
@@ -48,6 +48,21 @@ static void make_bm(SkBitmap* bm, int w, int h, SkColor color, bool immutable) { |
} |
} |
+// For a while willPlayBackBitmaps() ignored SkImages and just looked for SkBitmaps. |
+static void test_images_are_found_by_willPlayBackBitmaps(skiatest::Reporter* reporter) { |
+ // We just need _some_ SkImage. |
+ SkAutoTUnref<SkImage> image(SkImage::NewFromBitmap(SkBitmap())); |
f(malita)
2015/08/26 14:56:00
I was kinda surprised that this works: we never in
mtklein
2015/08/26 15:13:56
Yeah, I was just sort of looking for the simplest
|
+ |
+ SkPictureRecorder recorder; |
+ { |
+ auto canvas = recorder.beginRecording(100,100); |
+ canvas->drawImage(image, 0,0); |
+ } |
+ SkAutoTUnref<SkPicture> picture(recorder.endRecording()); |
+ |
+ REPORTER_ASSERT(reporter, picture->willPlayBackBitmaps()); |
+} |
+ |
/* Hit a few SkPicture::Analysis cases not handled elsewhere. */ |
static void test_analysis(skiatest::Reporter* reporter) { |
SkPictureRecorder recorder; |
@@ -1149,6 +1164,7 @@ DEF_TEST(Picture, reporter) { |
test_gpu_veto(reporter); |
#endif |
test_has_text(reporter); |
+ test_images_are_found_by_willPlayBackBitmaps(reporter); |
test_analysis(reporter); |
test_bitmap_with_encoded_data(reporter); |
test_clip_bound_opt(reporter); |