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

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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/frame/ImageBitmap.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 26b1d6fbedb91f92d1ffc8b3b1c2b23e6902934b..820ce0d69c713f4a2bbc3e8859f7c2e807ea0209 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));
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/frame/ImageBitmap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698