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 25 matching lines...) Expand all Loading... |
36 #include "core/layout/LayoutGeometryMap.h" | 36 #include "core/layout/LayoutGeometryMap.h" |
37 #include "core/layout/LayoutPart.h" | 37 #include "core/layout/LayoutPart.h" |
38 #include "core/layout/LayoutView.h" | 38 #include "core/layout/LayoutView.h" |
39 #include "core/layout/compositing/CompositedLayerMapping.h" | 39 #include "core/layout/compositing/CompositedLayerMapping.h" |
40 #include "core/layout/compositing/PaintLayerCompositor.h" | 40 #include "core/layout/compositing/PaintLayerCompositor.h" |
41 #include "core/page/ChromeClient.h" | 41 #include "core/page/ChromeClient.h" |
42 #include "core/page/Page.h" | 42 #include "core/page/Page.h" |
43 #include "core/plugins/PluginView.h" | 43 #include "core/plugins/PluginView.h" |
44 #include "platform/RuntimeEnabledFeatures.h" | 44 #include "platform/RuntimeEnabledFeatures.h" |
45 #include "platform/TraceEvent.h" | 45 #include "platform/TraceEvent.h" |
| 46 #include "platform/animation/CompositorAnimationTimeline.h" |
46 #include "platform/exported/WebScrollbarImpl.h" | 47 #include "platform/exported/WebScrollbarImpl.h" |
47 #include "platform/exported/WebScrollbarThemeGeometryNative.h" | 48 #include "platform/exported/WebScrollbarThemeGeometryNative.h" |
48 #include "platform/geometry/Region.h" | 49 #include "platform/geometry/Region.h" |
49 #include "platform/geometry/TransformState.h" | 50 #include "platform/geometry/TransformState.h" |
| 51 #include "platform/graphics/CompositorFactory.h" |
50 #include "platform/graphics/GraphicsLayer.h" | 52 #include "platform/graphics/GraphicsLayer.h" |
51 #if OS(MACOSX) | 53 #if OS(MACOSX) |
52 #include "platform/mac/ScrollAnimatorMac.h" | 54 #include "platform/mac/ScrollAnimatorMac.h" |
53 #endif | 55 #endif |
54 #include "platform/scroll/MainThreadScrollingReason.h" | 56 #include "platform/scroll/MainThreadScrollingReason.h" |
55 #include "platform/scroll/ScrollAnimatorBase.h" | 57 #include "platform/scroll/ScrollAnimatorBase.h" |
56 #include "platform/scroll/ScrollbarTheme.h" | 58 #include "platform/scroll/ScrollbarTheme.h" |
57 #include "public/platform/Platform.h" | 59 #include "public/platform/Platform.h" |
58 #include "public/platform/WebCompositorAnimationTimeline.h" | |
59 #include "public/platform/WebCompositorSupport.h" | 60 #include "public/platform/WebCompositorSupport.h" |
60 #include "public/platform/WebLayerPositionConstraint.h" | 61 #include "public/platform/WebLayerPositionConstraint.h" |
61 #include "public/platform/WebLayerTreeView.h" | 62 #include "public/platform/WebLayerTreeView.h" |
62 #include "public/platform/WebScrollbarLayer.h" | 63 #include "public/platform/WebScrollbarLayer.h" |
63 #include "public/platform/WebScrollbarThemeGeometry.h" | 64 #include "public/platform/WebScrollbarThemeGeometry.h" |
64 #include "public/platform/WebScrollbarThemePainter.h" | 65 #include "public/platform/WebScrollbarThemePainter.h" |
65 #include "wtf/text/StringBuilder.h" | 66 #include "wtf/text/StringBuilder.h" |
66 | 67 |
67 using blink::WebLayer; | 68 using blink::WebLayer; |
68 using blink::WebLayerPositionConstraint; | 69 using blink::WebLayerPositionConstraint; |
(...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
689 if (mainThreadScrollingReasons) | 690 if (mainThreadScrollingReasons) |
690 scrollLayer->addMainThreadScrollingReasons(mainThreadScrollingReason
s); | 691 scrollLayer->addMainThreadScrollingReasons(mainThreadScrollingReason
s); |
691 else | 692 else |
692 scrollLayer->clearMainThreadScrollingReasons(); | 693 scrollLayer->clearMainThreadScrollingReasons(); |
693 } | 694 } |
694 } | 695 } |
695 | 696 |
696 void ScrollingCoordinator::layerTreeViewInitialized(WebLayerTreeView& layerTreeV
iew) | 697 void ScrollingCoordinator::layerTreeViewInitialized(WebLayerTreeView& layerTreeV
iew) |
697 { | 698 { |
698 if (RuntimeEnabledFeatures::compositorAnimationTimelinesEnabled() && Platfor
m::current()->isThreadedAnimationEnabled()) { | 699 if (RuntimeEnabledFeatures::compositorAnimationTimelinesEnabled() && Platfor
m::current()->isThreadedAnimationEnabled()) { |
699 ASSERT(Platform::current()->compositorSupport()); | 700 m_programmaticScrollAnimatorTimeline = adoptPtr(CompositorFactory::curre
nt().createAnimationTimeline()); |
700 m_programmaticScrollAnimatorTimeline = adoptPtr(Platform::current()->com
positorSupport()->createAnimationTimeline()); | 701 layerTreeView.attachCompositorAnimationTimeline(m_programmaticScrollAnim
atorTimeline->animationTimeline()); |
701 layerTreeView.attachCompositorAnimationTimeline(m_programmaticScrollAnim
atorTimeline.get()); | |
702 } | 702 } |
703 } | 703 } |
704 | 704 |
705 void ScrollingCoordinator::willCloseLayerTreeView(WebLayerTreeView& layerTreeVie
w) | 705 void ScrollingCoordinator::willCloseLayerTreeView(WebLayerTreeView& layerTreeVie
w) |
706 { | 706 { |
707 if (m_programmaticScrollAnimatorTimeline) { | 707 if (m_programmaticScrollAnimatorTimeline) { |
708 layerTreeView.detachCompositorAnimationTimeline(m_programmaticScrollAnim
atorTimeline.get()); | 708 layerTreeView.detachCompositorAnimationTimeline(m_programmaticScrollAnim
atorTimeline->animationTimeline()); |
709 m_programmaticScrollAnimatorTimeline.clear(); | 709 m_programmaticScrollAnimatorTimeline.clear(); |
710 } | 710 } |
711 } | 711 } |
712 | 712 |
713 void ScrollingCoordinator::willBeDestroyed() | 713 void ScrollingCoordinator::willBeDestroyed() |
714 { | 714 { |
715 ASSERT(m_page); | 715 ASSERT(m_page); |
716 | 716 |
717 m_page = nullptr; | 717 m_page = nullptr; |
718 for (const auto& scrollbar : m_horizontalScrollbars) | 718 for (const auto& scrollbar : m_horizontalScrollbars) |
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1051 bool frameIsScrollable = frameView && frameView->isScrollable(); | 1051 bool frameIsScrollable = frameView && frameView->isScrollable(); |
1052 if (frameIsScrollable != m_wasFrameScrollable) | 1052 if (frameIsScrollable != m_wasFrameScrollable) |
1053 return true; | 1053 return true; |
1054 | 1054 |
1055 if (WebLayer* scrollLayer = frameView ? toWebLayer(frameView->layerForScroll
ing()) : nullptr) | 1055 if (WebLayer* scrollLayer = frameView ? toWebLayer(frameView->layerForScroll
ing()) : nullptr) |
1056 return WebSize(frameView->contentsSize()) != scrollLayer->bounds(); | 1056 return WebSize(frameView->contentsSize()) != scrollLayer->bounds(); |
1057 return false; | 1057 return false; |
1058 } | 1058 } |
1059 | 1059 |
1060 } // namespace blink | 1060 } // namespace blink |
OLD | NEW |