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

Unified Diff: Source/core/rendering/RenderLayerCompositor.cpp

Issue 22454003: Support subtitles for native fullscreen video (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: enabling layout tests Created 7 years, 3 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: Source/core/rendering/RenderLayerCompositor.cpp
diff --git a/Source/core/rendering/RenderLayerCompositor.cpp b/Source/core/rendering/RenderLayerCompositor.cpp
index ca69154269837eb9da2c96fe8b1737e383ef9467..2d4ef90336cd3670496718175e6089ef3fff081c 100644
--- a/Source/core/rendering/RenderLayerCompositor.cpp
+++ b/Source/core/rendering/RenderLayerCompositor.cpp
@@ -29,6 +29,7 @@
#include "CSSPropertyNames.h"
#include "HTMLNames.h"
+#include "RuntimeEnabledFeatures.h"
#include "core/dom/NodeList.h"
#include "core/html/HTMLCanvasElement.h"
#include "core/html/HTMLIFrameElement.h"
@@ -229,6 +230,7 @@ RenderLayerCompositor::RenderLayerCompositor(RenderView* renderView)
, m_needsUpdateCompositingRequirementsState(false)
, m_isTrackingRepaints(false)
, m_rootLayerAttachment(RootLayerUnattached)
+ , m_currentFullscreenRenderer(0)
#if !LOG_DISABLED
, m_rootLayerUpdateCount(0)
, m_obligateCompositedLayerCount(0)
@@ -446,6 +448,14 @@ void RenderLayerCompositor::updateCompositingLayers(CompositingUpdateType update
// Host the document layer in the RenderView's root layer.
if (isFullUpdate) {
+ if (RuntimeEnabledFeatures::overlayFullscreenVideoEnabled() && m_currentFullscreenRenderer && m_currentFullscreenRenderer->isMedia()) {
+ RenderLayerModelObject* renderer = toRenderLayerModelObject(m_currentFullscreenRenderer);
esprehn 2013/09/13 02:46:07 SVG elements can never be full screen? They're not
trchen 2013/09/13 05:14:58 This special code path only applies for RenderMedi
+ RenderLayerBacking* backing = renderer->layer() ? renderer->layer()->backing() : 0;
esprehn 2013/09/13 02:46:07 You should just add a method to RenderLayerModelOb
trchen 2013/09/13 05:14:58 Done.
+ if (backing) {
+ childList.clear();
+ childList.append(backing->graphicsLayer());
+ }
+ }
// Even when childList is empty, don't drop out of compositing mode if there are
// composited layers that we didn't hit in our traversal (e.g. because of visibility:hidden).
if (childList.isEmpty() && !hasAnyAdditionalCompositedLayers(updateRoot))
@@ -1835,6 +1845,9 @@ bool RenderLayerCompositor::requiresCompositingForTransform(RenderObject* render
bool RenderLayerCompositor::requiresCompositingForVideo(RenderObject* renderer) const
{
+ if (RuntimeEnabledFeatures::overlayFullscreenVideoEnabled() && renderer->isVideo() && renderer == m_currentFullscreenRenderer)
+ return true;
+
if (!(m_compositingTriggers & ChromeClient::VideoTrigger))
return false;
@@ -2761,4 +2774,13 @@ String RenderLayerCompositor::debugName(const GraphicsLayer* graphicsLayer)
return name;
}
+void RenderLayerCompositor::setCurrentFullscreenRenderer(RenderObject* renderer)
+{
+ if (renderer == m_currentFullscreenRenderer)
+ return;
+ m_currentFullscreenRenderer = renderer;
esprehn 2013/09/13 02:46:07 I'm not a fan of keeping RenderObjects across fram
trchen 2013/09/13 05:14:58 That is one alternative way I have thought about.
+ if (RuntimeEnabledFeatures::overlayFullscreenVideoEnabled() && (!renderer || renderer->isVideo()))
+ setCompositingLayersNeedRebuild(true);
+}
+
} // namespace WebCore

Powered by Google App Engine
This is Rietveld 408576698