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

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

Issue 2812763002: paint: Introduce PaintImage that wraps SkImage in paint calls. (Closed)
Patch Set: update Created 3 years, 8 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 8d54bf578176ad37a7877498cba474cddd351516..400fb05ea576569ec7bfdc67d43d2e336ec21fec 100644
--- a/third_party/WebKit/Source/platform/graphics/DeferredImageDecoderTest.cpp
+++ b/third_party/WebKit/Source/platform/graphics/DeferredImageDecoderTest.cpp
@@ -32,6 +32,7 @@
#include "platform/graphics/ImageDecodingStore.h"
#include "platform/graphics/ImageFrameGenerator.h"
#include "platform/graphics/paint/PaintCanvas.h"
+#include "platform/graphics/paint/PaintImage.h"
#include "platform/graphics/paint/PaintRecord.h"
#include "platform/graphics/paint/PaintRecorder.h"
#include "platform/graphics/test/MockImageDecoder.h"
@@ -162,7 +163,10 @@ TEST_F(DeferredImageDecoderTest, drawIntoPaintRecord) {
PaintRecorder recorder;
PaintCanvas* temp_canvas = recorder.beginRecording(100, 100);
- temp_canvas->drawImage(image, 0, 0);
+ temp_canvas->drawImage(
+ PaintImage(std::move(image), PaintImage::AnimationType::STATIC,
+ PaintImage::CompletionState::DONE),
+ 0, 0);
sk_sp<PaintRecord> record = recorder.finishRecordingAsPicture();
EXPECT_EQ(0, decode_request_count_);
@@ -183,7 +187,10 @@ TEST_F(DeferredImageDecoderTest, drawIntoPaintRecordProgressive) {
ASSERT_TRUE(image);
PaintRecorder recorder;
PaintCanvas* temp_canvas = recorder.beginRecording(100, 100);
- temp_canvas->drawImage(std::move(image), 0, 0);
+ temp_canvas->drawImage(
+ PaintImage(std::move(image), PaintImage::AnimationType::STATIC,
+ PaintImage::CompletionState::PARTIALLY_DONE),
+ 0, 0);
canvas_->drawPicture(recorder.finishRecordingAsPicture());
// Fully received the file and draw the PaintRecord again.
@@ -191,7 +198,10 @@ TEST_F(DeferredImageDecoderTest, drawIntoPaintRecordProgressive) {
image = lazy_decoder_->CreateFrameAtIndex(0);
ASSERT_TRUE(image);
temp_canvas = recorder.beginRecording(100, 100);
- temp_canvas->drawImage(std::move(image), 0, 0);
+ temp_canvas->drawImage(
+ PaintImage(std::move(image), PaintImage::AnimationType::STATIC,
+ PaintImage::CompletionState::DONE),
+ 0, 0);
canvas_->drawPicture(recorder.finishRecordingAsPicture());
SkAutoLockPixels auto_lock(bitmap_);
@@ -211,7 +221,10 @@ TEST_F(DeferredImageDecoderTest, decodeOnOtherThread) {
PaintRecorder recorder;
PaintCanvas* temp_canvas = recorder.beginRecording(100, 100);
- temp_canvas->drawImage(std::move(image), 0, 0);
+ temp_canvas->drawImage(
+ PaintImage(std::move(image), PaintImage::AnimationType::STATIC,
+ PaintImage::CompletionState::DONE),
+ 0, 0);
sk_sp<PaintRecord> record = recorder.finishRecordingAsPicture();
EXPECT_EQ(0, decode_request_count_);
@@ -307,7 +320,10 @@ TEST_F(DeferredImageDecoderTest, decodedSize) {
// The following code should not fail any assert.
PaintRecorder recorder;
PaintCanvas* temp_canvas = recorder.beginRecording(100, 100);
- temp_canvas->drawImage(std::move(image), 0, 0);
+ temp_canvas->drawImage(
+ PaintImage(std::move(image), PaintImage::AnimationType::STATIC,
+ PaintImage::CompletionState::DONE),
+ 0, 0);
sk_sp<PaintRecord> record = recorder.finishRecordingAsPicture();
EXPECT_EQ(0, decode_request_count_);
canvas_->drawPicture(record);

Powered by Google App Engine
This is Rietveld 408576698