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

Unified Diff: Source/core/paint/DeprecatedPaintLayer.cpp

Issue 1315303009: Cleanup DeprecatedPaintLayer::physicalBoundingBox() and derivatives (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 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
« no previous file with comments | « Source/core/paint/DeprecatedPaintLayer.h ('k') | Source/core/paint/DeprecatedPaintLayerPainter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/paint/DeprecatedPaintLayer.cpp
diff --git a/Source/core/paint/DeprecatedPaintLayer.cpp b/Source/core/paint/DeprecatedPaintLayer.cpp
index fa3dcaebe2d009b85db04ad1fd94d96cc4acfe30..561020b810667e0304e8f6c13af08d4f3a715cec 100644
--- a/Source/core/paint/DeprecatedPaintLayer.cpp
+++ b/Source/core/paint/DeprecatedPaintLayer.cpp
@@ -1413,7 +1413,7 @@ void DeprecatedPaintLayer::collectFragments(DeprecatedPaintLayerFragments& fragm
outlineRectInFlowThread, &offsetWithinPaginatedLayer);
// Take our bounding box within the flow thread and clip it.
- LayoutRect layerBoundingBoxInFlowThread = layerBoundingBox ? *layerBoundingBox : physicalBoundingBox(enclosingPaginationLayer(), &offsetWithinPaginatedLayer);
+ LayoutRect layerBoundingBoxInFlowThread = layerBoundingBox ? *layerBoundingBox : physicalBoundingBox(offsetWithinPaginatedLayer);
layerBoundingBoxInFlowThread.intersect(backgroundRectInFlowThread.rect());
// Make the dirty rect relative to the fragmentation context (multicol container, etc.).
@@ -2030,7 +2030,7 @@ bool DeprecatedPaintLayer::hasBlockSelectionGapBounds() const
return toLayoutBlock(layoutObject())->shouldPaintSelectionGaps();
}
-bool DeprecatedPaintLayer::intersectsDamageRect(const LayoutRect& layerBounds, const LayoutRect& damageRect, const DeprecatedPaintLayer* rootLayer, const LayoutPoint* offsetFromRoot) const
+bool DeprecatedPaintLayer::intersectsDamageRect(const LayoutRect& layerBounds, const LayoutRect& damageRect, const LayoutPoint& offsetFromRoot) const
{
// Always examine the canvas and the root.
// FIXME: Could eliminate the isDocumentElement() check if we fix background painting so that the LayoutView
@@ -2049,7 +2049,7 @@ bool DeprecatedPaintLayer::intersectsDamageRect(const LayoutRect& layerBounds, c
// Otherwise we need to compute the bounding box of this single layer and see if it intersects
// the damage rect.
- return physicalBoundingBox(rootLayer, offsetFromRoot).intersects(damageRect);
+ return physicalBoundingBox(offsetFromRoot).intersects(damageRect);
}
LayoutRect DeprecatedPaintLayer::logicalBoundingBox() const
@@ -2098,13 +2098,17 @@ static inline LayoutRect flippedLogicalBoundingBox(LayoutRect boundingBox, Layou
return result;
}
-LayoutRect DeprecatedPaintLayer::physicalBoundingBox(const DeprecatedPaintLayer* ancestorLayer, const LayoutPoint* offsetFromRoot) const
+LayoutRect DeprecatedPaintLayer::physicalBoundingBox(const DeprecatedPaintLayer* ancestorLayer) const
+{
+ LayoutPoint offsetFromRoot;
+ convertToLayerCoords(ancestorLayer, offsetFromRoot);
+ return physicalBoundingBox(offsetFromRoot);
+}
+
+LayoutRect DeprecatedPaintLayer::physicalBoundingBox(const LayoutPoint& offsetFromRoot) const
{
LayoutRect result = flippedLogicalBoundingBox(logicalBoundingBox(), layoutObject());
- if (offsetFromRoot)
- result.moveBy(*offsetFromRoot);
- else
- convertToLayerCoords(ancestorLayer, result);
+ result.moveBy(offsetFromRoot);
return result;
}
@@ -2149,10 +2153,9 @@ static void expandRectForReflectionAndStackingChildren(const DeprecatedPaintLaye
}
}
-LayoutRect DeprecatedPaintLayer::physicalBoundingBoxIncludingReflectionAndStackingChildren(const DeprecatedPaintLayer* ancestorLayer, const LayoutPoint& offsetFromRoot) const
+LayoutRect DeprecatedPaintLayer::physicalBoundingBoxIncludingReflectionAndStackingChildren(const LayoutPoint& offsetFromRoot) const
{
- LayoutPoint origin;
- LayoutRect result = physicalBoundingBox(ancestorLayer, &origin);
+ LayoutRect result = physicalBoundingBox(LayoutPoint());
const_cast<DeprecatedPaintLayer*>(this)->stackingNode()->updateLayerListsIfNeeded();
@@ -2187,8 +2190,7 @@ LayoutRect DeprecatedPaintLayer::boundingBoxForCompositing(const DeprecatedPaint
LayoutRect result = clipper().localClipRect();
// TODO(chrishtr): avoid converting to IntRect and back.
if (result == LayoutRect(LayoutRect::infiniteIntRect())) {
- LayoutPoint origin;
- result = physicalBoundingBox(ancestorLayer, &origin);
+ result = physicalBoundingBox(LayoutPoint());
const_cast<DeprecatedPaintLayer*>(this)->stackingNode()->updateLayerListsIfNeeded();
« no previous file with comments | « Source/core/paint/DeprecatedPaintLayer.h ('k') | Source/core/paint/DeprecatedPaintLayerPainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698