OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2011 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 28 matching lines...) Expand all Loading... |
39 #include "core/platform/PlatformWheelEvent.h" | 39 #include "core/platform/PlatformWheelEvent.h" |
40 #include "core/platform/ScrollAnimator.h" | 40 #include "core/platform/ScrollAnimator.h" |
41 #include "core/platform/ScrollbarTheme.h" | 41 #include "core/platform/ScrollbarTheme.h" |
42 #include "core/platform/chromium/TraceEvent.h" | 42 #include "core/platform/chromium/TraceEvent.h" |
43 #include "core/platform/chromium/support/WebScrollbarImpl.h" | 43 #include "core/platform/chromium/support/WebScrollbarImpl.h" |
44 #include "core/platform/chromium/support/WebScrollbarThemeGeometryNative.h" | 44 #include "core/platform/chromium/support/WebScrollbarThemeGeometryNative.h" |
45 #include "core/platform/graphics/GraphicsLayer.h" | 45 #include "core/platform/graphics/GraphicsLayer.h" |
46 #include "core/platform/graphics/IntRect.h" | 46 #include "core/platform/graphics/IntRect.h" |
47 #include "core/platform/graphics/Region.h" | 47 #include "core/platform/graphics/Region.h" |
48 #include "core/platform/graphics/transforms/TransformState.h" | 48 #include "core/platform/graphics/transforms/TransformState.h" |
49 #if OS(DARWIN) | 49 #if OS(MACOSX) |
50 #include "core/platform/mac/ScrollAnimatorMac.h" | 50 #include "core/platform/mac/ScrollAnimatorMac.h" |
51 #endif | 51 #endif |
52 #include "core/plugins/PluginView.h" | 52 #include "core/plugins/PluginView.h" |
53 #include "core/rendering/RenderGeometryMap.h" | 53 #include "core/rendering/RenderGeometryMap.h" |
54 #include "core/rendering/RenderLayerBacking.h" | 54 #include "core/rendering/RenderLayerBacking.h" |
55 #include "core/rendering/RenderLayerCompositor.h" | 55 #include "core/rendering/RenderLayerCompositor.h" |
56 #include "core/rendering/RenderView.h" | 56 #include "core/rendering/RenderView.h" |
57 #include "public/platform/Platform.h" | 57 #include "public/platform/Platform.h" |
58 #include "public/platform/WebCompositorSupport.h" | 58 #include "public/platform/WebCompositorSupport.h" |
59 #include "public/platform/WebLayerPositionConstraint.h" | 59 #include "public/platform/WebLayerPositionConstraint.h" |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 | 248 |
249 WebScrollbarLayer* ScrollingCoordinator::getWebScrollbarLayer(ScrollableArea* sc
rollableArea, ScrollbarOrientation orientation) | 249 WebScrollbarLayer* ScrollingCoordinator::getWebScrollbarLayer(ScrollableArea* sc
rollableArea, ScrollbarOrientation orientation) |
250 { | 250 { |
251 ScrollbarMap& scrollbars = orientation == HorizontalScrollbar ? m_horizontal
Scrollbars : m_verticalScrollbars; | 251 ScrollbarMap& scrollbars = orientation == HorizontalScrollbar ? m_horizontal
Scrollbars : m_verticalScrollbars; |
252 return scrollbars.get(scrollableArea); | 252 return scrollbars.get(scrollableArea); |
253 } | 253 } |
254 | 254 |
255 void ScrollingCoordinator::scrollableAreaScrollbarLayerDidChange(ScrollableArea*
scrollableArea, ScrollbarOrientation orientation) | 255 void ScrollingCoordinator::scrollableAreaScrollbarLayerDidChange(ScrollableArea*
scrollableArea, ScrollbarOrientation orientation) |
256 { | 256 { |
257 // FIXME: Instead of hardcode here, we should make a setting flag. | 257 // FIXME: Instead of hardcode here, we should make a setting flag. |
258 #if OS(DARWIN) | 258 #if OS(MACOSX) |
259 static const bool platformSupportsCoordinatedScrollbar = ScrollAnimatorMac::
canUseCoordinatedScrollbar(); | 259 static const bool platformSupportsCoordinatedScrollbar = ScrollAnimatorMac::
canUseCoordinatedScrollbar(); |
260 static const bool platformSupportsMainFrameOnly = false; // Don't care. | 260 static const bool platformSupportsMainFrameOnly = false; // Don't care. |
261 #elif OS(ANDROID) | 261 #elif OS(ANDROID) |
262 static const bool platformSupportsCoordinatedScrollbar = true; | 262 static const bool platformSupportsCoordinatedScrollbar = true; |
263 static const bool platformSupportsMainFrameOnly = false; | 263 static const bool platformSupportsMainFrameOnly = false; |
264 #else | 264 #else |
265 static const bool platformSupportsCoordinatedScrollbar = true; | 265 static const bool platformSupportsCoordinatedScrollbar = true; |
266 static const bool platformSupportsMainFrameOnly = true; | 266 static const bool platformSupportsMainFrameOnly = true; |
267 #endif | 267 #endif |
268 if (!platformSupportsCoordinatedScrollbar) | 268 if (!platformSupportsCoordinatedScrollbar) |
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
748 ASSERT(m_page); | 748 ASSERT(m_page); |
749 | 749 |
750 if (!coordinatesScrollingForFrameView(frameView)) | 750 if (!coordinatesScrollingForFrameView(frameView)) |
751 return; | 751 return; |
752 | 752 |
753 frameViewLayoutUpdated(frameView); | 753 frameViewLayoutUpdated(frameView); |
754 recomputeWheelEventHandlerCountForFrameView(frameView); | 754 recomputeWheelEventHandlerCountForFrameView(frameView); |
755 updateShouldUpdateScrollLayerPositionOnMainThread(); | 755 updateShouldUpdateScrollLayerPositionOnMainThread(); |
756 } | 756 } |
757 | 757 |
758 #if OS(DARWIN) | 758 #if OS(MACOSX) |
759 void ScrollingCoordinator::handleWheelEventPhase(PlatformWheelEventPhase phase) | 759 void ScrollingCoordinator::handleWheelEventPhase(PlatformWheelEventPhase phase) |
760 { | 760 { |
761 ASSERT(isMainThread()); | 761 ASSERT(isMainThread()); |
762 | 762 |
763 if (!m_page) | 763 if (!m_page) |
764 return; | 764 return; |
765 | 765 |
766 FrameView* frameView = m_page->mainFrame()->view(); | 766 FrameView* frameView = m_page->mainFrame()->view(); |
767 if (!frameView) | 767 if (!frameView) |
768 return; | 768 return; |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
825 stringBuilder.resize(stringBuilder.length() - 2); | 825 stringBuilder.resize(stringBuilder.length() - 2); |
826 return stringBuilder.toString(); | 826 return stringBuilder.toString(); |
827 } | 827 } |
828 | 828 |
829 String ScrollingCoordinator::mainThreadScrollingReasonsAsText() const | 829 String ScrollingCoordinator::mainThreadScrollingReasonsAsText() const |
830 { | 830 { |
831 return mainThreadScrollingReasonsAsText(mainThreadScrollingReasons()); | 831 return mainThreadScrollingReasonsAsText(mainThreadScrollingReasons()); |
832 } | 832 } |
833 | 833 |
834 } // namespace WebCore | 834 } // namespace WebCore |
OLD | NEW |