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

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

Issue 612323011: Use fragmented bounding box for hit-test/paint clipping. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Undid renaming 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
« no previous file with comments | « 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 9c306c9dd320254c78ad2ed96a6a0be03fe7c60c..da440277905c6bf9a882a0004d5de271e31ac01d 100644
--- a/Source/core/rendering/RenderLayer.cpp
+++ b/Source/core/rendering/RenderLayer.cpp
@@ -1140,7 +1140,7 @@ LayoutRect RenderLayer::transparencyClipBox(const RenderLayer* layer, const Rend
return result;
}
- LayoutRect clipRect = layer->physicalBoundingBox(rootLayer);
+ LayoutRect clipRect = layer->fragmentsBoundingBox(rootLayer);
expandClipRectForDescendantsAndReflection(clipRect, layer, rootLayer, transparencyBehavior, subPixelAccumulation, paintBehavior);
layer->renderer()->style()->filterOutsets().expandRect(clipRect);
clipRect.move(subPixelAccumulation);
@@ -1412,7 +1412,7 @@ void RenderLayer::convertToLayerCoords(const RenderLayer* ancestorLayer, LayoutR
{
LayoutPoint delta;
convertToLayerCoords(ancestorLayer, delta);
- rect.move(-delta.x(), -delta.y());
+ rect.moveBy(delta);
}
void RenderLayer::didUpdateNeedsCompositedScrolling()
@@ -2225,21 +2225,42 @@ LayoutRect RenderLayer::logicalBoundingBox() const
return result;
}
-LayoutRect RenderLayer::physicalBoundingBox(const RenderLayer* ancestorLayer, const LayoutPoint* offsetFromRoot) const
+LayoutRect RenderLayer::flippedLogicalBoundingBox() const
{
LayoutRect result = logicalBoundingBox();
if (m_renderer->isBox())
renderBox()->flipForWritingMode(result);
else
m_renderer->containingBlock()->flipForWritingMode(result);
+ return result;
+}
- LayoutPoint delta;
+LayoutRect RenderLayer::physicalBoundingBox(const RenderLayer* ancestorLayer, const LayoutPoint* offsetFromRoot) const
+{
+ LayoutRect result = flippedLogicalBoundingBox();
if (offsetFromRoot)
- delta = *offsetFromRoot;
+ result.moveBy(*offsetFromRoot);
else
- convertToLayerCoords(ancestorLayer, delta);
+ convertToLayerCoords(ancestorLayer, result);
+ return result;
+}
- result.moveBy(delta);
+LayoutRect RenderLayer::fragmentsBoundingBox(const RenderLayer* ancestorLayer) const
+{
+ if (!enclosingPaginationLayer())
+ return physicalBoundingBox(ancestorLayer);
+
+ LayoutRect result = flippedLogicalBoundingBox();
+
+ // Split our box up into the actual fragment boxes that render in the columns/pages and unite those together to
+ // get our true bounding box.
+ LayoutPoint offsetWithinPaginationLayer;
+ convertToLayerCoords(enclosingPaginationLayer(), offsetWithinPaginationLayer);
+ result.moveBy(offsetWithinPaginationLayer);
+
+ RenderFlowThread* enclosingFlowThread = toRenderFlowThread(enclosingPaginationLayer()->renderer());
+ result = enclosingFlowThread->fragmentsBoundingBox(result);
+ enclosingPaginationLayer()->convertToLayerCoords(ancestorLayer, result);
return result;
}
« no previous file with comments | « Source/core/rendering/RenderLayer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698