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

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

Issue 13467028: Add an intermediate function to generate 2 paint-order lists. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: minor fix - remove duplicate method Created 7 years, 8 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 * 3 *
4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation.
5 * 5 *
6 * Other contributors: 6 * Other contributors:
7 * Robert O'Callahan <roc+@cs.cmu.edu> 7 * Robert O'Callahan <roc+@cs.cmu.edu>
8 * David Baron <dbaron@fas.harvard.edu> 8 * David Baron <dbaron@fas.harvard.edu>
9 * Christian Biesinger <cbiesinger@web.de> 9 * Christian Biesinger <cbiesinger@web.de>
10 * Randall Jesup <rjesup@wgate.com> 10 * Randall Jesup <rjesup@wgate.com>
(...skipping 795 matching lines...) Expand 10 before | Expand all | Expand 10 after
806 NotCompositedForBoundsOutOfView, 806 NotCompositedForBoundsOutOfView,
807 NotCompositedForNonViewContainer, 807 NotCompositedForNonViewContainer,
808 NotCompositedForNoVisibleContent, 808 NotCompositedForNoVisibleContent,
809 }; 809 };
810 810
811 void setViewportConstrainedNotCompositedReason(ViewportConstrainedNotComposi tedReason reason) { m_compositingProperties.viewportConstrainedNotCompositedReas on = reason; } 811 void setViewportConstrainedNotCompositedReason(ViewportConstrainedNotComposi tedReason reason) { m_compositingProperties.viewportConstrainedNotCompositedReas on = reason; }
812 ViewportConstrainedNotCompositedReason viewportConstrainedNotCompositedReaso n() const { return static_cast<ViewportConstrainedNotCompositedReason>(m_composi tingProperties.viewportConstrainedNotCompositedReason); } 812 ViewportConstrainedNotCompositedReason viewportConstrainedNotCompositedReaso n() const { return static_cast<ViewportConstrainedNotCompositedReason>(m_composi tingProperties.viewportConstrainedNotCompositedReason); }
813 813
814 bool isOutOfFlowRenderFlowThread() const { return renderer()->isOutOfFlowRen derFlowThread(); } 814 bool isOutOfFlowRenderFlowThread() const { return renderer()->isOutOfFlowRen derFlowThread(); }
815 815
816 #ifndef NDEBUG
817 String paintOrderListsAsText();
818 #endif
819 enum PaintOrderListType {BeforePromote, AfterPromote};
820 PassRefPtr<NodeList> paintOrderList(PaintOrderListType type);
821
816 private: 822 private:
817 enum CollectLayersBehavior { StopAtStackingContexts, StopAtStackingContainer s }; 823 enum CollectLayersBehavior { StopAtStackingContexts, StopAtStackingContainer s };
818 824
819 void updateZOrderLists(); 825 void updateZOrderLists();
820 void rebuildZOrderLists(); 826 void rebuildZOrderLists();
821 void rebuildZOrderLists(CollectLayersBehavior, OwnPtr<Vector<RenderLayer*> > &, OwnPtr<Vector<RenderLayer*> >&); 827 // See the comment for collectLayers for information about the
828 // layerToForceAsStackingContainer parameter.
Julien - ping for review 2013/04/24 15:44:01 Nit: You don't need to wrap at 80 columns in Blink
hartmanng 2013/04/24 17:02:41 Done.
829 void rebuildZOrderLists(CollectLayersBehavior, OwnPtr<Vector<RenderLayer*> > &, OwnPtr<Vector<RenderLayer*> >&, const RenderLayer* layerToForceAsStackingCont ainer = 0);
822 void clearZOrderLists(); 830 void clearZOrderLists();
823 831
824 void updateNormalFlowList(); 832 void updateNormalFlowList();
825 833
826 bool isStackingContext(const RenderStyle* style) const { return !style->hasA utoZIndex() || isRootLayer(); } 834 bool isStackingContext(const RenderStyle* style) const { return !style->hasA utoZIndex() || isRootLayer(); }
827 835
828 bool isDirtyStackingContainer() const { return m_zOrderListsDirty && isStack ingContainer(); } 836 bool isDirtyStackingContainer() const { return m_zOrderListsDirty && isStack ingContainer(); }
829 837
830 void setAncestorChainHasSelfPaintingLayerDescendant(); 838 void setAncestorChainHasSelfPaintingLayerDescendant();
831 void dirtyAncestorChainHasSelfPaintingLayerDescendantStatus(); 839 void dirtyAncestorChainHasSelfPaintingLayerDescendantStatus();
832 840
833 bool acceleratedCompositingForOverflowScrollEnabled() const; 841 bool acceleratedCompositingForOverflowScrollEnabled() const;
834 void updateDescendantsAreContiguousInStackingOrder(); 842 void updateDescendantsAreContiguousInStackingOrder();
835 void updateDescendantsAreContiguousInStackingOrderRecursive(const HashMap<co nst RenderLayer*, int>&, int& minIndex, int& maxIndex, int& count, bool firstIte ration); 843 void updateDescendantsAreContiguousInStackingOrderRecursive(const HashMap<co nst RenderLayer*, int>&, int& minIndex, int& maxIndex, int& count, bool firstIte ration);
844 void collectBeforePromotionZOrderList(RenderLayer* ancestorStackingContext, OwnPtr<Vector<RenderLayer*> >& posZOrderListBeforePromote, OwnPtr<Vector<RenderL ayer*> >& negZOrderListBeforePromote, size_t& posZOrderListSizeBeforePromote, si ze_t& negZOrderListSizeBeforePromote);
845 void collectAfterPromotionZOrderList(RenderLayer* ancestorStackingContext, O wnPtr<Vector<RenderLayer*> >& posZOrderListAfterPromote, OwnPtr<Vector<RenderLay er*> >& negZOrderListAfterPromote, size_t& posZOrderListSizeAfterPromote, size_t & negZOrderListSizeAfterPromote);
836 846
837 void computeRepaintRects(const RenderLayerModelObject* repaintContainer, con st RenderGeometryMap* = 0); 847 void computeRepaintRects(const RenderLayerModelObject* repaintContainer, con st RenderGeometryMap* = 0);
838 void computeRepaintRectsIncludingDescendants(); 848 void computeRepaintRectsIncludingDescendants();
839 void clearRepaintRects(); 849 void clearRepaintRects();
840 850
841 void clipToRect(RenderLayer* rootLayer, GraphicsContext*, const LayoutRect& paintDirtyRect, const ClipRect&, 851 void clipToRect(RenderLayer* rootLayer, GraphicsContext*, const LayoutRect& paintDirtyRect, const ClipRect&,
842 BorderRadiusClippingRule = IncludeSelfForBorderRadius); 852 BorderRadiusClippingRule = IncludeSelfForBorderRadius);
843 void restoreClip(GraphicsContext*, const LayoutRect& paintDirtyRect, const C lipRect&); 853 void restoreClip(GraphicsContext*, const LayoutRect& paintDirtyRect, const C lipRect&);
844 854
845 bool shouldRepaintAfterLayout() const; 855 bool shouldRepaintAfterLayout() const;
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
882 void* operator new(size_t) throw(); 892 void* operator new(size_t) throw();
883 893
884 void setNextSibling(RenderLayer* next) { m_next = next; } 894 void setNextSibling(RenderLayer* next) { m_next = next; }
885 void setPreviousSibling(RenderLayer* prev) { m_previous = prev; } 895 void setPreviousSibling(RenderLayer* prev) { m_previous = prev; }
886 void setParent(RenderLayer* parent); 896 void setParent(RenderLayer* parent);
887 void setFirstChild(RenderLayer* first) { m_first = first; } 897 void setFirstChild(RenderLayer* first) { m_first = first; }
888 void setLastChild(RenderLayer* last) { m_last = last; } 898 void setLastChild(RenderLayer* last) { m_last = last; }
889 899
890 LayoutPoint renderBoxLocation() const { return renderer()->isBox() ? toRende rBox(renderer())->location() : LayoutPoint(); } 900 LayoutPoint renderBoxLocation() const { return renderer()->isBox() ? toRende rBox(renderer())->location() : LayoutPoint(); }
891 901
892 void collectLayers(bool includeHiddenLayers, CollectLayersBehavior, OwnPtr<V ector<RenderLayer*> >&, OwnPtr<Vector<RenderLayer*> >&); 902 // layerToForceAsStackingContainer allows us to build pre-promotion and
903 // post-promotion layer lists, by allowing us to treat a layer as if it is a
904 // stacking context, without adding a new member to RenderLayer or modifying
905 // the style (which could cause extra allocations).
906 void collectLayers(bool includeHiddenLayers, CollectLayersBehavior, OwnPtr<V ector<RenderLayer*> >&, OwnPtr<Vector<RenderLayer*> >&, const RenderLayer* layer ToForceAsStackingContainer = 0);
893 907
894 struct LayerPaintingInfo { 908 struct LayerPaintingInfo {
895 LayerPaintingInfo(RenderLayer* inRootLayer, const LayoutRect& inDirtyRec t, PaintBehavior inPaintBehavior, const LayoutSize& inSubPixelAccumulation, Rend erObject* inPaintingRoot = 0, RenderRegion*inRegion = 0, OverlapTestRequestMap* inOverlapTestRequests = 0) 909 LayerPaintingInfo(RenderLayer* inRootLayer, const LayoutRect& inDirtyRec t, PaintBehavior inPaintBehavior, const LayoutSize& inSubPixelAccumulation, Rend erObject* inPaintingRoot = 0, RenderRegion*inRegion = 0, OverlapTestRequestMap* inOverlapTestRequests = 0)
896 : rootLayer(inRootLayer) 910 : rootLayer(inRootLayer)
897 , paintingRoot(inPaintingRoot) 911 , paintingRoot(inPaintingRoot)
898 , paintDirtyRect(inDirtyRect) 912 , paintDirtyRect(inDirtyRect)
899 , subPixelAccumulation(inSubPixelAccumulation) 913 , subPixelAccumulation(inSubPixelAccumulation)
900 , region(inRegion) 914 , region(inRegion)
901 , overlapTestRequests(inOverlapTestRequests) 915 , overlapTestRequests(inOverlapTestRequests)
902 , paintBehavior(inPaintBehavior) 916 , paintBehavior(inPaintBehavior)
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
1303 1317
1304 } // namespace WebCore 1318 } // namespace WebCore
1305 1319
1306 #ifndef NDEBUG 1320 #ifndef NDEBUG
1307 // Outside the WebCore namespace for ease of invocation from gdb. 1321 // Outside the WebCore namespace for ease of invocation from gdb.
1308 void showLayerTree(const WebCore::RenderLayer*); 1322 void showLayerTree(const WebCore::RenderLayer*);
1309 void showLayerTree(const WebCore::RenderObject*); 1323 void showLayerTree(const WebCore::RenderObject*);
1310 #endif 1324 #endif
1311 1325
1312 #endif // RenderLayer_h 1326 #endif // RenderLayer_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698