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 dbeece3f8d8d5f1da7abb1610b9b5f3e8b8f206b..49ea54a6bbfed97026e035d2de081d3d9ca54d78 100644 |
--- a/third_party/WebKit/Source/core/paint/VideoPainter.cpp |
+++ b/third_party/WebKit/Source/core/paint/VideoPainter.cpp |
@@ -13,6 +13,7 @@ |
#include "core/paint/PaintInfo.h" |
#include "platform/geometry/LayoutPoint.h" |
#include "platform/graphics/paint/ClipRecorder.h" |
+#include "platform/graphics/paint/ForeignLayerDisplayItem.h" |
namespace blink { |
@@ -39,11 +40,25 @@ void VideoPainter::paintReplaced(const PaintInfo& paintInfo, const LayoutPoint& |
if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(context, m_layoutVideo, paintInfo.phase)) |
return; |
- LayoutObjectDrawingRecorder drawingRecorder(context, m_layoutVideo, paintInfo.phase, contentRect); |
// Video frames are only painted in software for printing or capturing node images via web APIs. |
bool forceSoftwareVideoPaint = paintInfo.getGlobalPaintFlags() & GlobalPaintFlattenCompositingLayers; |
+ bool paintWithForeignLayer = |
+ !displayingPoster && !forceSoftwareVideoPaint |
+ && RuntimeEnabledFeatures::slimmingPaintV2Enabled(); |
+ if (paintWithForeignLayer) { |
+ if (WebLayer* layer = m_layoutVideo.mediaElement()->platformLayer()) { |
+ IntRect pixelSnappedRect = pixelSnappedIntRect(contentRect); |
+ recordForeignLayer( |
pdr.
2016/07/06 23:30:37
Wdyt about changing recordForeignLayer to take an
|
+ context, m_layoutVideo, DisplayItem::ForeignLayerVideo, layer, |
+ pixelSnappedRect.location(), pixelSnappedRect.size()); |
+ return; |
+ } |
+ } |
+ |
+ LayoutObjectDrawingRecorder drawingRecorder(context, m_layoutVideo, paintInfo.phase, contentRect); |
+ |
if (displayingPoster || !forceSoftwareVideoPaint) { |
// This will display the poster image, if one is present, and otherwise paint nothing. |
ImagePainter(m_layoutVideo).paintIntoRect(context, rect); |