Index: third_party/WebKit/Source/core/paint/VideoPainter.cpp |
diff --git a/third_party/WebKit/Source/core/paint/VideoPainter.cpp b/third_party/WebKit/Source/core/paint/VideoPainter.cpp |
index 08dc076afdaedf308e951fb05b47cd0236255c8f..457ae9516d4b97eb1a9a8cf44b98f2f3d7c305c5 100644 |
--- a/third_party/WebKit/Source/core/paint/VideoPainter.cpp |
+++ b/third_party/WebKit/Source/core/paint/VideoPainter.cpp |
@@ -12,6 +12,8 @@ |
#include "core/paint/LayoutObjectDrawingRecorder.h" |
#include "core/paint/PaintInfo.h" |
#include "platform/geometry/LayoutPoint.h" |
+#include "platform/graphics/ColorSpaceProfile.h" |
+#include "platform/graphics/GraphicsScreen.h" |
#include "platform/graphics/paint/ClipRecorder.h" |
namespace blink { |
@@ -40,6 +42,8 @@ void VideoPainter::paintReplaced(const PaintInfo& paintInfo, const LayoutPoint& |
if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(context, m_layoutVideo, paintInfo.phase, paintOffset)) |
return; |
+ RELEASE_ASSERT(currentScreenId()); // There should be an active graphics screen. |
+ |
LayoutObjectDrawingRecorder drawingRecorder(context, m_layoutVideo, paintInfo.phase, contentRect, paintOffset); |
// Video frames are only painted in software for printing or capturing node images via web APIs. |
@@ -50,8 +54,9 @@ void VideoPainter::paintReplaced(const PaintInfo& paintInfo, const LayoutPoint& |
ImagePainter(m_layoutVideo).paintIntoRect(context, rect); |
} else { |
SkPaint videoPaint = context.fillPaint(); |
- videoPaint.setColor(SK_ColorBLACK); |
- m_layoutVideo.videoElement()->paintCurrentFrame(context.canvas(), pixelSnappedIntRect(rect), &videoPaint); |
+ videoPaint.setColor(Color::toDeviceColor(Color::black).rgb()); |
+ RefPtr<ColorSpaceProfile> target = screenColorProfile(currentScreenId()); |
+ m_layoutVideo.videoElement()->paintCurrentFrame(context.canvas(), pixelSnappedIntRect(rect), &videoPaint, target.get()); |
} |
} |