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

Unified Diff: third_party/WebKit/Source/platform/graphics/DeferredImageDecoderTest.cpp

Issue 1823133002: Use sk_sp-based picture recording APIs in Blink (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments Created 4 years, 9 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: 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..fe706604f4445ccab21245adae5cbbf01bf9c929 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,7 @@ 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());
+ m_surface->getCanvas()->drawPicture(recorder.finishRecordingAsPicture());
// Fully received the file and draw the SkPicture again.
m_lazyDecoder->setData(*m_data, true);
@@ -194,8 +193,7 @@ 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());
+ m_surface->getCanvas()->drawPicture(recorder.finishRecordingAsPicture());
SkBitmap canvasBitmap;
canvasBitmap.allocN32Pixels(100, 100);
@@ -220,7 +218,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 +316,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);
}

Powered by Google App Engine
This is Rietveld 408576698