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

Unified Diff: third_party/WebKit/Source/platform/graphics/OffscreenCanvasFrameDispatcherImpl.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/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 6abe6ea087c394349ba26e4f5f0a6547d69455cb..2db64d8bee26a5548c1953903675e03451b73f08 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);

Powered by Google App Engine
This is Rietveld 408576698