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

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

Issue 669803002: Optimize for horizontal writing mode (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 2 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
« Source/core/rendering/RenderBox.h ('K') | « Source/core/rendering/RenderLayer.h ('k') | no next file » | 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 99e2c5dddab1c8fa92c297fa344fa40f9dda6a6a..06051c9ac04807c3a4d95ec7f79a0fd7ba0b16c6 100644
--- a/Source/core/rendering/RenderLayer.cpp
+++ b/Source/core/rendering/RenderLayer.cpp
@@ -2249,19 +2249,22 @@ LayoutRect RenderLayer::logicalBoundingBox() const
return result;
}
-LayoutRect RenderLayer::flippedLogicalBoundingBox() const
+static inline LayoutRect flippedLogicalBoundingBox(LayoutRect boundingBox, RenderObject* renderer)
pdr. 2014/10/21 22:11:26 I don't understand the purpose of making this a st
eae 2014/10/21 22:21:46 Allows it to be inlined easier. It is a very hot f
pdr. 2014/10/21 22:38:15 Could we just make this inline then?
{
- LayoutRect result = logicalBoundingBox();
- if (m_renderer->isBox())
- renderBox()->flipForWritingMode(result);
+ if (!UNLIKELY(renderer->document().hasVerticalWritingMode()))
+ return boundingBox;
+
+ LayoutRect result = boundingBox;
+ if (renderer->isBox())
+ toRenderBox(renderer)->flipForWritingMode(result);
else
- m_renderer->containingBlock()->flipForWritingMode(result);
+ renderer->containingBlock()->flipForWritingMode(result);
return result;
}
LayoutRect RenderLayer::physicalBoundingBox(const RenderLayer* ancestorLayer, const LayoutPoint* offsetFromRoot) const
{
- LayoutRect result = flippedLogicalBoundingBox();
+ LayoutRect result = flippedLogicalBoundingBox(logicalBoundingBox(), renderer());
if (offsetFromRoot)
result.moveBy(*offsetFromRoot);
else
@@ -2274,11 +2277,16 @@ LayoutRect RenderLayer::fragmentsBoundingBox(const RenderLayer* ancestorLayer) c
if (!enclosingPaginationLayer())
return physicalBoundingBox(ancestorLayer);
- LayoutRect result = flippedLogicalBoundingBox();
+ LayoutRect result = flippedLogicalBoundingBox(logicalBoundingBox(), renderer());
convertFromFlowThreadToVisualBoundingBoxInAncestor(this, ancestorLayer, result);
return result;
}
+LayoutRect RenderLayer::boundingBoxForCompositingOverlapTest() const
+{
+ return overlapBoundsIncludeChildren() ? boundingBoxForCompositing() : flippedLogicalBoundingBox(logicalBoundingBox(), renderer());
+}
+
static void expandRectForReflectionAndStackingChildren(const RenderLayer* ancestorLayer, RenderLayer::CalculateBoundsOptions options, LayoutRect& result)
{
if (ancestorLayer->reflectionInfo() && !ancestorLayer->reflectionInfo()->reflectionLayer()->hasCompositedLayerMapping())
« Source/core/rendering/RenderBox.h ('K') | « Source/core/rendering/RenderLayer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698