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

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: Responding to Ian's 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 55
56 namespace WebCore { 56 namespace WebCore {
57 57
58 #if ENABLE(CSS_FILTERS) 58 #if ENABLE(CSS_FILTERS)
59 class FilterEffectRenderer; 59 class FilterEffectRenderer;
60 class FilterOperations; 60 class FilterOperations;
61 #endif 61 #endif
62 class HitTestRequest; 62 class HitTestRequest;
63 class HitTestResult; 63 class HitTestResult;
64 class HitTestingTransformState; 64 class HitTestingTransformState;
65 class PaintOrderLists;
65 class RenderFlowThread; 66 class RenderFlowThread;
66 class RenderGeometryMap; 67 class RenderGeometryMap;
67 class RenderLayerBacking; 68 class RenderLayerBacking;
68 class RenderLayerCompositor; 69 class RenderLayerCompositor;
69 class RenderMarquee; 70 class RenderMarquee;
70 class RenderReplica; 71 class RenderReplica;
71 class RenderScrollbarPart; 72 class RenderScrollbarPart;
72 class RenderStyle; 73 class RenderStyle;
73 class RenderView; 74 class RenderView;
74 class Scrollbar; 75 class Scrollbar;
(...skipping 754 matching lines...) Expand 10 before | Expand all | Expand 10 after
829 NotCompositedForBoundsOutOfView, 830 NotCompositedForBoundsOutOfView,
830 NotCompositedForNonViewContainer, 831 NotCompositedForNonViewContainer,
831 NotCompositedForNoVisibleContent, 832 NotCompositedForNoVisibleContent,
832 }; 833 };
833 834
834 void setViewportConstrainedNotCompositedReason(ViewportConstrainedNotComposi tedReason reason) { m_viewportConstrainedNotCompositedReason = reason; } 835 void setViewportConstrainedNotCompositedReason(ViewportConstrainedNotComposi tedReason reason) { m_viewportConstrainedNotCompositedReason = reason; }
835 ViewportConstrainedNotCompositedReason viewportConstrainedNotCompositedReaso n() const { return static_cast<ViewportConstrainedNotCompositedReason>(m_viewpor tConstrainedNotCompositedReason); } 836 ViewportConstrainedNotCompositedReason viewportConstrainedNotCompositedReaso n() const { return static_cast<ViewportConstrainedNotCompositedReason>(m_viewpor tConstrainedNotCompositedReason); }
836 837
837 bool isOutOfFlowRenderFlowThread() const { return renderer()->isOutOfFlowRen derFlowThread(); } 838 bool isOutOfFlowRenderFlowThread() const { return renderer()->isOutOfFlowRen derFlowThread(); }
838 839
840 String paintOrderListsAsText();
shawnsingh 2013/04/18 02:22:14 Should this be const? Hopefully it's possible to
hartmanng 2013/04/18 17:14:00 Unfortunately it's not possible. We need to call c
841 PassRefPtr<PaintOrderLists> paintOrderLists();
shawnsingh 2013/04/18 02:22:14 Also should this be const? Hopefully it's possibl
hartmanng 2013/04/18 17:14:00 Same as above.
842
839 private: 843 private:
840 enum CollectLayersBehavior { StopAtStackingContexts, StopAtStackingContainer s }; 844 enum CollectLayersBehavior { StopAtStackingContexts, StopAtStackingContainer s };
841 845
842 void updateZOrderLists(); 846 void updateZOrderLists();
843 void rebuildZOrderLists(); 847 void rebuildZOrderLists();
844 void rebuildZOrderLists(CollectLayersBehavior, OwnPtr<Vector<RenderLayer*> > &, OwnPtr<Vector<RenderLayer*> >&); 848 // See the comment for collectLayers for information about the
849 // layerToForceAsStackingContext parameter.
850 void rebuildZOrderLists(CollectLayersBehavior, OwnPtr<Vector<RenderLayer*> > &, OwnPtr<Vector<RenderLayer*> >&, const RenderLayer* layerToForceAsStackingCont ext = 0);
845 void clearZOrderLists(); 851 void clearZOrderLists();
846 852
847 void updateNormalFlowList(); 853 void updateNormalFlowList();
848 854
849 bool isStackingContext(const RenderStyle* style) const { return !style->hasA utoZIndex() || isRootLayer(); } 855 bool isStackingContext(const RenderStyle* style) const { return !style->hasA utoZIndex() || isRootLayer(); }
850 856
851 bool isDirtyStackingContainer() const { return m_zOrderListsDirty && isStack ingContainer(); } 857 bool isDirtyStackingContainer() const { return m_zOrderListsDirty && isStack ingContainer(); }
852 858
853 void setAncestorChainHasSelfPaintingLayerDescendant(); 859 void setAncestorChainHasSelfPaintingLayerDescendant();
854 void dirtyAncestorChainHasSelfPaintingLayerDescendantStatus(); 860 void dirtyAncestorChainHasSelfPaintingLayerDescendantStatus();
855 861
856 bool acceleratedCompositingForOverflowScrollEnabled() const; 862 bool acceleratedCompositingForOverflowScrollEnabled() const;
857 void updateDescendantsAreContiguousInStackingOrder(); 863 void updateDescendantsAreContiguousInStackingOrder();
858 void updateDescendantsAreContiguousInStackingOrderRecursive(const HashMap<co nst RenderLayer*, int>&, int& minIndex, int& maxIndex, int& count, bool firstIte ration); 864 void updateDescendantsAreContiguousInStackingOrderRecursive(const HashMap<co nst RenderLayer*, int>&, int& minIndex, int& maxIndex, int& count, bool firstIte ration);
865 void collectBeforeAfterPromotionZOrderLists(RenderLayer* ancestorStackingCon text,
866 OwnPtr<Vector<RenderLayer*> >& posZOrderListBeforePromote,
867 OwnPtr<Vector<RenderLayer*> >& negZOrderListBeforePromote,
868 OwnPtr<Vector<RenderLayer*> >& posZOrderListAfterPromote,
869 OwnPtr<Vector<RenderLayer*> >& negZOrderListAfterPromote);
859 870
860 void computeRepaintRects(const RenderLayerModelObject* repaintContainer, con st RenderGeometryMap* = 0); 871 void computeRepaintRects(const RenderLayerModelObject* repaintContainer, con st RenderGeometryMap* = 0);
861 void computeRepaintRectsIncludingDescendants(); 872 void computeRepaintRectsIncludingDescendants();
862 void clearRepaintRects(); 873 void clearRepaintRects();
863 874
864 void clipToRect(RenderLayer* rootLayer, GraphicsContext*, const LayoutRect& paintDirtyRect, const ClipRect&, 875 void clipToRect(RenderLayer* rootLayer, GraphicsContext*, const LayoutRect& paintDirtyRect, const ClipRect&,
865 BorderRadiusClippingRule = IncludeSelfForBorderRadius); 876 BorderRadiusClippingRule = IncludeSelfForBorderRadius);
866 void restoreClip(GraphicsContext*, const LayoutRect& paintDirtyRect, const C lipRect&); 877 void restoreClip(GraphicsContext*, const LayoutRect& paintDirtyRect, const C lipRect&);
867 878
868 bool shouldRepaintAfterLayout() const; 879 bool shouldRepaintAfterLayout() const;
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
905 void* operator new(size_t) throw(); 916 void* operator new(size_t) throw();
906 917
907 void setNextSibling(RenderLayer* next) { m_next = next; } 918 void setNextSibling(RenderLayer* next) { m_next = next; }
908 void setPreviousSibling(RenderLayer* prev) { m_previous = prev; } 919 void setPreviousSibling(RenderLayer* prev) { m_previous = prev; }
909 void setParent(RenderLayer* parent); 920 void setParent(RenderLayer* parent);
910 void setFirstChild(RenderLayer* first) { m_first = first; } 921 void setFirstChild(RenderLayer* first) { m_first = first; }
911 void setLastChild(RenderLayer* last) { m_last = last; } 922 void setLastChild(RenderLayer* last) { m_last = last; }
912 923
913 LayoutPoint renderBoxLocation() const { return renderer()->isBox() ? toRende rBox(renderer())->location() : LayoutPoint(); } 924 LayoutPoint renderBoxLocation() const { return renderer()->isBox() ? toRende rBox(renderer())->location() : LayoutPoint(); }
914 925
915 void collectLayers(bool includeHiddenLayers, CollectLayersBehavior, OwnPtr<V ector<RenderLayer*> >&, OwnPtr<Vector<RenderLayer*> >&); 926 // layerToForceAsStackingContext allows us to build pre-promotion and
927 // post-promotion layer lists, by allowing us to treat a layer as if it is a
928 // stacking context, without adding a new member to RenderLayer or modifying
929 // the style (which could cause extra allocations).
930 void collectLayers(bool includeHiddenLayers, CollectLayersBehavior, OwnPtr<V ector<RenderLayer*> >&, OwnPtr<Vector<RenderLayer*> >&, const RenderLayer* layer ToForceAsStackingContext = 0);
916 931
917 struct LayerPaintingInfo { 932 struct LayerPaintingInfo {
918 LayerPaintingInfo(RenderLayer* inRootLayer, const LayoutRect& inDirtyRec t, PaintBehavior inPaintBehavior, const LayoutSize& inSubPixelAccumulation, Rend erObject* inPaintingRoot = 0, RenderRegion*inRegion = 0, OverlapTestRequestMap* inOverlapTestRequests = 0) 933 LayerPaintingInfo(RenderLayer* inRootLayer, const LayoutRect& inDirtyRec t, PaintBehavior inPaintBehavior, const LayoutSize& inSubPixelAccumulation, Rend erObject* inPaintingRoot = 0, RenderRegion*inRegion = 0, OverlapTestRequestMap* inOverlapTestRequests = 0)
919 : rootLayer(inRootLayer) 934 : rootLayer(inRootLayer)
920 , paintingRoot(inPaintingRoot) 935 , paintingRoot(inPaintingRoot)
921 , paintDirtyRect(inDirtyRect) 936 , paintDirtyRect(inDirtyRect)
922 , subPixelAccumulation(inSubPixelAccumulation) 937 , subPixelAccumulation(inSubPixelAccumulation)
923 , region(inRegion) 938 , region(inRegion)
924 , overlapTestRequests(inOverlapTestRequests) 939 , overlapTestRequests(inOverlapTestRequests)
925 , paintBehavior(inPaintBehavior) 940 , paintBehavior(inPaintBehavior)
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after
1313 1328
1314 } // namespace WebCore 1329 } // namespace WebCore
1315 1330
1316 #ifndef NDEBUG 1331 #ifndef NDEBUG
1317 // Outside the WebCore namespace for ease of invocation from gdb. 1332 // Outside the WebCore namespace for ease of invocation from gdb.
1318 void showLayerTree(const WebCore::RenderLayer*); 1333 void showLayerTree(const WebCore::RenderLayer*);
1319 void showLayerTree(const WebCore::RenderObject*); 1334 void showLayerTree(const WebCore::RenderObject*);
1320 #endif 1335 #endif
1321 1336
1322 #endif // RenderLayer_h 1337 #endif // RenderLayer_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698