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

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: addressing review comments 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 layerToForceA sStackingContainer parameter.
828 void rebuildZOrderLists(CollectLayersBehavior, OwnPtr<Vector<RenderLayer*> > &, OwnPtr<Vector<RenderLayer*> >&, const RenderLayer* layerToForceAsStackingCont ainer = 0);
822 void clearZOrderLists(); 829 void clearZOrderLists();
823 830
824 void updateNormalFlowList(); 831 void updateNormalFlowList();
825 832
826 bool isStackingContext(const RenderStyle* style) const { return !style->hasA utoZIndex() || isRootLayer(); } 833 bool isStackingContext(const RenderStyle* style) const { return !style->hasA utoZIndex() || isRootLayer(); }
827 834
828 bool isDirtyStackingContainer() const { return m_zOrderListsDirty && isStack ingContainer(); } 835 bool isDirtyStackingContainer() const { return m_zOrderListsDirty && isStack ingContainer(); }
829 836
830 void setAncestorChainHasSelfPaintingLayerDescendant(); 837 void setAncestorChainHasSelfPaintingLayerDescendant();
831 void dirtyAncestorChainHasSelfPaintingLayerDescendantStatus(); 838 void dirtyAncestorChainHasSelfPaintingLayerDescendantStatus();
832 839
833 bool acceleratedCompositingForOverflowScrollEnabled() const; 840 bool acceleratedCompositingForOverflowScrollEnabled() const;
834 void updateDescendantsAreContiguousInStackingOrder(); 841 void updateDescendantsAreContiguousInStackingOrder();
835 void updateDescendantsAreContiguousInStackingOrderRecursive(const HashMap<co nst RenderLayer*, int>&, int& minIndex, int& maxIndex, int& count, bool firstIte ration); 842 void updateDescendantsAreContiguousInStackingOrderRecursive(const HashMap<co nst RenderLayer*, int>&, int& minIndex, int& maxIndex, int& count, bool firstIte ration);
843 void collectBeforePromotionZOrderList(RenderLayer* ancestorStackingContext, OwnPtr<Vector<RenderLayer*> >& posZOrderListBeforePromote, OwnPtr<Vector<RenderL ayer*> >& negZOrderListBeforePromote, size_t& posZOrderListSizeBeforePromote, si ze_t& negZOrderListSizeBeforePromote);
844 void collectAfterPromotionZOrderList(RenderLayer* ancestorStackingContext, O wnPtr<Vector<RenderLayer*> >& posZOrderListAfterPromote, OwnPtr<Vector<RenderLay er*> >& negZOrderListAfterPromote, size_t& posZOrderListSizeAfterPromote, size_t & negZOrderListSizeAfterPromote);
836 845
837 void computeRepaintRects(const RenderLayerModelObject* repaintContainer, con st RenderGeometryMap* = 0); 846 void computeRepaintRects(const RenderLayerModelObject* repaintContainer, con st RenderGeometryMap* = 0);
838 void computeRepaintRectsIncludingDescendants(); 847 void computeRepaintRectsIncludingDescendants();
839 void clearRepaintRects(); 848 void clearRepaintRects();
840 849
841 void clipToRect(RenderLayer* rootLayer, GraphicsContext*, const LayoutRect& paintDirtyRect, const ClipRect&, 850 void clipToRect(RenderLayer* rootLayer, GraphicsContext*, const LayoutRect& paintDirtyRect, const ClipRect&,
842 BorderRadiusClippingRule = IncludeSelfForBorderRadius); 851 BorderRadiusClippingRule = IncludeSelfForBorderRadius);
843 void restoreClip(GraphicsContext*, const LayoutRect& paintDirtyRect, const C lipRect&); 852 void restoreClip(GraphicsContext*, const LayoutRect& paintDirtyRect, const C lipRect&);
844 853
845 bool shouldRepaintAfterLayout() const; 854 bool shouldRepaintAfterLayout() const;
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
882 void* operator new(size_t) throw(); 891 void* operator new(size_t) throw();
883 892
884 void setNextSibling(RenderLayer* next) { m_next = next; } 893 void setNextSibling(RenderLayer* next) { m_next = next; }
885 void setPreviousSibling(RenderLayer* prev) { m_previous = prev; } 894 void setPreviousSibling(RenderLayer* prev) { m_previous = prev; }
886 void setParent(RenderLayer* parent); 895 void setParent(RenderLayer* parent);
887 void setFirstChild(RenderLayer* first) { m_first = first; } 896 void setFirstChild(RenderLayer* first) { m_first = first; }
888 void setLastChild(RenderLayer* last) { m_last = last; } 897 void setLastChild(RenderLayer* last) { m_last = last; }
889 898
890 LayoutPoint renderBoxLocation() const { return renderer()->isBox() ? toRende rBox(renderer())->location() : LayoutPoint(); } 899 LayoutPoint renderBoxLocation() const { return renderer()->isBox() ? toRende rBox(renderer())->location() : LayoutPoint(); }
891 900
892 void collectLayers(bool includeHiddenLayers, CollectLayersBehavior, OwnPtr<V ector<RenderLayer*> >&, OwnPtr<Vector<RenderLayer*> >&); 901 // layerToForceAsStackingContainer allows us to build pre-promotion and
902 // post-promotion layer lists, by allowing us to treat a layer as if it is a
903 // stacking context, without adding a new member to RenderLayer or modifying
904 // the style (which could cause extra allocations).
905 void collectLayers(bool includeHiddenLayers, CollectLayersBehavior, OwnPtr<V ector<RenderLayer*> >&, OwnPtr<Vector<RenderLayer*> >&, const RenderLayer* layer ToForceAsStackingContainer = 0);
893 906
894 struct LayerPaintingInfo { 907 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) 908 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) 909 : rootLayer(inRootLayer)
897 , paintingRoot(inPaintingRoot) 910 , paintingRoot(inPaintingRoot)
898 , paintDirtyRect(inDirtyRect) 911 , paintDirtyRect(inDirtyRect)
899 , subPixelAccumulation(inSubPixelAccumulation) 912 , subPixelAccumulation(inSubPixelAccumulation)
900 , region(inRegion) 913 , region(inRegion)
901 , overlapTestRequests(inOverlapTestRequests) 914 , overlapTestRequests(inOverlapTestRequests)
902 , paintBehavior(inPaintBehavior) 915 , paintBehavior(inPaintBehavior)
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
1303 1316
1304 } // namespace WebCore 1317 } // namespace WebCore
1305 1318
1306 #ifndef NDEBUG 1319 #ifndef NDEBUG
1307 // Outside the WebCore namespace for ease of invocation from gdb. 1320 // Outside the WebCore namespace for ease of invocation from gdb.
1308 void showLayerTree(const WebCore::RenderLayer*); 1321 void showLayerTree(const WebCore::RenderLayer*);
1309 void showLayerTree(const WebCore::RenderObject*); 1322 void showLayerTree(const WebCore::RenderObject*);
1310 #endif 1323 #endif
1311 1324
1312 #endif // RenderLayer_h 1325 #endif // RenderLayer_h
OLDNEW
« no previous file with comments | « LayoutTests/compositing/overflow/resources/build-paint-order-lists.js ('k') | Source/core/rendering/RenderLayer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698