OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2010, Google Inc. All rights reserved. | 2 * Copyright (c) 2010, Google Inc. All rights reserved. |
3 * Copyright (C) 2008, 2011 Apple Inc. All Rights Reserved. | 3 * Copyright (C) 2008, 2011 Apple Inc. All Rights Reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 22 matching lines...) Expand all Loading... |
33 | 33 |
34 #include "platform/HostWindow.h" | 34 #include "platform/HostWindow.h" |
35 #include "platform/Logging.h" | 35 #include "platform/Logging.h" |
36 #include "platform/geometry/DoubleRect.h" | 36 #include "platform/geometry/DoubleRect.h" |
37 #include "platform/geometry/FloatPoint.h" | 37 #include "platform/geometry/FloatPoint.h" |
38 #include "platform/geometry/LayoutRect.h" | 38 #include "platform/geometry/LayoutRect.h" |
39 #include "platform/graphics/GraphicsLayer.h" | 39 #include "platform/graphics/GraphicsLayer.h" |
40 #include "platform/scroll/MainThreadScrollingReason.h" | 40 #include "platform/scroll/MainThreadScrollingReason.h" |
41 #include "platform/scroll/ProgrammaticScrollAnimator.h" | 41 #include "platform/scroll/ProgrammaticScrollAnimator.h" |
42 #include "platform/scroll/ScrollbarTheme.h" | 42 #include "platform/scroll/ScrollbarTheme.h" |
43 #include "wtf/PassOwnPtr.h" | |
44 | 43 |
45 #include "platform/TraceEvent.h" | 44 #include "platform/TraceEvent.h" |
46 | 45 |
47 static const int kPixelsPerLineStep = 40; | 46 static const int kPixelsPerLineStep = 40; |
48 static const float kMinFractionToStepWhenPaging = 0.875f; | 47 static const float kMinFractionToStepWhenPaging = 0.875f; |
49 | 48 |
50 namespace blink { | 49 namespace blink { |
51 | 50 |
52 struct SameSizeAsScrollableArea { | 51 struct SameSizeAsScrollableArea { |
53 virtual ~SameSizeAsScrollableArea(); | 52 virtual ~SameSizeAsScrollableArea(); |
54 #if ENABLE(ASSERT) && ENABLE(OILPAN) | 53 #if ENABLE(ASSERT) |
55 VerifyEagerFinalization verifyEager; | 54 VerifyEagerFinalization verifyEager; |
56 #endif | 55 #endif |
57 Member<void*> pointer[2]; | 56 Member<void*> pointer[2]; |
58 unsigned bitfields : 16; | 57 unsigned bitfields : 16; |
59 IntPoint origin; | 58 IntPoint origin; |
60 }; | 59 }; |
61 | 60 |
62 static_assert(sizeof(ScrollableArea) == sizeof(SameSizeAsScrollableArea), "Scrol
lableArea should stay small"); | 61 static_assert(sizeof(ScrollableArea) == sizeof(SameSizeAsScrollableArea), "Scrol
lableArea should stay small"); |
63 | 62 |
64 int ScrollableArea::pixelsPerLineStep(HostWindow* host) | 63 int ScrollableArea::pixelsPerLineStep(HostWindow* host) |
(...skipping 22 matching lines...) Expand all Loading... |
87 , m_scrollCornerNeedsPaintInvalidation(false) | 86 , m_scrollCornerNeedsPaintInvalidation(false) |
88 { | 87 { |
89 } | 88 } |
90 | 89 |
91 ScrollableArea::~ScrollableArea() | 90 ScrollableArea::~ScrollableArea() |
92 { | 91 { |
93 } | 92 } |
94 | 93 |
95 void ScrollableArea::clearScrollAnimators() | 94 void ScrollableArea::clearScrollAnimators() |
96 { | 95 { |
97 #if OS(MACOSX) && ENABLE(OILPAN) | 96 #if OS(MACOSX) |
98 // TODO(ymalik): Let oilpan decide when to call dispose rather than | |
99 // explicitly calling it here to cleanup. | |
100 if (m_scrollAnimator) | 97 if (m_scrollAnimator) |
101 m_scrollAnimator->dispose(); | 98 m_scrollAnimator->dispose(); |
102 #endif | 99 #endif |
103 m_scrollAnimator.clear(); | 100 m_scrollAnimator.clear(); |
104 m_programmaticScrollAnimator.clear(); | 101 m_programmaticScrollAnimator.clear(); |
105 } | 102 } |
106 | 103 |
107 ScrollAnimatorBase& ScrollableArea::scrollAnimator() const | 104 ScrollAnimatorBase& ScrollableArea::scrollAnimator() const |
108 { | 105 { |
109 if (!m_scrollAnimator) | 106 if (!m_scrollAnimator) |
(...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
614 std::max(0, size.height() - horizontalScrollbarHeight)); | 611 std::max(0, size.height() - horizontalScrollbarHeight)); |
615 } | 612 } |
616 | 613 |
617 DEFINE_TRACE(ScrollableArea) | 614 DEFINE_TRACE(ScrollableArea) |
618 { | 615 { |
619 visitor->trace(m_scrollAnimator); | 616 visitor->trace(m_scrollAnimator); |
620 visitor->trace(m_programmaticScrollAnimator); | 617 visitor->trace(m_programmaticScrollAnimator); |
621 } | 618 } |
622 | 619 |
623 } // namespace blink | 620 } // namespace blink |
OLD | NEW |