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

Unified Diff: third_party/WebKit/Source/core/paint/VideoPainter.cpp

Issue 1331533002: [poc] curve-filter Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix CanvasRenderingContext2D::createPattern crash for #40 Created 4 years, 11 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
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());
}
}
« no previous file with comments | « third_party/WebKit/Source/core/paint/ThemePainterMac.mm ('k') | third_party/WebKit/Source/core/style/ComputedStyle.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698