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 * Copyright (C) 2013 Intel Corporation. All rights reserved. | 3 * Copyright (C) 2013 Intel Corporation. All rights reserved. |
4 * | 4 * |
5 * Portions are Copyright (C) 1998 Netscape Communications Corporation. | 5 * Portions are Copyright (C) 1998 Netscape Communications Corporation. |
6 * | 6 * |
7 * Other contributors: | 7 * Other contributors: |
8 * Robert O'Callahan <roc+@cs.cmu.edu> | 8 * Robert O'Callahan <roc+@cs.cmu.edu> |
9 * David Baron <dbaron@fas.harvard.edu> | 9 * David Baron <dbaron@fas.harvard.edu> |
10 * Christian Biesinger <cbiesinger@web.de> | 10 * Christian Biesinger <cbiesinger@web.de> |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 // concept. | 149 // concept. |
150 // | 150 // |
151 // Its features need to be migrated to helper objects. This was started with the | 151 // Its features need to be migrated to helper objects. This was started with the |
152 // introduction of satellite objects: PaintLayer*. Those helper objects then | 152 // introduction of satellite objects: PaintLayer*. Those helper objects then |
153 // need to be moved to the appropriate LayoutObject class, probably to a rare | 153 // need to be moved to the appropriate LayoutObject class, probably to a rare |
154 // data field to avoid growing all the LayoutObjects. | 154 // data field to avoid growing all the LayoutObjects. |
155 // | 155 // |
156 // A good example of this is PaintLayerScrollableArea, which can only happen | 156 // A good example of this is PaintLayerScrollableArea, which can only happen |
157 // be instanciated for LayoutBoxes. With the current design, it's hard to know | 157 // be instanciated for LayoutBoxes. With the current design, it's hard to know |
158 // that by reading the code. | 158 // that by reading the code. |
159 class CORE_EXPORT PaintLayer { | 159 class CORE_EXPORT PaintLayer : public DisplayItemClient { |
160 WTF_MAKE_NONCOPYABLE(PaintLayer); | 160 WTF_MAKE_NONCOPYABLE(PaintLayer); |
161 public: | 161 public: |
162 PaintLayer(LayoutBoxModelObject*, PaintLayerType); | 162 PaintLayer(LayoutBoxModelObject*, PaintLayerType); |
163 ~PaintLayer(); | 163 ~PaintLayer(); |
164 | 164 |
165 String debugName() const; | 165 String debugName() const final; |
166 | 166 |
167 LayoutBoxModelObject* layoutObject() const { return m_layoutObject; } | 167 LayoutBoxModelObject* layoutObject() const { return m_layoutObject; } |
168 LayoutBox* layoutBox() const { return m_layoutObject && m_layoutObject->isBo
x() ? toLayoutBox(m_layoutObject) : 0; } | 168 LayoutBox* layoutBox() const { return m_layoutObject && m_layoutObject->isBo
x() ? toLayoutBox(m_layoutObject) : 0; } |
169 PaintLayer* parent() const { return m_parent; } | 169 PaintLayer* parent() const { return m_parent; } |
170 PaintLayer* previousSibling() const { return m_previous; } | 170 PaintLayer* previousSibling() const { return m_previous; } |
171 PaintLayer* nextSibling() const { return m_next; } | 171 PaintLayer* nextSibling() const { return m_next; } |
172 PaintLayer* firstChild() const { return m_first; } | 172 PaintLayer* firstChild() const { return m_first; } |
173 PaintLayer* lastChild() const { return m_last; } | 173 PaintLayer* lastChild() const { return m_last; } |
174 | 174 |
175 // TODO(wangxianzhu): Find a better name for it. 'paintContainer' might be g
ood but | 175 // TODO(wangxianzhu): Find a better name for it. 'paintContainer' might be g
ood but |
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
611 bool needsRepaint() const { return m_needsRepaint; } | 611 bool needsRepaint() const { return m_needsRepaint; } |
612 void setNeedsRepaint(); | 612 void setNeedsRepaint(); |
613 void clearNeedsRepaintRecursively(); | 613 void clearNeedsRepaintRecursively(); |
614 | 614 |
615 IntSize previousScrollOffsetAccumulationForPainting() const { return m_previ
ousScrollOffsetAccumulationForPainting; } | 615 IntSize previousScrollOffsetAccumulationForPainting() const { return m_previ
ousScrollOffsetAccumulationForPainting; } |
616 void setPreviousScrollOffsetAccumulationForPainting(const IntSize& s) { m_pr
eviousScrollOffsetAccumulationForPainting = s; } | 616 void setPreviousScrollOffsetAccumulationForPainting(const IntSize& s) { m_pr
eviousScrollOffsetAccumulationForPainting = s; } |
617 | 617 |
618 ClipRects* previousPaintingClipRects() const { return m_previousPaintingClip
Rects.get(); } | 618 ClipRects* previousPaintingClipRects() const { return m_previousPaintingClip
Rects.get(); } |
619 void setPreviousPaintingClipRects(ClipRects* clipRects) { m_previousPainting
ClipRects = clipRects; } | 619 void setPreviousPaintingClipRects(ClipRects* clipRects) { m_previousPainting
ClipRects = clipRects; } |
620 | 620 |
621 // For subsequence display items. | |
622 DisplayItemClient displayItemClient() const { return toDisplayItemClient(thi
s); } | |
623 | |
624 PaintTiming* paintTiming(); | 621 PaintTiming* paintTiming(); |
625 | 622 |
626 private: | 623 private: |
627 // Bounding box in the coordinates of this layer. | 624 // Bounding box in the coordinates of this layer. |
628 LayoutRect logicalBoundingBox() const; | 625 LayoutRect logicalBoundingBox() const; |
629 | 626 |
630 bool hasOverflowControls() const; | 627 bool hasOverflowControls() const; |
631 | 628 |
632 void dirtyAncestorChainHasSelfPaintingLayerDescendantStatus(); | 629 void dirtyAncestorChainHasSelfPaintingLayerDescendantStatus(); |
633 | 630 |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
816 | 813 |
817 } // namespace blink | 814 } // namespace blink |
818 | 815 |
819 #ifndef NDEBUG | 816 #ifndef NDEBUG |
820 // Outside the WebCore namespace for ease of invocation from gdb. | 817 // Outside the WebCore namespace for ease of invocation from gdb. |
821 void showLayerTree(const blink::PaintLayer*); | 818 void showLayerTree(const blink::PaintLayer*); |
822 void showLayerTree(const blink::LayoutObject*); | 819 void showLayerTree(const blink::LayoutObject*); |
823 #endif | 820 #endif |
824 | 821 |
825 #endif // Layer_h | 822 #endif // Layer_h |
OLD | NEW |