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

Unified Diff: third_party/WebKit/Source/platform/DragImage.cpp

Issue 2911453002: color: Draw blink::DragImage to sRGB (Closed)
Patch Set: Created 3 years, 7 months 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/DragImage.cpp
diff --git a/third_party/WebKit/Source/platform/DragImage.cpp b/third_party/WebKit/Source/platform/DragImage.cpp
index 9a6e8e5c90e23131109ed85ae5c39a659545e3b3..e72bdc063068bb59b75797a34e25829c8b122c04 100644
--- a/third_party/WebKit/Source/platform/DragImage.cpp
+++ b/third_party/WebKit/Source/platform/DragImage.cpp
@@ -51,6 +51,7 @@
#include "platform/wtf/text/WTFString.h"
#include "skia/ext/image_operations.h"
#include "third_party/skia/include/core/SkCanvas.h"
+#include "third_party/skia/include/core/SkColorSpaceXformCanvas.h"
#include "third_party/skia/include/core/SkImage.h"
#include "third_party/skia/include/core/SkMatrix.h"
#include "third_party/skia/include/core/SkSurface.h"
@@ -113,6 +114,12 @@ PaintImage DragImage::ResizeAndOrientImage(
: kHigh_SkFilterQuality);
SkCanvas* canvas = surface->getCanvas();
+ std::unique_ptr<SkCanvas> color_transform_canvas;
+ if (RuntimeEnabledFeatures::colorCorrectRenderingEnabled()) {
+ color_transform_canvas =
+ SkCreateColorSpaceXformCanvas(canvas, SkColorSpace::MakeSRGB());
+ canvas = color_transform_canvas.get();
+ }
canvas->concat(AffineTransformToSkMatrix(transform));
canvas->drawImage(image.sk_image(), 0, 0, &paint);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698