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

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: fix rebase mistake 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 800 matching lines...) Expand 10 before | Expand all | Expand 10 after
811 NotCompositedForBoundsOutOfView, 811 NotCompositedForBoundsOutOfView,
812 NotCompositedForNonViewContainer, 812 NotCompositedForNonViewContainer,
813 NotCompositedForNoVisibleContent, 813 NotCompositedForNoVisibleContent,
814 }; 814 };
815 815
816 void setViewportConstrainedNotCompositedReason(ViewportConstrainedNotComposi tedReason reason) { m_viewportConstrainedNotCompositedReason = reason; } 816 void setViewportConstrainedNotCompositedReason(ViewportConstrainedNotComposi tedReason reason) { m_viewportConstrainedNotCompositedReason = reason; }
817 ViewportConstrainedNotCompositedReason viewportConstrainedNotCompositedReaso n() const { return static_cast<ViewportConstrainedNotCompositedReason>(m_viewpor tConstrainedNotCompositedReason); } 817 ViewportConstrainedNotCompositedReason viewportConstrainedNotCompositedReaso n() const { return static_cast<ViewportConstrainedNotCompositedReason>(m_viewpor tConstrainedNotCompositedReason); }
818 818
819 bool isOutOfFlowRenderFlowThread() const { return renderer()->isOutOfFlowRen derFlowThread(); } 819 bool isOutOfFlowRenderFlowThread() const { return renderer()->isOutOfFlowRen derFlowThread(); }
820 820
821 #ifndef NDEBUG
822 String paintOrderListsAsText();
823 #endif
824 PassRefPtr<NodeList> paintOrderListBeforePromote();
825 PassRefPtr<NodeList> paintOrderListAfterPromote();
826
821 private: 827 private:
822 enum CollectLayersBehavior { StopAtStackingContexts, StopAtStackingContainer s }; 828 enum CollectLayersBehavior { StopAtStackingContexts, StopAtStackingContainer s };
823 829
824 void updateZOrderLists(); 830 void updateZOrderLists();
825 void rebuildZOrderLists(); 831 void rebuildZOrderLists();
826 void rebuildZOrderLists(CollectLayersBehavior, OwnPtr<Vector<RenderLayer*> > &, OwnPtr<Vector<RenderLayer*> >&); 832 // See the comment for collectLayers for information about the
833 // layerToForceAsStackingContainer parameter.
834 void rebuildZOrderLists(CollectLayersBehavior, OwnPtr<Vector<RenderLayer*> > &, OwnPtr<Vector<RenderLayer*> >&, const RenderLayer* layerToForceAsStackingCont ainer = 0);
827 void clearZOrderLists(); 835 void clearZOrderLists();
828 836
829 void updateNormalFlowList(); 837 void updateNormalFlowList();
830 838
831 bool isStackingContext(const RenderStyle* style) const { return !style->hasA utoZIndex() || isRootLayer(); } 839 bool isStackingContext(const RenderStyle* style) const { return !style->hasA utoZIndex() || isRootLayer(); }
832 840
833 bool isDirtyStackingContainer() const { return m_zOrderListsDirty && isStack ingContainer(); } 841 bool isDirtyStackingContainer() const { return m_zOrderListsDirty && isStack ingContainer(); }
834 842
835 void setAncestorChainHasSelfPaintingLayerDescendant(); 843 void setAncestorChainHasSelfPaintingLayerDescendant();
836 void dirtyAncestorChainHasSelfPaintingLayerDescendantStatus(); 844 void dirtyAncestorChainHasSelfPaintingLayerDescendantStatus();
837 845
838 bool acceleratedCompositingForOverflowScrollEnabled() const; 846 bool acceleratedCompositingForOverflowScrollEnabled() const;
839 void updateDescendantsAreContiguousInStackingOrder(); 847 void updateDescendantsAreContiguousInStackingOrder();
840 void updateDescendantsAreContiguousInStackingOrderRecursive(const HashMap<co nst RenderLayer*, int>&, int& minIndex, int& maxIndex, int& count, bool firstIte ration); 848 void updateDescendantsAreContiguousInStackingOrderRecursive(const HashMap<co nst RenderLayer*, int>&, int& minIndex, int& maxIndex, int& count, bool firstIte ration);
849 void collectBeforePromotionZOrderList(RenderLayer* ancestorStackingContext,
850 OwnPtr<Vector<RenderLayer*> >& posZOrderListBeforePromote,
851 OwnPtr<Vector<RenderLayer*> >& negZOrderListBeforePromote);
852 void collectAfterPromotionZOrderList(RenderLayer* ancestorStackingContext,
853 OwnPtr<Vector<RenderLayer*> >& posZOrderListAfterPromote,
854 OwnPtr<Vector<RenderLayer*> >& negZOrderListAfterPromote);
841 855
842 void computeRepaintRects(const RenderLayerModelObject* repaintContainer, con st RenderGeometryMap* = 0); 856 void computeRepaintRects(const RenderLayerModelObject* repaintContainer, con st RenderGeometryMap* = 0);
843 void computeRepaintRectsIncludingDescendants(); 857 void computeRepaintRectsIncludingDescendants();
844 void clearRepaintRects(); 858 void clearRepaintRects();
845 859
846 void clipToRect(RenderLayer* rootLayer, GraphicsContext*, const LayoutRect& paintDirtyRect, const ClipRect&, 860 void clipToRect(RenderLayer* rootLayer, GraphicsContext*, const LayoutRect& paintDirtyRect, const ClipRect&,
847 BorderRadiusClippingRule = IncludeSelfForBorderRadius); 861 BorderRadiusClippingRule = IncludeSelfForBorderRadius);
848 void restoreClip(GraphicsContext*, const LayoutRect& paintDirtyRect, const C lipRect&); 862 void restoreClip(GraphicsContext*, const LayoutRect& paintDirtyRect, const C lipRect&);
849 863
850 bool shouldRepaintAfterLayout() const; 864 bool shouldRepaintAfterLayout() const;
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
887 void* operator new(size_t) throw(); 901 void* operator new(size_t) throw();
888 902
889 void setNextSibling(RenderLayer* next) { m_next = next; } 903 void setNextSibling(RenderLayer* next) { m_next = next; }
890 void setPreviousSibling(RenderLayer* prev) { m_previous = prev; } 904 void setPreviousSibling(RenderLayer* prev) { m_previous = prev; }
891 void setParent(RenderLayer* parent); 905 void setParent(RenderLayer* parent);
892 void setFirstChild(RenderLayer* first) { m_first = first; } 906 void setFirstChild(RenderLayer* first) { m_first = first; }
893 void setLastChild(RenderLayer* last) { m_last = last; } 907 void setLastChild(RenderLayer* last) { m_last = last; }
894 908
895 LayoutPoint renderBoxLocation() const { return renderer()->isBox() ? toRende rBox(renderer())->location() : LayoutPoint(); } 909 LayoutPoint renderBoxLocation() const { return renderer()->isBox() ? toRende rBox(renderer())->location() : LayoutPoint(); }
896 910
897 void collectLayers(bool includeHiddenLayers, CollectLayersBehavior, OwnPtr<V ector<RenderLayer*> >&, OwnPtr<Vector<RenderLayer*> >&); 911 // layerToForceAsStackingContainer allows us to build pre-promotion and
912 // post-promotion layer lists, by allowing us to treat a layer as if it is a
913 // stacking context, without adding a new member to RenderLayer or modifying
914 // the style (which could cause extra allocations).
915 void collectLayers(bool includeHiddenLayers, CollectLayersBehavior, OwnPtr<V ector<RenderLayer*> >&, OwnPtr<Vector<RenderLayer*> >&, const RenderLayer* layer ToForceAsStackingContainer = 0);
898 916
899 struct LayerPaintingInfo { 917 struct LayerPaintingInfo {
900 LayerPaintingInfo(RenderLayer* inRootLayer, const LayoutRect& inDirtyRec t, PaintBehavior inPaintBehavior, const LayoutSize& inSubPixelAccumulation, Rend erObject* inPaintingRoot = 0, RenderRegion*inRegion = 0, OverlapTestRequestMap* inOverlapTestRequests = 0) 918 LayerPaintingInfo(RenderLayer* inRootLayer, const LayoutRect& inDirtyRec t, PaintBehavior inPaintBehavior, const LayoutSize& inSubPixelAccumulation, Rend erObject* inPaintingRoot = 0, RenderRegion*inRegion = 0, OverlapTestRequestMap* inOverlapTestRequests = 0)
901 : rootLayer(inRootLayer) 919 : rootLayer(inRootLayer)
902 , paintingRoot(inPaintingRoot) 920 , paintingRoot(inPaintingRoot)
903 , paintDirtyRect(inDirtyRect) 921 , paintDirtyRect(inDirtyRect)
904 , subPixelAccumulation(inSubPixelAccumulation) 922 , subPixelAccumulation(inSubPixelAccumulation)
905 , region(inRegion) 923 , region(inRegion)
906 , overlapTestRequests(inOverlapTestRequests) 924 , overlapTestRequests(inOverlapTestRequests)
907 , paintBehavior(inPaintBehavior) 925 , paintBehavior(inPaintBehavior)
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after
1291 1309
1292 } // namespace WebCore 1310 } // namespace WebCore
1293 1311
1294 #ifndef NDEBUG 1312 #ifndef NDEBUG
1295 // Outside the WebCore namespace for ease of invocation from gdb. 1313 // Outside the WebCore namespace for ease of invocation from gdb.
1296 void showLayerTree(const WebCore::RenderLayer*); 1314 void showLayerTree(const WebCore::RenderLayer*);
1297 void showLayerTree(const WebCore::RenderObject*); 1315 void showLayerTree(const WebCore::RenderObject*);
1298 #endif 1316 #endif
1299 1317
1300 #endif // RenderLayer_h 1318 #endif // RenderLayer_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698