| 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 28 matching lines...) Expand all Loading... |
| 39 * other provisions required by the MPL or the GPL, as the case may be. | 39 * other provisions required by the MPL or the GPL, as the case may be. |
| 40 * If you do not delete the provisions above, a recipient may use your | 40 * If you do not delete the provisions above, a recipient may use your |
| 41 * version of this file under any of the LGPL, the MPL or the GPL. | 41 * version of this file under any of the LGPL, the MPL or the GPL. |
| 42 */ | 42 */ |
| 43 | 43 |
| 44 #ifndef PaintLayerScrollableArea_h | 44 #ifndef PaintLayerScrollableArea_h |
| 45 #define PaintLayerScrollableArea_h | 45 #define PaintLayerScrollableArea_h |
| 46 | 46 |
| 47 #include "core/CoreExport.h" | 47 #include "core/CoreExport.h" |
| 48 #include "core/layout/LayoutBox.h" | 48 #include "core/layout/LayoutBox.h" |
| 49 #include "core/paint/PaintInvalidationCapableScrollableArea.h" |
| 49 #include "core/paint/PaintLayerFragment.h" | 50 #include "core/paint/PaintLayerFragment.h" |
| 50 #include "platform/heap/Handle.h" | 51 #include "platform/heap/Handle.h" |
| 51 #include "platform/scroll/ScrollableArea.h" | |
| 52 | 52 |
| 53 namespace blink { | 53 namespace blink { |
| 54 | 54 |
| 55 enum ResizerHitTestType { | 55 enum ResizerHitTestType { |
| 56 ResizerForPointer, | 56 ResizerForPointer, |
| 57 ResizerForTouch | 57 ResizerForTouch |
| 58 }; | 58 }; |
| 59 | 59 |
| 60 class PlatformEvent; | 60 class PlatformEvent; |
| 61 class LayoutBox; | 61 class LayoutBox; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 90 // | 90 // |
| 91 // | 91 // |
| 92 // ***** OVERLAY SCROLLBARS ***** | 92 // ***** OVERLAY SCROLLBARS ***** |
| 93 // Overlay scrollbars are painted on top of the box's content. As such they | 93 // Overlay scrollbars are painted on top of the box's content. As such they |
| 94 // don't use any space in the box. Software overlay scrollbars are painted by | 94 // don't use any space in the box. Software overlay scrollbars are painted by |
| 95 // PaintLayerPainter::paintOverlayScrollbars after all content as part of a | 95 // PaintLayerPainter::paintOverlayScrollbars after all content as part of a |
| 96 // separate tree traversal. The reason for this 2nd traversal is that they need | 96 // separate tree traversal. The reason for this 2nd traversal is that they need |
| 97 // to be painted on top of everything. Hardware accelerated overlay scrollbars | 97 // to be painted on top of everything. Hardware accelerated overlay scrollbars |
| 98 // are painted by their associated GraphicsLayer that sets the paint flag | 98 // are painted by their associated GraphicsLayer that sets the paint flag |
| 99 // PaintLayerPaintingOverlayScrollbars. | 99 // PaintLayerPaintingOverlayScrollbars. |
| 100 class CORE_EXPORT PaintLayerScrollableArea final : public NoBaseWillBeGarbageCol
lectedFinalized<PaintLayerScrollableArea>, public ScrollableArea { | 100 class CORE_EXPORT PaintLayerScrollableArea final : public NoBaseWillBeGarbageCol
lectedFinalized<PaintLayerScrollableArea>, public PaintInvalidationCapableScroll
ableArea { |
| 101 USING_FAST_MALLOC_WILL_BE_REMOVED(PaintLayerScrollableArea); | 101 USING_FAST_MALLOC_WILL_BE_REMOVED(PaintLayerScrollableArea); |
| 102 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(PaintLayerScrollableArea); | 102 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(PaintLayerScrollableArea); |
| 103 friend class Internals; | 103 friend class Internals; |
| 104 | 104 |
| 105 private: | 105 private: |
| 106 class ScrollbarManager { | 106 class ScrollbarManager { |
| 107 DISALLOW_NEW(); | 107 DISALLOW_NEW(); |
| 108 | 108 |
| 109 // Helper class to manage the life cycle of Scrollbar objects. Some lay
out containers | 109 // Helper class to manage the life cycle of Scrollbar objects. Some lay
out containers |
| 110 // (e.g., flexbox, table) run multi-pass layout on their children, apply
ing different | 110 // (e.g., flexbox, table) run multi-pass layout on their children, apply
ing different |
| (...skipping 22 matching lines...) Expand all Loading... |
| 133 bool hasHorizontalScrollbar() const { return horizontalScrollbar(); } | 133 bool hasHorizontalScrollbar() const { return horizontalScrollbar(); } |
| 134 bool hasVerticalScrollbar() const { return verticalScrollbar(); } | 134 bool hasVerticalScrollbar() const { return verticalScrollbar(); } |
| 135 | 135 |
| 136 void setHasHorizontalScrollbar(bool hasScrollbar); | 136 void setHasHorizontalScrollbar(bool hasScrollbar); |
| 137 void setHasVerticalScrollbar(bool hasScrollbar); | 137 void setHasVerticalScrollbar(bool hasScrollbar); |
| 138 | 138 |
| 139 DECLARE_TRACE(); | 139 DECLARE_TRACE(); |
| 140 | 140 |
| 141 private: | 141 private: |
| 142 PassRefPtrWillBeRawPtr<Scrollbar> createScrollbar(ScrollbarOrientation); | 142 PassRefPtrWillBeRawPtr<Scrollbar> createScrollbar(ScrollbarOrientation); |
| 143 void destroyScrollbar(ScrollbarOrientation, bool invalidate = false); | 143 void destroyScrollbar(ScrollbarOrientation); |
| 144 | 144 |
| 145 private: | 145 private: |
| 146 RawPtrWillBeMember<PaintLayerScrollableArea> m_scrollableArea; | 146 RawPtrWillBeMember<PaintLayerScrollableArea> m_scrollableArea; |
| 147 | 147 |
| 148 // The scrollbars associated with m_scrollableArea. Both can nullptr. | 148 // The scrollbars associated with m_scrollableArea. Both can nullptr. |
| 149 RefPtrWillBeMember<Scrollbar> m_hBar; | 149 RefPtrWillBeMember<Scrollbar> m_hBar; |
| 150 RefPtrWillBeMember<Scrollbar> m_vBar; | 150 RefPtrWillBeMember<Scrollbar> m_vBar; |
| 151 | 151 |
| 152 unsigned m_canDetachScrollbars: 1; | 152 unsigned m_canDetachScrollbars: 1; |
| 153 unsigned m_hBarIsAttached: 1; | 153 unsigned m_hBarIsAttached: 1; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 181 GraphicsLayer* layerForScrolling() const override; | 181 GraphicsLayer* layerForScrolling() const override; |
| 182 | 182 |
| 183 // GraphicsLayers for the scrolling components. | 183 // GraphicsLayers for the scrolling components. |
| 184 // | 184 // |
| 185 // Any function can return nullptr if they are not accelerated. | 185 // Any function can return nullptr if they are not accelerated. |
| 186 GraphicsLayer* layerForHorizontalScrollbar() const override; | 186 GraphicsLayer* layerForHorizontalScrollbar() const override; |
| 187 GraphicsLayer* layerForVerticalScrollbar() const override; | 187 GraphicsLayer* layerForVerticalScrollbar() const override; |
| 188 GraphicsLayer* layerForScrollCorner() const override; | 188 GraphicsLayer* layerForScrollCorner() const override; |
| 189 | 189 |
| 190 bool usesCompositedScrolling() const override; | 190 bool usesCompositedScrolling() const override; |
| 191 void invalidateScrollbarRect(Scrollbar*, const IntRect&) override; | 191 void scrollControlWasSetNeedsPaintInvalidation() override; |
| 192 void invalidateScrollCornerRect(const IntRect&) override; | |
| 193 bool shouldUseIntegerScrollOffset() const override; | 192 bool shouldUseIntegerScrollOffset() const override; |
| 194 bool isActive() const override; | 193 bool isActive() const override; |
| 195 bool isScrollCornerVisible() const override; | 194 bool isScrollCornerVisible() const override; |
| 196 IntRect scrollCornerRect() const override; | 195 IntRect scrollCornerRect() const override; |
| 197 IntRect convertFromScrollbarToContainingView(const Scrollbar*, const IntRect
&) const override; | 196 IntRect convertFromScrollbarToContainingView(const Scrollbar*, const IntRect
&) const override; |
| 198 IntRect convertFromContainingViewToScrollbar(const Scrollbar*, const IntRect
&) const override; | 197 IntRect convertFromContainingViewToScrollbar(const Scrollbar*, const IntRect
&) const override; |
| 199 IntPoint convertFromScrollbarToContainingView(const Scrollbar*, const IntPoi
nt&) const override; | 198 IntPoint convertFromScrollbarToContainingView(const Scrollbar*, const IntPoi
nt&) const override; |
| 200 IntPoint convertFromContainingViewToScrollbar(const Scrollbar*, const IntPoi
nt&) const override; | 199 IntPoint convertFromContainingViewToScrollbar(const Scrollbar*, const IntPoi
nt&) const override; |
| 201 int scrollSize(ScrollbarOrientation) const override; | 200 int scrollSize(ScrollbarOrientation) const override; |
| 202 IntPoint scrollPosition() const override; | 201 IntPoint scrollPosition() const override; |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 401 LayoutScrollbarPart* m_resizer; | 400 LayoutScrollbarPart* m_resizer; |
| 402 | 401 |
| 403 #if ENABLE(ASSERT) | 402 #if ENABLE(ASSERT) |
| 404 bool m_hasBeenDisposed; | 403 bool m_hasBeenDisposed; |
| 405 #endif | 404 #endif |
| 406 }; | 405 }; |
| 407 | 406 |
| 408 } // namespace blink | 407 } // namespace blink |
| 409 | 408 |
| 410 #endif // LayerScrollableArea_h | 409 #endif // LayerScrollableArea_h |
| OLD | NEW |