Chromium Code Reviews| Index: third_party/WebKit/Source/platform/graphics/DeferredImageDecoderTest.cpp |
| diff --git a/third_party/WebKit/Source/platform/graphics/DeferredImageDecoderTest.cpp b/third_party/WebKit/Source/platform/graphics/DeferredImageDecoderTest.cpp |
| index 905b2d3830a6bff94ca44cb1de4d2cbbbd979b13..b8b6bcc9dd3740ee1031d622d2e19e57df55e47c 100644 |
| --- a/third_party/WebKit/Source/platform/graphics/DeferredImageDecoderTest.cpp |
| +++ b/third_party/WebKit/Source/platform/graphics/DeferredImageDecoderTest.cpp |
| @@ -346,7 +346,9 @@ TEST_F(DeferredImageDecoderTest, frameOpacity) { |
| Vector<char> storage(size); |
| SkPixmap pixmap(pix_info, storage.data(), row_bytes); |
| - // Before decoding, the frame is not known to be opaque. |
| + // Before decoding, the frame's alpha is unknown and assumed to be |
| + // transparent. This works well with partial decoding, which will be |
| + // transparent until the full first frame is decoded. |
| sk_sp<SkImage> frame = decoder->CreateFrameAtIndex(0); |
| ASSERT_TRUE(frame); |
| EXPECT_FALSE(frame->isOpaque()); |
| @@ -354,10 +356,12 @@ TEST_F(DeferredImageDecoderTest, frameOpacity) { |
| // Force a lazy decode by reading pixels. |
| EXPECT_TRUE(frame->readPixels(pixmap, 0, 0)); |
| - // After decoding, the frame is known to be opaque. |
| frame = decoder->CreateFrameAtIndex(0); |
| ASSERT_TRUE(frame); |
| - EXPECT_TRUE(frame->isOpaque()); |
| + // The GIF file specifies it is opaque. |
| + // When the file is a PNG (test_gif is false), we remain at |
|
scroggo_chromium
2017/05/30 19:45:17
The comment seems to imply that all PNG files will
cblume
2017/05/30 23:42:13
I will try to word it better.
I meant to say that
|
| + // the default: transparent |
| + EXPECT_EQ(test_gif, frame->isOpaque()); |
| // Re-generating the opaque-marked frame should not fail. |
| EXPECT_TRUE(frame->readPixels(pixmap, 0, 0)); |