Index: Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp |
=================================================================== |
--- Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp (revision 78002) |
+++ Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp (working copy) |
@@ -397,6 +397,17 @@ |
void WebMediaPlayerClientImpl::paint(GraphicsContext* context, const IntRect& rect) |
{ |
+#if USE(ACCELERATED_COMPOSITING) |
+ // If we are using GPU to render video, ignore requests to paint frames into |
+ // canvas because it will be taken care of by VideoLayerChromium. |
+ if (acceleratedRenderingInUse()) |
+ return; |
+#endif |
+ paintCurrentFrameInContext(context, rect); |
+} |
+ |
+void WebMediaPlayerClientImpl::paintCurrentFrameInContext(GraphicsContext* context, const IntRect& rect) |
+{ |
// Normally GraphicsContext operations do nothing when painting is disabled. |
// Since we're accessing platformContext() directly we have to manually |
// check. |
@@ -445,6 +456,11 @@ |
return m_supportsAcceleratedCompositing; |
} |
+bool WebMediaPlayerClientImpl::acceleratedRenderingInUse() |
+{ |
+ return m_videoLayer.get() && m_videoLayer->layerRenderer(); |
+} |
+ |
VideoFrameChromium* WebMediaPlayerClientImpl::getCurrentFrame() |
{ |
VideoFrameChromium* videoFrame = 0; |