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

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

Issue 208313004: Cache the absolute bounding box rect on RenderLayer. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: add fixme 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 | « no previous file | Source/core/rendering/RenderLayer.cpp » ('j') | Source/core/rendering/RenderLayer.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderLayer.h
diff --git a/Source/core/rendering/RenderLayer.h b/Source/core/rendering/RenderLayer.h
index cf9654aa369d9899df8cf2db658482a291ef91a7..391dddc3d5eb28cd9ee685c75830c6fbddc6cf21 100644
--- a/Source/core/rendering/RenderLayer.h
+++ b/Source/core/rendering/RenderLayer.h
@@ -299,10 +299,6 @@ public:
// Bounding box relative to some ancestor layer. Pass offsetFromRoot if known.
LayoutRect boundingBox(const RenderLayer* rootLayer, CalculateLayerBoundsFlags = 0, const LayoutPoint* offsetFromRoot = 0) const;
- // Bounding box in the coordinates of this layer.
- LayoutRect localBoundingBox(CalculateLayerBoundsFlags = 0) const;
- // Pixel snapped bounding box relative to the root.
- IntRect absoluteBoundingBox() const;
// Bounds used for layer overlap testing in RenderLayerCompositor.
LayoutRect overlapBounds() const { return overlapBoundsIncludeChildren() ? calculateLayerBounds(this) : localBoundingBox(); }
@@ -479,7 +475,15 @@ public:
bool hasDirectReasonsForCompositing() const { return compositingReasons() & CompositingReasonComboAllDirectReasons; }
+ const IntRect& cachedAbsoluteBoundingBox() { ASSERT(!m_needsToRecomputeBounds); return m_cachedAbsoluteBoundingBox; }
+ void setAbsoluteBoundingBoxForOverlap(const IntRect&);
+ void clearNeedsToRecomputeBounds();
+ bool needsToRecomputeBounds() { return m_needsToRecomputeBounds; }
+
private:
+ // Bounding box in the coordinates of this layer.
+ LayoutRect localBoundingBox(CalculateLayerBoundsFlags = 0) const;
+
bool hasOverflowControls() const;
void setIsUnclippedDescendant(bool isUnclippedDescendant) { m_isUnclippedDescendant = isUnclippedDescendant; }
@@ -682,6 +686,7 @@ private:
const unsigned m_canSkipRepaintRectsUpdateOnScroll : 1;
unsigned m_hasFilterInfo : 1;
+ unsigned m_needsToRecomputeBounds : 1;
RenderLayerModelObject* m_renderer;
@@ -704,6 +709,8 @@ private:
LayoutUnit m_staticInlinePosition;
LayoutUnit m_staticBlockPosition;
+ IntRect m_cachedAbsoluteBoundingBox;
esprehn 2014/03/21 23:28:01 m_absoluteBoundingBox ? cached seems like a detail
ojan 2014/03/22 00:25:43 I guess. I wanted to distinguish from boundingBox.
+
OwnPtr<TransformationMatrix> m_transform;
// Pointer to the enclosing RenderLayer that caused us to be paginated. It is 0 if we are not paginated.
« no previous file with comments | « no previous file | Source/core/rendering/RenderLayer.cpp » ('j') | Source/core/rendering/RenderLayer.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698