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

Unified Diff: third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp

Issue 2820823004: Make Canvas2DLayerBridge use SkColorSpaceXformCanvas (Closed)
Patch Set: Put behind flag Created 3 years, 8 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/graphics/Canvas2DLayerBridge.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp b/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp
index cf7ef93a9808be5ba8a74d1d40058b64c998be26..630d41fa705ead5ec538fb421a178b0f56d538f6 100644
--- a/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp
+++ b/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp
@@ -48,6 +48,7 @@
#include "public/platform/WebScheduler.h"
#include "public/platform/WebTraceLocation.h"
#include "skia/ext/texture_handle.h"
+#include "third_party/skia/include/core/SkColorSpaceXformCanvas.h"
#include "third_party/skia/include/core/SkData.h"
#include "third_party/skia/include/core/SkSurface.h"
#include "third_party/skia/include/gpu/GrContext.h"
@@ -779,8 +780,17 @@ void Canvas2DLayerBridge::FlushRecordingOnly() {
if (have_recorded_draw_commands_ && GetOrCreateSurface()) {
TRACE_EVENT0("cc", "Canvas2DLayerBridge::flushRecordingOnly");
- recorder_->finishRecordingAsPicture()->playback(
- GetOrCreateSurface()->getCanvas());
+
+ SkCanvas* canvas = GetOrCreateSurface()->getCanvas();
+ std::unique_ptr<SkCanvas> color_transform_canvas;
+ if (RuntimeEnabledFeatures::colorCorrectRenderingEnabled() &&
+ !sk_surfaces_use_color_space_) {
+ color_transform_canvas =
+ SkCreateColorSpaceXformCanvas(canvas, color_space_.ToSkColorSpace());
msarett1 2017/04/17 18:57:50 Just curious, is color_space_ always sRGB?
ccameron 2017/04/17 19:35:13 For legacy canvas, yes. For the rasterization of w
+ canvas = color_transform_canvas.get();
+ }
+
+ recorder_->finishRecordingAsPicture()->playback(canvas);
if (is_deferral_enabled_)
StartRecording();
have_recorded_draw_commands_ = false;
« 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