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

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: remove extre line break 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') | no next file with comments »
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 2937978cdc92b34346d4687c435135a0070755ff..e23fef34024e724b308d20bacca25b85d241dcc4 100644
--- a/Source/core/rendering/RenderLayer.h
+++ b/Source/core/rendering/RenderLayer.h
@@ -298,10 +298,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(); }
@@ -484,6 +480,10 @@ public:
void clearAncestorDependentPropertyCache();
+ const IntRect& absoluteBoundingBox() { ASSERT(!m_needsToRecomputeBounds); return m_absoluteBoundingBox; }
+ void setAbsoluteBoundingBox(const IntRect&);
+ void clearNeedsToRecomputeBounds();
+ bool needsToRecomputeBounds() { return m_needsToRecomputeBounds; }
private:
class AncestorDependentPropertyCache {
@@ -510,6 +510,9 @@ private:
void ensureAncestorDependentPropertyCache() const;
+ // Bounding box in the coordinates of this layer.
+ LayoutRect localBoundingBox(CalculateLayerBoundsFlags = 0) const;
+
bool hasOverflowControls() const;
void setIsUnclippedDescendant(bool isUnclippedDescendant) { m_isUnclippedDescendant = isUnclippedDescendant; }
@@ -710,6 +713,7 @@ private:
const unsigned m_canSkipRepaintRectsUpdateOnScroll : 1;
unsigned m_hasFilterInfo : 1;
+ unsigned m_needsToRecomputeBounds : 1;
RenderLayerModelObject* m_renderer;
@@ -732,6 +736,8 @@ private:
LayoutUnit m_staticInlinePosition;
LayoutUnit m_staticBlockPosition;
+ IntRect m_absoluteBoundingBox;
+
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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698