Diff
Modified: branches/safari-537.73-branch/Source/WebCore/ChangeLog (158022 => 158023)
--- branches/safari-537.73-branch/Source/WebCore/ChangeLog 2013-10-25 18:01:50 UTC (rev 158022)
+++ branches/safari-537.73-branch/Source/WebCore/ChangeLog 2013-10-25 18:02:21 UTC (rev 158023)
@@ -1,5 +1,40 @@
2013-10-25 Lucas Forschler <lforsch...@apple.com>
+ Merge r154914
+
+ 2013-08-30 Brent Fulgham <bfulg...@apple.com>
+
+ [Windows] Vide element in page always uses non-hw accelerated mode.
+ https://bugs.webkit.org/show_bug.cgi?id=120448
+
+ Reviewed by Darin Adler
+
+ This patch is unfortunately larger than my original idea, but seems to make the
+ layout system happier. Instead of switching into composited mode when building
+ the media player, we now build the original layout tree with compositing active
+ if the underlying media element requires it. The AVFoundationCF player needs to
+ have the compositor available at construction time so it can attach to the
+ rendering device. Otherwise it falls back to CPU-only mode.
+
+ * platform/graphics/MediaPlayer.cpp:
+ (WebCore::MediaPlayer::requiresImmediateCompositing): Added
+ * platform/graphics/MediaPlayer.h:
+ * platform/graphics/MediaPlayerPrivate.h:
+ (WebCore::MediaPlayerPrivateInterface::requiresImmediateCompositing): Added
+ * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
+ (WebCore::MediaPlayerPrivateAVFoundationCF::createAVPlayer): Added
+ * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h:
+ (WebCore::MediaPlayerPrivateAVFoundationCF::requiresImmediateCompositing):
+ * rendering/RenderLayerCompositor.cpp:
+ (WebCore::RenderLayerCompositor::requiresCompositingForVideo): Uses new
+ 'requiresImmediateCompositing' to short-circuit check for whether a
+ compositor is required.
+ * rendering/RenderVideo.cpp:
+ (WebCore::RenderVideo::requiresImmediateCompositing):
+ * rendering/RenderVideo.h:
+
+2013-10-25 Lucas Forschler <lforsch...@apple.com>
+
Merge r154890
2013-08-30 Brent Fulgham <bfulg...@apple.com>
Modified: branches/safari-537.73-branch/Source/WebCore/platform/graphics/MediaPlayer.cpp (158022 => 158023)
--- branches/safari-537.73-branch/Source/WebCore/platform/graphics/MediaPlayer.cpp 2013-10-25 18:01:50 UTC (rev 158022)
+++ branches/safari-537.73-branch/Source/WebCore/platform/graphics/MediaPlayer.cpp 2013-10-25 18:02:21 UTC (rev 158023)
@@ -562,6 +562,11 @@
return m_private->supportsScanning();
}
+bool MediaPlayer::requiresImmediateCompositing() const
+{
+ return m_private->requiresImmediateCompositing();
+}
+
IntSize MediaPlayer::naturalSize()
{
return m_private->naturalSize();
Modified: branches/safari-537.73-branch/Source/WebCore/platform/graphics/MediaPlayer.h (158022 => 158023)
--- branches/safari-537.73-branch/Source/WebCore/platform/graphics/MediaPlayer.h 2013-10-25 18:01:50 UTC (rev 158022)
+++ branches/safari-537.73-branch/Source/WebCore/platform/graphics/MediaPlayer.h 2013-10-25 18:02:21 UTC (rev 158023)
@@ -262,6 +262,7 @@
bool supportsFullscreen() const;
bool supportsSave() const;
bool supportsScanning() const;
+ bool requiresImmediateCompositing() const;
PlatformMedia platformMedia() const;
#if USE(ACCELERATED_COMPOSITING)
PlatformLayer* platformLayer() const;
Modified: branches/safari-537.73-branch/Source/WebCore/platform/graphics/MediaPlayerPrivate.h (158022 => 158023)
--- branches/safari-537.73-branch/Source/WebCore/platform/graphics/MediaPlayerPrivate.h 2013-10-25 18:01:50 UTC (rev 158022)
+++ branches/safari-537.73-branch/Source/WebCore/platform/graphics/MediaPlayerPrivate.h 2013-10-25 18:02:21 UTC (rev 158023)
@@ -62,6 +62,7 @@
virtual bool supportsFullscreen() const { return false; }
virtual bool supportsSave() const { return false; }
virtual bool supportsScanning() const { return false; }
+ virtual bool requiresImmediateCompositing() const { return false; }
virtual IntSize naturalSize() const = 0;
Modified: branches/safari-537.73-branch/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp (158022 => 158023)
--- branches/safari-537.73-branch/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp 2013-10-25 18:01:50 UTC (rev 158022)
+++ branches/safari-537.73-branch/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp 2013-10-25 18:02:21 UTC (rev 158023)
@@ -401,15 +401,7 @@
ASSERT(m_avfWrapper);
setDelayCallbacks(true);
-
- IDirect3DDevice9* device = reinterpret_cast<IDirect3DDevice9*>(player()->graphicsDeviceAdapter());
- if (!device) {
- player()->frameView()->enterCompositingMode();
- player()->mediaPlayerClient()->mediaPlayerRenderingModeChanged(player());
- device = reinterpret_cast<IDirect3DDevice9*>(player()->graphicsDeviceAdapter());
- }
-
- m_avfWrapper->createPlayer(device);
+ m_avfWrapper->createPlayer(reinterpret_cast<IDirect3DDevice9*>(player()->graphicsDeviceAdapter()));
setDelayCallbacks(false);
}
Modified: branches/safari-537.73-branch/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h (158022 => 158023)
--- branches/safari-537.73-branch/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h 2013-10-25 18:01:50 UTC (rev 158022)
+++ branches/safari-537.73-branch/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h 2013-10-25 18:02:21 UTC (rev 158023)
@@ -85,6 +85,7 @@
virtual float platformMaxTimeLoaded() const;
virtual void beginLoadingMetadata();
virtual void sizeChanged();
+ virtual bool requiresImmediateCompositing() const { return true; }
virtual bool hasAvailableVideoFrame() const;
Modified: branches/safari-537.73-branch/Source/WebCore/rendering/RenderLayerCompositor.cpp (158022 => 158023)
--- branches/safari-537.73-branch/Source/WebCore/rendering/RenderLayerCompositor.cpp 2013-10-25 18:01:50 UTC (rev 158022)
+++ branches/safari-537.73-branch/Source/WebCore/rendering/RenderLayerCompositor.cpp 2013-10-25 18:02:21 UTC (rev 158023)
@@ -2060,7 +2060,7 @@
#if ENABLE(VIDEO)
if (renderer->isVideo()) {
RenderVideo* video = toRenderVideo(renderer);
- return video->shouldDisplayVideo() && canAccelerateVideoRendering(video);
+ return (video->requiresImmediateCompositing() || video->shouldDisplayVideo()) && canAccelerateVideoRendering(video);
}
#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
else if (renderer->isRenderPart()) {
Modified: branches/safari-537.73-branch/Source/WebCore/rendering/RenderVideo.cpp (158022 => 158023)
--- branches/safari-537.73-branch/Source/WebCore/rendering/RenderVideo.cpp 2013-10-25 18:01:50 UTC (rev 158022)
+++ branches/safari-537.73-branch/Source/WebCore/rendering/RenderVideo.cpp 2013-10-25 18:02:21 UTC (rev 158023)
@@ -296,6 +296,12 @@
}
#endif // USE(ACCELERATED_COMPOSITING)
+bool RenderVideo::requiresImmediateCompositing() const
+{
+ MediaPlayer* p = mediaElement()->player();
+ return p ? p->requiresImmediateCompositing() : false;
+}
+
#if ENABLE(FULLSCREEN_API)
static const RenderBlock* rendererPlaceholder(const RenderObject* renderer)
{
Modified: branches/safari-537.73-branch/Source/WebCore/rendering/RenderVideo.h (158022 => 158023)
--- branches/safari-537.73-branch/Source/WebCore/rendering/RenderVideo.h 2013-10-25 18:01:50 UTC (rev 158022)
+++ branches/safari-537.73-branch/Source/WebCore/rendering/RenderVideo.h 2013-10-25 18:02:21 UTC (rev 158023)
@@ -49,6 +49,8 @@
void acceleratedRenderingStateChanged();
#endif
+ bool requiresImmediateCompositing() const;
+
virtual bool shouldDisplayVideo() const;
private: