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

Side by Side Diff: Source/core/rendering/RenderLayer.h

Issue 445263002: Remove cached bounds in RenderLayer. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2003, 2009, 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2003, 2009, 2012 Apple Inc. All rights reserved.
3 * Copyright (C) 2013 Intel Corporation. All rights reserved. 3 * Copyright (C) 2013 Intel Corporation. All rights reserved.
4 * 4 *
5 * Portions are Copyright (C) 1998 Netscape Communications Corporation. 5 * Portions are Copyright (C) 1998 Netscape Communications Corporation.
6 * 6 *
7 * Other contributors: 7 * Other contributors:
8 * Robert O'Callahan <roc+@cs.cmu.edu> 8 * Robert O'Callahan <roc+@cs.cmu.edu>
9 * David Baron <dbaron@fas.harvard.edu> 9 * David Baron <dbaron@fas.harvard.edu>
10 * Christian Biesinger <cbiesinger@web.de> 10 * Christian Biesinger <cbiesinger@web.de>
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 const RenderLayerReflectionInfo* reflectionInfo() const { return m_reflectio nInfo.get(); } 128 const RenderLayerReflectionInfo* reflectionInfo() const { return m_reflectio nInfo.get(); }
129 129
130 const RenderLayer* root() const 130 const RenderLayer* root() const
131 { 131 {
132 const RenderLayer* curr = this; 132 const RenderLayer* curr = this;
133 while (curr->parent()) 133 while (curr->parent())
134 curr = curr->parent(); 134 curr = curr->parent();
135 return curr; 135 return curr;
136 } 136 }
137 137
138 const LayoutPoint& location() const { ASSERT(!m_needsPositionUpdate); return m_location; } 138 const LayoutPoint location() const;
139 // FIXME: size() should ASSERT(!m_needsPositionUpdate) as well, but that fai ls in some tests, 139 const IntSize size() const;
140 // for example, fast/repaint/clipped-relative.html.
141 const IntSize& size() const { return m_size; }
142 void setSizeHackForRenderTreeAsText(const IntSize& size) { m_size = size; }
143 140
144 LayoutRect rect() const { return LayoutRect(location(), size()); } 141 LayoutRect rect() const { return LayoutRect(location(), size()); }
145 142
146 bool isRootLayer() const { return m_isRootLayer; } 143 bool isRootLayer() const { return m_isRootLayer; }
147 144
148 RenderLayerCompositor* compositor() const; 145 RenderLayerCompositor* compositor() const;
149 146
150 // Notification from the renderer that its content changed (e.g. current fra me of image changed). 147 // Notification from the renderer that its content changed (e.g. current fra me of image changed).
151 // Allows updates of layer content without invalidating paint. 148 // Allows updates of layer content without invalidating paint.
152 void contentChanged(ContentChangeType); 149 void contentChanged(ContentChangeType);
153 150
154 void updateLayerPositionsAfterLayout(); 151 void updateLayerPositionsAfterLayout();
155 void updateLayerPositionsAfterOverflowScroll();
156 152
157 bool isPaginated() const { return m_isPaginated; } 153 bool isPaginated() const { return m_isPaginated; }
158 RenderLayer* enclosingPaginationLayer() const { return m_enclosingPagination Layer; } 154 RenderLayer* enclosingPaginationLayer() const { return m_enclosingPagination Layer; }
159 155
160 void updateTransformationMatrix(); 156 void updateTransformationMatrix();
161 RenderLayer* renderingContextRoot(); 157 RenderLayer* renderingContextRoot();
162 158
163 const LayoutSize& offsetForInFlowPosition() const { return m_offsetForInFlow Position; } 159 // Our current relative position offset.
160 const LayoutSize offsetForInFlowPosition() const;
164 161
165 void blockSelectionGapsBoundsChanged(); 162 void blockSelectionGapsBoundsChanged();
166 void addBlockSelectionGapsBounds(const LayoutRect&); 163 void addBlockSelectionGapsBounds(const LayoutRect&);
167 void clearBlockSelectionGapsBounds(); 164 void clearBlockSelectionGapsBounds();
168 void invalidatePaintForBlockSelectionGaps(); 165 void invalidatePaintForBlockSelectionGaps();
169 IntRect blockSelectionGapsBounds() const; 166 IntRect blockSelectionGapsBounds() const;
170 bool hasBlockSelectionGapBounds() const; 167 bool hasBlockSelectionGapBounds() const;
171 168
172 RenderLayerStackingNode* stackingNode() { return m_stackingNode.get(); } 169 RenderLayerStackingNode* stackingNode() { return m_stackingNode.get(); }
173 const RenderLayerStackingNode* stackingNode() const { return m_stackingNode. get(); } 170 const RenderLayerStackingNode* stackingNode() const { return m_stackingNode. get(); }
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after
545 LayoutRect logicalBoundingBox() const; 542 LayoutRect logicalBoundingBox() const;
546 543
547 bool hasOverflowControls() const; 544 bool hasOverflowControls() const;
548 545
549 void setAncestorChainHasSelfPaintingLayerDescendant(); 546 void setAncestorChainHasSelfPaintingLayerDescendant();
550 void dirtyAncestorChainHasSelfPaintingLayerDescendantStatus(); 547 void dirtyAncestorChainHasSelfPaintingLayerDescendantStatus();
551 548
552 void clipToRect(const LayerPaintingInfo&, GraphicsContext*, const ClipRect&, PaintLayerFlags, BorderRadiusClippingRule = IncludeSelfForBorderRadius); 549 void clipToRect(const LayerPaintingInfo&, GraphicsContext*, const ClipRect&, PaintLayerFlags, BorderRadiusClippingRule = IncludeSelfForBorderRadius);
553 void restoreClip(GraphicsContext*, const LayoutRect& paintDirtyRect, const C lipRect&); 550 void restoreClip(GraphicsContext*, const LayoutRect& paintDirtyRect, const C lipRect&);
554 551
555 // Returns true if the position changed.
556 bool updateLayerPosition();
557
558 void updateLayerPositionRecursive(); 552 void updateLayerPositionRecursive();
559 void updateLayerPositionsAfterScrollRecursive();
560 553
561 void setNextSibling(RenderLayer* next) { m_next = next; } 554 void setNextSibling(RenderLayer* next) { m_next = next; }
562 void setPreviousSibling(RenderLayer* prev) { m_previous = prev; } 555 void setPreviousSibling(RenderLayer* prev) { m_previous = prev; }
563 void setFirstChild(RenderLayer* first) { m_first = first; } 556 void setFirstChild(RenderLayer* first) { m_first = first; }
564 void setLastChild(RenderLayer* last) { m_last = last; } 557 void setLastChild(RenderLayer* last) { m_last = last; }
565 558
566 LayoutPoint renderBoxLocation() const { return renderer()->isBox() ? toRende rBox(renderer())->location() : LayoutPoint(); } 559 LayoutPoint renderBoxLocation() const { return renderer()->isBox() ? toRende rBox(renderer())->location() : LayoutPoint(); }
567 560
568 void paintLayerContentsAndReflection(GraphicsContext*, const LayerPaintingIn fo&, PaintLayerFlags); 561 void paintLayerContentsAndReflection(GraphicsContext*, const LayerPaintingIn fo&, PaintLayerFlags);
569 void paintLayerByApplyingTransform(GraphicsContext*, const LayerPaintingInfo &, PaintLayerFlags, const LayoutPoint& translationOffset = LayoutPoint()); 562 void paintLayerByApplyingTransform(GraphicsContext*, const LayerPaintingInfo &, PaintLayerFlags, const LayoutPoint& translationOffset = LayoutPoint());
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
676 669
677 unsigned m_visibleContentStatusDirty : 1; 670 unsigned m_visibleContentStatusDirty : 1;
678 unsigned m_hasVisibleContent : 1; 671 unsigned m_hasVisibleContent : 1;
679 unsigned m_visibleDescendantStatusDirty : 1; 672 unsigned m_visibleDescendantStatusDirty : 1;
680 unsigned m_hasVisibleDescendant : 1; 673 unsigned m_hasVisibleDescendant : 1;
681 674
682 unsigned m_hasVisibleNonLayerContent : 1; 675 unsigned m_hasVisibleNonLayerContent : 1;
683 676
684 unsigned m_isPaginated : 1; // If we think this layer is split by a multi-co lumn ancestor, then this bit will be set. 677 unsigned m_isPaginated : 1; // If we think this layer is split by a multi-co lumn ancestor, then this bit will be set.
685 678
686 #if ENABLE(ASSERT)
687 unsigned m_needsPositionUpdate : 1;
688 #endif
689
690 unsigned m_3DTransformedDescendantStatusDirty : 1; 679 unsigned m_3DTransformedDescendantStatusDirty : 1;
691 // Set on a stacking context layer that has 3D descendants anywhere 680 // Set on a stacking context layer that has 3D descendants anywhere
692 // in a preserves3D hierarchy. Hint to do 3D-aware hit testing. 681 // in a preserves3D hierarchy. Hint to do 3D-aware hit testing.
693 unsigned m_has3DTransformedDescendant : 1; 682 unsigned m_has3DTransformedDescendant : 1;
694 683
695 unsigned m_containsDirtyOverlayScrollbars : 1; 684 unsigned m_containsDirtyOverlayScrollbars : 1;
696 685
697 unsigned m_hasFilterInfo : 1; 686 unsigned m_hasFilterInfo : 1;
698 unsigned m_needsAncestorDependentCompositingInputsUpdate : 1; 687 unsigned m_needsAncestorDependentCompositingInputsUpdate : 1;
699 unsigned m_needsDescendantDependentCompositingInputsUpdate : 1; 688 unsigned m_needsDescendantDependentCompositingInputsUpdate : 1;
(...skipping 17 matching lines...) Expand all
717 unsigned m_viewportConstrainedNotCompositedReason : ViewportConstrainedNotCo mpositedReasonBits; 706 unsigned m_viewportConstrainedNotCompositedReason : ViewportConstrainedNotCo mpositedReasonBits;
718 707
719 RenderLayerModelObject* m_renderer; 708 RenderLayerModelObject* m_renderer;
720 709
721 RenderLayer* m_parent; 710 RenderLayer* m_parent;
722 RenderLayer* m_previous; 711 RenderLayer* m_previous;
723 RenderLayer* m_next; 712 RenderLayer* m_next;
724 RenderLayer* m_first; 713 RenderLayer* m_first;
725 RenderLayer* m_last; 714 RenderLayer* m_last;
726 715
727 // Our current relative position offset.
728 LayoutSize m_offsetForInFlowPosition;
729
730 // Our (x,y) coordinates are in our parent layer's coordinate space.
731 LayoutPoint m_location;
732
733 // The layer's width/height
734 IntSize m_size;
735
736 // Cached normal flow values for absolute positioned elements with static le ft/top values. 716 // Cached normal flow values for absolute positioned elements with static le ft/top values.
737 LayoutUnit m_staticInlinePosition; 717 LayoutUnit m_staticInlinePosition;
738 LayoutUnit m_staticBlockPosition; 718 LayoutUnit m_staticBlockPosition;
739 719
740 OwnPtr<TransformationMatrix> m_transform; 720 OwnPtr<TransformationMatrix> m_transform;
741 721
742 // Pointer to the enclosing RenderLayer that caused us to be paginated. It i s 0 if we are not paginated. 722 // Pointer to the enclosing RenderLayer that caused us to be paginated. It i s 0 if we are not paginated.
743 RenderLayer* m_enclosingPaginationLayer; 723 RenderLayer* m_enclosingPaginationLayer;
744 724
745 // These compositing reasons are updated whenever style changes, not while u pdating compositing layers. 725 // These compositing reasons are updated whenever style changes, not while u pdating compositing layers.
(...skipping 24 matching lines...) Expand all
770 750
771 } // namespace blink 751 } // namespace blink
772 752
773 #ifndef NDEBUG 753 #ifndef NDEBUG
774 // Outside the WebCore namespace for ease of invocation from gdb. 754 // Outside the WebCore namespace for ease of invocation from gdb.
775 void showLayerTree(const blink::RenderLayer*); 755 void showLayerTree(const blink::RenderLayer*);
776 void showLayerTree(const blink::RenderObject*); 756 void showLayerTree(const blink::RenderObject*);
777 #endif 757 #endif
778 758
779 #endif // RenderLayer_h 759 #endif // RenderLayer_h
OLDNEW
« 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