Index: third_party/WebKit/Source/platform/graphics/OffscreenCanvasFrameDispatcherImpl.cpp |
diff --git a/third_party/WebKit/Source/platform/graphics/OffscreenCanvasFrameDispatcherImpl.cpp b/third_party/WebKit/Source/platform/graphics/OffscreenCanvasFrameDispatcherImpl.cpp |
index fa2e5d4fdfe244604784184aa08b2bb8aa40e605..512f9b4277741cfb75e966cf3f92afac1d33325c 100644 |
--- a/third_party/WebKit/Source/platform/graphics/OffscreenCanvasFrameDispatcherImpl.cpp |
+++ b/third_party/WebKit/Source/platform/graphics/OffscreenCanvasFrameDispatcherImpl.cpp |
@@ -70,8 +70,10 @@ void OffscreenCanvasFrameDispatcherImpl::setTransferableResourceToSharedBitmap( |
// TODO(xlai): Optimize to avoid copying pixels. See crbug.com/651456. |
// However, in the case when |image| is texture backed, this function call |
// does a GPU readback which is required. |
- image->imageForCurrentFrame()->readPixels(imageInfo, pixels, |
- imageInfo.minRowBytes(), 0, 0); |
+ // TODO(ccameron): Canvas should produce sRGB images. |
+ // https://crbug.com/672299 |
+ image->imageForCurrentFrame(ColorBehavior::transformToGlobalTarget()) |
+ ->readPixels(imageInfo, pixels, imageInfo.minRowBytes(), 0, 0); |
resource.mailbox_holder.mailbox = bitmap->id(); |
resource.mailbox_holder.texture_target = 0; |
resource.is_software = true; |
@@ -105,8 +107,10 @@ void OffscreenCanvasFrameDispatcherImpl:: |
return; |
RefPtr<Uint8Array> dstPixels = |
Uint8Array::create(dstBuffer, 0, dstBuffer->byteLength()); |
- image->imageForCurrentFrame()->readPixels(info, dstPixels->data(), |
- info.minRowBytes(), 0, 0); |
+ // TODO(ccameron): Canvas should produce sRGB images. |
+ // https://crbug.com/672299 |
+ image->imageForCurrentFrame(ColorBehavior::transformToGlobalTarget()) |
+ ->readPixels(info, dstPixels->data(), info.minRowBytes(), 0, 0); |
GLuint textureId = 0u; |
gl->GenTextures(1, &textureId); |