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

Unified Diff: third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.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/modules/canvas2d/BaseRenderingContext2D.cpp
diff --git a/third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp b/third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp
index d3fb0e25fd12d224c0cfb32603fb0776ed59ae46..ddafd62e7a398a28af62161b8a158ac9bf9e65d9 100644
--- a/third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp
+++ b/third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp
@@ -1078,8 +1078,11 @@ void BaseRenderingContext2D::drawImageInternal(SkCanvas* c,
if (!imageSource->isVideoElement()) {
imagePaint.setAntiAlias(shouldDrawImageAntialiased(dstRect));
+ // TODO(ccameron): Canvas should draw in sRGB by default.
Justin Novosad 2016/12/09 02:17:35 Actually, we want to use whatever the canvas's col
+ // https://crbug.com/672299
image->draw(c, imagePaint, dstRect, srcRect, DoNotRespectImageOrientation,
- Image::DoNotClampImageToSourceRect);
+ Image::DoNotClampImageToSourceRect,
+ ColorBehavior::transformToGlobalTarget());
Justin Novosad 2016/12/09 02:17:35 I am concerned about this approach, I understand t
ccameron 2016/12/09 03:30:56 It is true, as you mention, that, if two different
} else {
c->save();
c->clipRect(dstRect);

Powered by Google App Engine
This is Rietveld 408576698