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 28b31ff209fb98cfdd1606ba7efc242e3f281356..d8e3c5b70279e652d331be7f988efbdc8bd022e9 100644 |
| --- a/third_party/WebKit/Source/platform/graphics/DeferredImageDecoderTest.cpp |
| +++ b/third_party/WebKit/Source/platform/graphics/DeferredImageDecoderTest.cpp |
| @@ -161,10 +161,10 @@ TEST_F(DeferredImageDecoderTest, drawIntoSkPicture) |
| SkPictureRecorder recorder; |
| SkCanvas* tempCanvas = recorder.beginRecording(100, 100, 0, 0); |
| tempCanvas->drawImage(image.get(), 0, 0); |
| - RefPtr<SkPicture> picture = adoptRef(recorder.endRecording()); |
| + sk_sp<SkPicture> picture = recorder.finishRecordingAsPicture(); |
| EXPECT_EQ(0, m_decodeRequestCount); |
| - m_surface->getCanvas()->drawPicture(picture.get()); |
| + m_surface->getCanvas()->drawPicture(picture); |
| EXPECT_EQ(0, m_decodeRequestCount); |
| SkBitmap canvasBitmap; |
| @@ -185,8 +185,8 @@ TEST_F(DeferredImageDecoderTest, drawIntoSkPictureProgressive) |
| SkPictureRecorder recorder; |
| SkCanvas* tempCanvas = recorder.beginRecording(100, 100, 0, 0); |
| tempCanvas->drawImage(image.get(), 0, 0); |
| - RefPtr<SkPicture> picture = adoptRef(recorder.endRecording()); |
| - m_surface->getCanvas()->drawPicture(picture.get()); |
| + sk_sp<SkPicture> picture = recorder.finishRecordingAsPicture(); |
|
tomhudson
2016/03/24 19:52:40
We can fold these (two) calls into the drawPicture
f(malita)
2016/03/24 20:22:41
Right, that's the optimal pattern - but with tests
|
| + m_surface->getCanvas()->drawPicture(picture); |
| // Fully received the file and draw the SkPicture again. |
| m_lazyDecoder->setData(*m_data, true); |
| @@ -194,8 +194,8 @@ TEST_F(DeferredImageDecoderTest, drawIntoSkPictureProgressive) |
| ASSERT_TRUE(image); |
| tempCanvas = recorder.beginRecording(100, 100, 0, 0); |
| tempCanvas->drawImage(image.get(), 0, 0); |
| - picture = adoptRef(recorder.endRecording()); |
| - m_surface->getCanvas()->drawPicture(picture.get()); |
| + picture = recorder.finishRecordingAsPicture(); |
| + m_surface->getCanvas()->drawPicture(picture); |
| SkBitmap canvasBitmap; |
| canvasBitmap.allocN32Pixels(100, 100); |
| @@ -220,7 +220,7 @@ TEST_F(DeferredImageDecoderTest, decodeOnOtherThread) |
| SkPictureRecorder recorder; |
| SkCanvas* tempCanvas = recorder.beginRecording(100, 100, 0, 0); |
| tempCanvas->drawImage(image.get(), 0, 0); |
| - RefPtr<SkPicture> picture = adoptRef(recorder.endRecording()); |
| + sk_sp<SkPicture> picture = recorder.finishRecordingAsPicture(); |
| EXPECT_EQ(0, m_decodeRequestCount); |
| // Create a thread to rasterize SkPicture. |
| @@ -318,9 +318,9 @@ TEST_F(DeferredImageDecoderTest, decodedSize) |
| SkPictureRecorder recorder; |
| SkCanvas* tempCanvas = recorder.beginRecording(100, 100, 0, 0); |
| tempCanvas->drawImage(image.get(), 0, 0); |
| - RefPtr<SkPicture> picture = adoptRef(recorder.endRecording()); |
| + sk_sp<SkPicture> picture = recorder.finishRecordingAsPicture(); |
| EXPECT_EQ(0, m_decodeRequestCount); |
| - m_surface->getCanvas()->drawPicture(picture.get()); |
| + m_surface->getCanvas()->drawPicture(picture); |
| EXPECT_EQ(1, m_decodeRequestCount); |
| } |