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

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

Issue 2743363006: Clean up cc/paint interfaces (Closed)
Patch Set: Fix PaintControllerTest v2 Created 3 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 65054e923856e0906b317c7211c0af88869ea171..131c29af807d31bd6c51a3791869e33014b35a1c 100644
--- a/third_party/WebKit/Source/platform/graphics/DeferredImageDecoderTest.cpp
+++ b/third_party/WebKit/Source/platform/graphics/DeferredImageDecoderTest.cpp
@@ -162,7 +162,7 @@ TEST_F(DeferredImageDecoderTest, drawIntoPaintRecord) {
PaintRecorder recorder;
PaintCanvas* tempCanvas = recorder.beginRecording(100, 100);
- tempCanvas->drawImage(image.get(), 0, 0);
+ tempCanvas->drawImage(image, 0, 0);
sk_sp<PaintRecord> record = recorder.finishRecordingAsPicture();
EXPECT_EQ(0, m_decodeRequestCount);
@@ -186,7 +186,7 @@ TEST_F(DeferredImageDecoderTest, drawIntoPaintRecordProgressive) {
ASSERT_TRUE(image);
PaintRecorder recorder;
PaintCanvas* tempCanvas = recorder.beginRecording(100, 100);
- tempCanvas->drawImage(image.get(), 0, 0);
+ tempCanvas->drawImage(std::move(image), 0, 0);
m_surface->getCanvas()->drawPicture(recorder.finishRecordingAsPicture());
// Fully received the file and draw the PaintRecord again.
@@ -194,7 +194,7 @@ TEST_F(DeferredImageDecoderTest, drawIntoPaintRecordProgressive) {
image = m_lazyDecoder->createFrameAtIndex(0);
ASSERT_TRUE(image);
tempCanvas = recorder.beginRecording(100, 100);
- tempCanvas->drawImage(image.get(), 0, 0);
+ tempCanvas->drawImage(std::move(image), 0, 0);
m_surface->getCanvas()->drawPicture(recorder.finishRecordingAsPicture());
SkBitmap canvasBitmap;
@@ -204,7 +204,7 @@ TEST_F(DeferredImageDecoderTest, drawIntoPaintRecordProgressive) {
EXPECT_EQ(SkColorSetARGB(255, 255, 255, 255), canvasBitmap.getColor(0, 0));
}
-static void rasterizeMain(PaintCanvas* canvas, PaintRecord* record) {
+static void rasterizeMain(PaintCanvas* canvas, sk_sp<PaintRecord> record) {
canvas->drawPicture(record);
}
@@ -217,7 +217,7 @@ TEST_F(DeferredImageDecoderTest, decodeOnOtherThread) {
PaintRecorder recorder;
PaintCanvas* tempCanvas = recorder.beginRecording(100, 100);
- tempCanvas->drawImage(image.get(), 0, 0);
+ tempCanvas->drawImage(std::move(image), 0, 0);
sk_sp<PaintRecord> record = recorder.finishRecordingAsPicture();
EXPECT_EQ(0, m_decodeRequestCount);
@@ -227,8 +227,7 @@ TEST_F(DeferredImageDecoderTest, decodeOnOtherThread) {
thread->getWebTaskRunner()->postTask(
BLINK_FROM_HERE,
crossThreadBind(&rasterizeMain,
- crossThreadUnretained(m_surface->getCanvas()),
- crossThreadUnretained(record.get())));
+ crossThreadUnretained(m_surface->getCanvas()), record));
thread.reset();
EXPECT_EQ(0, m_decodeRequestCount);
@@ -317,7 +316,7 @@ TEST_F(DeferredImageDecoderTest, decodedSize) {
// The following code should not fail any assert.
PaintRecorder recorder;
PaintCanvas* tempCanvas = recorder.beginRecording(100, 100);
- tempCanvas->drawImage(image.get(), 0, 0);
+ tempCanvas->drawImage(std::move(image), 0, 0);
sk_sp<PaintRecord> record = recorder.finishRecordingAsPicture();
EXPECT_EQ(0, m_decodeRequestCount);
m_surface->getCanvas()->drawPicture(record);

Powered by Google App Engine
This is Rietveld 408576698