Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 752 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 827 NotCompositedForBoundsOutOfView, | 828 NotCompositedForBoundsOutOfView, |
| 828 NotCompositedForNonViewContainer, | 829 NotCompositedForNonViewContainer, |
| 829 NotCompositedForNoVisibleContent, | 830 NotCompositedForNoVisibleContent, |
| 830 }; | 831 }; |
| 831 | 832 |
| 832 void setViewportConstrainedNotCompositedReason(ViewportConstrainedNotComposi tedReason reason) { m_viewportConstrainedNotCompositedReason = reason; } | 833 void setViewportConstrainedNotCompositedReason(ViewportConstrainedNotComposi tedReason reason) { m_viewportConstrainedNotCompositedReason = reason; } |
| 833 ViewportConstrainedNotCompositedReason viewportConstrainedNotCompositedReaso n() const { return static_cast<ViewportConstrainedNotCompositedReason>(m_viewpor tConstrainedNotCompositedReason); } | 834 ViewportConstrainedNotCompositedReason viewportConstrainedNotCompositedReaso n() const { return static_cast<ViewportConstrainedNotCompositedReason>(m_viewpor tConstrainedNotCompositedReason); } |
| 834 | 835 |
| 835 bool isOutOfFlowRenderFlowThread() const { return renderer()->isOutOfFlowRen derFlowThread(); } | 836 bool isOutOfFlowRenderFlowThread() const { return renderer()->isOutOfFlowRen derFlowThread(); } |
| 836 | 837 |
| 838 String paintOrderListsAsText(); | |
| 839 PassRefPtr<PaintOrderLists> paintOrderLists(); | |
| 840 | |
| 837 private: | 841 private: |
| 838 enum CollectLayersBehavior { StopAtStackingContexts, StopAtStackingContainer s }; | 842 enum CollectLayersBehavior { StopAtStackingContexts, StopAtStackingContainer s }; |
| 839 | 843 |
| 840 void updateZOrderLists(); | 844 void updateZOrderLists(); |
| 841 void rebuildZOrderLists(); | 845 void rebuildZOrderLists(); |
| 842 void rebuildZOrderLists(CollectLayersBehavior, OwnPtr<Vector<RenderLayer*> > &, OwnPtr<Vector<RenderLayer*> >&); | 846 // See the comment for collectLayers for information about the |
| 847 // layerToForceAsStackingContext parameter. | |
| 848 void rebuildZOrderLists(CollectLayersBehavior, OwnPtr<Vector<RenderLayer*> > &, OwnPtr<Vector<RenderLayer*> >&, const RenderLayer* layerToForceAsStackingCont ext = 0); | |
| 843 void clearZOrderLists(); | 849 void clearZOrderLists(); |
| 844 | 850 |
| 845 void updateNormalFlowList(); | 851 void updateNormalFlowList(); |
| 846 | 852 |
| 847 bool isStackingContext(const RenderStyle* style) const { return !style->hasA utoZIndex() || isRootLayer(); } | 853 bool isStackingContext(const RenderStyle* style) const { return !style->hasA utoZIndex() || isRootLayer(); } |
| 848 | 854 |
| 849 bool isDirtyStackingContainer() const { return m_zOrderListsDirty && isStack ingContainer(); } | 855 bool isDirtyStackingContainer() const { return m_zOrderListsDirty && isStack ingContainer(); } |
| 850 | 856 |
| 851 void setAncestorChainHasSelfPaintingLayerDescendant(); | 857 void setAncestorChainHasSelfPaintingLayerDescendant(); |
| 852 void dirtyAncestorChainHasSelfPaintingLayerDescendantStatus(); | 858 void dirtyAncestorChainHasSelfPaintingLayerDescendantStatus(); |
| 853 | 859 |
| 854 bool acceleratedCompositingForOverflowScrollEnabled() const; | 860 bool acceleratedCompositingForOverflowScrollEnabled() const; |
| 855 void updateDescendantsAreContiguousInStackingOrder(); | 861 void updateDescendantsAreContiguousInStackingOrder(); |
| 856 void updateDescendantsAreContiguousInStackingOrderRecursive(const HashMap<co nst RenderLayer*, int>&, int& minIndex, int& maxIndex, int& count, bool firstIte ration); | 862 void updateDescendantsAreContiguousInStackingOrderRecursive(const HashMap<co nst RenderLayer*, int>&, int& minIndex, int& maxIndex, int& count, bool firstIte ration); |
| 863 void collectBeforeAfterPromotionZOrderLists(RenderLayer* ancestorStackingCon text, | |
|
Ian Vollick
2013/04/16 19:17:41
Please combine these two methods. They're hard to
hartmanng
2013/04/17 18:00:20
Done.
| |
| 864 OwnPtr<Vector<RenderLayer*> >& posZOrderListBeforePromote, | |
| 865 OwnPtr<Vector<RenderLayer*> >& negZOrderListBeforePromote, | |
| 866 OwnPtr<Vector<RenderLayer*> >& posZOrderListAfterPromote, | |
| 867 OwnPtr<Vector<RenderLayer*> >& negZOrderListAfterPromote); | |
| 868 void getPaintOrderLists(RenderLayer* ancestorStackingContext, | |
| 869 OwnPtr<Vector<RenderLayer*> >& posZOrderListBeforePromote, | |
| 870 OwnPtr<Vector<RenderLayer*> >& negZOrderListBeforePromote, | |
| 871 OwnPtr<Vector<RenderLayer*> >& posZOrderListAfterPromote, | |
| 872 OwnPtr<Vector<RenderLayer*> >& negZOrderListAfterPromote); | |
| 857 | 873 |
| 858 void computeRepaintRects(const RenderLayerModelObject* repaintContainer, con st RenderGeometryMap* = 0); | 874 void computeRepaintRects(const RenderLayerModelObject* repaintContainer, con st RenderGeometryMap* = 0); |
| 859 void computeRepaintRectsIncludingDescendants(); | 875 void computeRepaintRectsIncludingDescendants(); |
| 860 void clearRepaintRects(); | 876 void clearRepaintRects(); |
| 861 | 877 |
| 862 void clipToRect(RenderLayer* rootLayer, GraphicsContext*, const LayoutRect& paintDirtyRect, const ClipRect&, | 878 void clipToRect(RenderLayer* rootLayer, GraphicsContext*, const LayoutRect& paintDirtyRect, const ClipRect&, |
| 863 BorderRadiusClippingRule = IncludeSelfForBorderRadius); | 879 BorderRadiusClippingRule = IncludeSelfForBorderRadius); |
| 864 void restoreClip(GraphicsContext*, const LayoutRect& paintDirtyRect, const C lipRect&); | 880 void restoreClip(GraphicsContext*, const LayoutRect& paintDirtyRect, const C lipRect&); |
| 865 | 881 |
| 866 bool shouldRepaintAfterLayout() const; | 882 bool shouldRepaintAfterLayout() const; |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 901 void* operator new(size_t) throw(); | 917 void* operator new(size_t) throw(); |
| 902 | 918 |
| 903 void setNextSibling(RenderLayer* next) { m_next = next; } | 919 void setNextSibling(RenderLayer* next) { m_next = next; } |
| 904 void setPreviousSibling(RenderLayer* prev) { m_previous = prev; } | 920 void setPreviousSibling(RenderLayer* prev) { m_previous = prev; } |
| 905 void setParent(RenderLayer* parent); | 921 void setParent(RenderLayer* parent); |
| 906 void setFirstChild(RenderLayer* first) { m_first = first; } | 922 void setFirstChild(RenderLayer* first) { m_first = first; } |
| 907 void setLastChild(RenderLayer* last) { m_last = last; } | 923 void setLastChild(RenderLayer* last) { m_last = last; } |
| 908 | 924 |
| 909 LayoutPoint renderBoxLocation() const { return renderer()->isBox() ? toRende rBox(renderer())->location() : LayoutPoint(); } | 925 LayoutPoint renderBoxLocation() const { return renderer()->isBox() ? toRende rBox(renderer())->location() : LayoutPoint(); } |
| 910 | 926 |
| 911 void collectLayers(bool includeHiddenLayers, CollectLayersBehavior, OwnPtr<V ector<RenderLayer*> >&, OwnPtr<Vector<RenderLayer*> >&); | 927 // layerToForceAsStackingContext allows us to build pre-promotion and |
| 928 // post-promotion layer lists, by allowing us to treat a layer as if it is a | |
| 929 // stacking context, without adding a new member to RenderLayer or modifying | |
| 930 // the style (which could cause extra allocations). | |
| 931 void collectLayers(bool includeHiddenLayers, CollectLayersBehavior, OwnPtr<V ector<RenderLayer*> >&, OwnPtr<Vector<RenderLayer*> >&, const RenderLayer* layer ToForceAsStackingContext = 0); | |
| 912 | 932 |
| 913 void updateCompositingAndLayerListsIfNeeded(); | 933 void updateCompositingAndLayerListsIfNeeded(); |
| 914 | 934 |
| 915 struct LayerPaintingInfo { | 935 struct LayerPaintingInfo { |
| 916 LayerPaintingInfo(RenderLayer* inRootLayer, const LayoutRect& inDirtyRec t, PaintBehavior inPaintBehavior, const LayoutSize& inSubPixelAccumulation, Rend erObject* inPaintingRoot = 0, RenderRegion*inRegion = 0, OverlapTestRequestMap* inOverlapTestRequests = 0) | 936 LayerPaintingInfo(RenderLayer* inRootLayer, const LayoutRect& inDirtyRec t, PaintBehavior inPaintBehavior, const LayoutSize& inSubPixelAccumulation, Rend erObject* inPaintingRoot = 0, RenderRegion*inRegion = 0, OverlapTestRequestMap* inOverlapTestRequests = 0) |
| 917 : rootLayer(inRootLayer) | 937 : rootLayer(inRootLayer) |
| 918 , paintingRoot(inPaintingRoot) | 938 , paintingRoot(inPaintingRoot) |
| 919 , paintDirtyRect(inDirtyRect) | 939 , paintDirtyRect(inDirtyRect) |
| 920 , subPixelAccumulation(inSubPixelAccumulation) | 940 , subPixelAccumulation(inSubPixelAccumulation) |
| 921 , region(inRegion) | 941 , region(inRegion) |
| (...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1310 | 1330 |
| 1311 } // namespace WebCore | 1331 } // namespace WebCore |
| 1312 | 1332 |
| 1313 #ifndef NDEBUG | 1333 #ifndef NDEBUG |
| 1314 // Outside the WebCore namespace for ease of invocation from gdb. | 1334 // Outside the WebCore namespace for ease of invocation from gdb. |
| 1315 void showLayerTree(const WebCore::RenderLayer*); | 1335 void showLayerTree(const WebCore::RenderLayer*); |
| 1316 void showLayerTree(const WebCore::RenderObject*); | 1336 void showLayerTree(const WebCore::RenderObject*); |
| 1317 #endif | 1337 #endif |
| 1318 | 1338 |
| 1319 #endif // RenderLayer_h | 1339 #endif // RenderLayer_h |
| OLD | NEW |