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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/serialization/V8ScriptValueSerializerTest.cpp

Issue 2559013002: Add ColorBehavior to blink::Image draw methods (Closed)
Patch Set: Rebase Created 4 years 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/bindings/core/v8/serialization/V8ScriptValueSerializerTest.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/serialization/V8ScriptValueSerializerTest.cpp b/third_party/WebKit/Source/bindings/core/v8/serialization/V8ScriptValueSerializerTest.cpp
index 1568332b39b94dd74d8f7288b6088919e0b4779a..096fbeea534c31aa73d899d3e8196448f1f74201 100644
--- a/third_party/WebKit/Source/bindings/core/v8/serialization/V8ScriptValueSerializerTest.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/serialization/V8ScriptValueSerializerTest.cpp
@@ -396,9 +396,12 @@ TEST(V8ScriptValueSerializerTest, RoundTripImageBitmap) {
// Check that the pixel at (3, 3) is red.
uint8_t pixel[4] = {};
- ASSERT_TRUE(newImageBitmap->bitmapImage()->imageForCurrentFrame()->readPixels(
- SkImageInfo::Make(1, 1, kRGBA_8888_SkColorType, kPremul_SkAlphaType),
- &pixel, 4, 3, 3));
+ ASSERT_TRUE(
+ newImageBitmap->bitmapImage()
+ ->imageForCurrentFrame(ColorBehavior::transformToTargetForTesting())
+ ->readPixels(SkImageInfo::Make(1, 1, kRGBA_8888_SkColorType,
+ kPremul_SkAlphaType),
+ &pixel, 4, 3, 3));
ASSERT_THAT(pixel, ::testing::ElementsAre(255, 0, 0, 255));
}
@@ -432,9 +435,12 @@ TEST(V8ScriptValueSerializerTest, DecodeImageBitmap) {
// Check that the pixels are opaque red and green, respectively.
uint8_t pixels[8] = {};
- ASSERT_TRUE(newImageBitmap->bitmapImage()->imageForCurrentFrame()->readPixels(
- SkImageInfo::Make(2, 1, kRGBA_8888_SkColorType, kPremul_SkAlphaType),
- &pixels, 8, 0, 0));
+ ASSERT_TRUE(
+ newImageBitmap->bitmapImage()
+ ->imageForCurrentFrame(ColorBehavior::transformToTargetForTesting())
+ ->readPixels(SkImageInfo::Make(2, 1, kRGBA_8888_SkColorType,
+ kPremul_SkAlphaType),
+ &pixels, 8, 0, 0));
ASSERT_THAT(pixels, ::testing::ElementsAre(255, 0, 0, 255, 0, 255, 0, 255));
}
@@ -498,8 +504,8 @@ TEST(V8ScriptValueSerializerTest, TransferImageBitmap) {
// Check that the pixel at (3, 3) is red.
uint8_t pixel[4] = {};
- sk_sp<SkImage> newImage =
- newImageBitmap->bitmapImage()->imageForCurrentFrame();
+ sk_sp<SkImage> newImage = newImageBitmap->bitmapImage()->imageForCurrentFrame(
+ ColorBehavior::transformToTargetForTesting());
ASSERT_TRUE(newImage->readPixels(
SkImageInfo::Make(1, 1, kRGBA_8888_SkColorType, kPremul_SkAlphaType),
&pixel, 4, 3, 3));

Powered by Google App Engine
This is Rietveld 408576698