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; |