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

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

Issue 209003014: update3dRenderingContext is 13.5% of GraphicsLayerUpdater::rebuildTree (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Account for crazy code Created 6 years, 9 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
« no previous file with comments | « Source/core/rendering/RenderLayer.h ('k') | Source/core/rendering/RenderObject.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderLayer.cpp
diff --git a/Source/core/rendering/RenderLayer.cpp b/Source/core/rendering/RenderLayer.cpp
index c950a88bc770c47aee98a539f26740dec48e8ef5..fe0e8371b1a18b1c322d3ff77bde24d91e0daa9e 100644
--- a/Source/core/rendering/RenderLayer.cpp
+++ b/Source/core/rendering/RenderLayer.cpp
@@ -136,7 +136,6 @@ RenderLayer::RenderLayer(RenderLayerModelObject* renderer, LayerType type)
, m_staticInlinePosition(0)
, m_staticBlockPosition(0)
, m_enclosingPaginationLayer(0)
- , m_3dRenderingContextRoot(0)
, m_groupedMapping(0)
, m_repainter(renderer)
, m_clipper(renderer)
@@ -562,20 +561,24 @@ void RenderLayer::updateTransform()
dirty3DTransformedDescendantStatus();
}
-// Note: this function assumes that all ancestors have an updated 3d rendering context root.
-void RenderLayer::update3dRenderingContext()
+static RenderLayer* enclosingLayerForContainingBlock(RenderLayer* layer)
{
- m_3dRenderingContextRoot = 0;
+ if (RenderObject* containingBlock = layer->renderer()->containingBlock())
+ return containingBlock->enclosingLayer();
+ return 0;
+}
- if (!shouldFlattenTransform())
- m_3dRenderingContextRoot = this;
+RenderLayer* RenderLayer::renderingContextRoot()
+{
+ RenderLayer* renderingContext = 0;
- if (RenderObject* containingBlock = renderer()->containingBlock()) {
- if (RenderLayer* ancestorLayer = containingBlock->enclosingLayer()) {
- if (!ancestorLayer->shouldFlattenTransform())
- m_3dRenderingContextRoot = ancestorLayer->renderingContextRoot();
- }
- }
+ if (shouldPreserve3D())
+ renderingContext = this;
+
+ for (RenderLayer* current = enclosingLayerForContainingBlock(this); current && current->shouldPreserve3D(); current = enclosingLayerForContainingBlock(current))
+ renderingContext = current;
+
+ return renderingContext;
}
TransformationMatrix RenderLayer::currentTransform(RenderStyle::ApplyTransformOrigin applyOrigin) const
« no previous file with comments | « Source/core/rendering/RenderLayer.h ('k') | Source/core/rendering/RenderObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698