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

Unified Diff: Source/core/rendering/compositing/GraphicsLayerTreeBuilder.cpp

Issue 319183006: Move GraphicsLayerUpdater::rebuildTree into its own file (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 6 years, 6 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/compositing/GraphicsLayerTreeBuilder.cpp
diff --git a/Source/core/rendering/compositing/GraphicsLayerUpdater.cpp b/Source/core/rendering/compositing/GraphicsLayerTreeBuilder.cpp
similarity index 62%
copy from Source/core/rendering/compositing/GraphicsLayerUpdater.cpp
copy to Source/core/rendering/compositing/GraphicsLayerTreeBuilder.cpp
index d14328c0bcf75cac1f6f8089873726a67e70e13c..0f930b0dedf7e600941b19ecaf93c9f76cdc0215 100644
--- a/Source/core/rendering/compositing/GraphicsLayerUpdater.cpp
+++ b/Source/core/rendering/compositing/GraphicsLayerTreeBuilder.cpp
@@ -25,17 +25,26 @@
*/
#include "config.h"
-#include "core/rendering/compositing/GraphicsLayerUpdater.h"
+#include "core/rendering/compositing/GraphicsLayerTreeBuilder.h"
#include "core/html/HTMLMediaElement.h"
#include "core/rendering/RenderLayer.h"
#include "core/rendering/RenderLayerReflectionInfo.h"
#include "core/rendering/RenderPart.h"
+#include "core/rendering/RenderView.h"
#include "core/rendering/compositing/CompositedLayerMapping.h"
#include "core/rendering/compositing/RenderLayerCompositor.h"
namespace WebCore {
+GraphicsLayerTreeBuilder::GraphicsLayerTreeBuilder()
+{
+}
+
+GraphicsLayerTreeBuilder::~GraphicsLayerTreeBuilder()
+{
+}
+
static bool shouldAppendLayer(const RenderLayer& layer)
{
if (!RuntimeEnabledFeatures::overlayFullscreenVideoEnabled())
@@ -46,33 +55,7 @@ static bool shouldAppendLayer(const RenderLayer& layer)
return true;
}
-GraphicsLayerUpdater::UpdateContext::UpdateContext(const UpdateContext& other, const RenderLayer& layer)
- : m_compositingStackingContext(other.m_compositingStackingContext)
- , m_compositingAncestor(other.compositingContainer(layer))
-{
- CompositingState compositingState = layer.compositingState();
- if (compositingState != NotComposited && compositingState != PaintsIntoGroupedBacking) {
- m_compositingAncestor = &layer;
- if (layer.stackingNode()->isStackingContext())
- m_compositingStackingContext = &layer;
- }
-}
-
-const RenderLayer* GraphicsLayerUpdater::UpdateContext::compositingContainer(const RenderLayer& layer) const
-{
- return layer.stackingNode()->isNormalFlowOnly() ? m_compositingAncestor : m_compositingStackingContext;
-}
-
-GraphicsLayerUpdater::GraphicsLayerUpdater()
- : m_needsRebuildTree(false)
-{
-}
-
-GraphicsLayerUpdater::~GraphicsLayerUpdater()
-{
-}
-
-void GraphicsLayerUpdater::rebuildTree(RenderLayer& layer, GraphicsLayerVector& childLayersOfEnclosingLayer)
+void GraphicsLayerTreeBuilder::rebuild(RenderLayer& layer, GraphicsLayerVector& childLayersOfEnclosingLayer)
{
// Make the layer compositing if necessary, and set up clipping and content layers.
// Note that we can only do work here that is independent of whether the descendant layers
@@ -95,7 +78,7 @@ void GraphicsLayerUpdater::rebuildTree(RenderLayer& layer, GraphicsLayerVector&
if (layer.stackingNode()->isStackingContext()) {
RenderLayerStackingNodeIterator iterator(*layer.stackingNode(), NegativeZOrderChildren);
while (RenderLayerStackingNode* curNode = iterator.next())
- rebuildTree(*curNode->layer(), childList);
+ rebuild(*curNode->layer(), childList);
// If a negative z-order child is compositing, we get a foreground layer which needs to get parented.
if (hasCompositedLayerMapping && currentCompositedLayerMapping->foregroundLayer())
@@ -104,7 +87,7 @@ void GraphicsLayerUpdater::rebuildTree(RenderLayer& layer, GraphicsLayerVector&
RenderLayerStackingNodeIterator iterator(*layer.stackingNode(), NormalFlowChildren | PositiveZOrderChildren);
while (RenderLayerStackingNode* curNode = iterator.next())
- rebuildTree(*curNode->layer(), childList);
+ rebuild(*curNode->layer(), childList);
if (hasCompositedLayerMapping) {
bool parented = false;
@@ -138,56 +121,4 @@ void GraphicsLayerUpdater::rebuildTree(RenderLayer& layer, GraphicsLayerVector&
}
}
-void GraphicsLayerUpdater::update(RenderLayer& layer, UpdateType updateType, const UpdateContext& context)
-{
- if (layer.hasCompositedLayerMapping()) {
- CompositedLayerMappingPtr mapping = layer.compositedLayerMapping();
-
- const RenderLayer* compositingContainer = context.compositingContainer(layer);
- ASSERT(compositingContainer == layer.ancestorCompositingLayer());
- if (mapping->updateRequiresOwnBackingStoreForAncestorReasons(compositingContainer))
- updateType = ForceUpdate;
-
- // Note carefully: here we assume that the compositing state of all descendants have been updated already,
- // so it is legitimate to compute and cache the composited bounds for this layer.
- mapping->updateCompositedBounds(updateType);
-
- if (RenderLayerReflectionInfo* reflection = layer.reflectionInfo()) {
- if (reflection->reflectionLayer()->hasCompositedLayerMapping())
- reflection->reflectionLayer()->compositedLayerMapping()->updateCompositedBounds(ForceUpdate);
- }
-
- if (mapping->updateGraphicsLayerConfiguration(updateType))
- m_needsRebuildTree = true;
-
- mapping->updateGraphicsLayerGeometry(updateType, compositingContainer);
-
- updateType = mapping->updateTypeForChildren(updateType);
- mapping->clearNeedsGraphicsLayerUpdate();
-
- if (!layer.parent())
- layer.compositor()->updateRootLayerPosition();
-
- if (mapping->hasUnpositionedOverflowControlsLayers())
- layer.scrollableArea()->positionOverflowControls();
- }
-
- UpdateContext childContext(context, layer);
- for (RenderLayer* child = layer.firstChild(); child; child = child->nextSibling())
- update(*child, updateType, childContext);
-}
-
-#if !ASSERT_DISABLED
-
-void GraphicsLayerUpdater::assertNeedsToUpdateGraphicsLayerBitsCleared(RenderLayer& layer)
-{
- if (layer.hasCompositedLayerMapping())
- layer.compositedLayerMapping()->assertNeedsToUpdateGraphicsLayerBitsCleared();
-
- for (RenderLayer* child = layer.firstChild(); child; child = child->nextSibling())
- assertNeedsToUpdateGraphicsLayerBitsCleared(*child);
}
-
-#endif
-
-} // namespace WebCore

Powered by Google App Engine
This is Rietveld 408576698