OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 12 matching lines...) Expand all Loading... |
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #include "core/frame/VisualViewport.h" | 31 #include "core/frame/VisualViewport.h" |
32 | 32 |
33 #include "core/dom/DOMNodeIds.h" | |
34 #include "core/frame/FrameHost.h" | 33 #include "core/frame/FrameHost.h" |
35 #include "core/frame/FrameView.h" | 34 #include "core/frame/FrameView.h" |
36 #include "core/frame/LocalFrame.h" | 35 #include "core/frame/LocalFrame.h" |
37 #include "core/frame/PageScaleConstraints.h" | 36 #include "core/frame/PageScaleConstraints.h" |
38 #include "core/frame/PageScaleConstraintsSet.h" | 37 #include "core/frame/PageScaleConstraintsSet.h" |
39 #include "core/frame/Settings.h" | 38 #include "core/frame/Settings.h" |
40 #include "core/inspector/InspectorInstrumentation.h" | 39 #include "core/inspector/InspectorInstrumentation.h" |
41 #include "core/layout/TextAutosizer.h" | 40 #include "core/layout/TextAutosizer.h" |
42 #include "core/layout/compositing/PaintLayerCompositor.h" | 41 #include "core/layout/compositing/PaintLayerCompositor.h" |
43 #include "core/loader/FrameLoaderClient.h" | 42 #include "core/loader/FrameLoaderClient.h" |
44 #include "core/page/ChromeClient.h" | 43 #include "core/page/ChromeClient.h" |
45 #include "core/page/Page.h" | 44 #include "core/page/Page.h" |
46 #include "core/page/scrolling/ScrollingCoordinator.h" | 45 #include "core/page/scrolling/ScrollingCoordinator.h" |
47 #include "platform/Histogram.h" | 46 #include "platform/Histogram.h" |
48 #include "platform/TraceEvent.h" | 47 #include "platform/TraceEvent.h" |
49 #include "platform/geometry/DoubleRect.h" | 48 #include "platform/geometry/DoubleRect.h" |
50 #include "platform/geometry/FloatSize.h" | 49 #include "platform/geometry/FloatSize.h" |
51 #include "platform/graphics/CompositorMutableProperties.h" | |
52 #include "platform/graphics/GraphicsLayer.h" | 50 #include "platform/graphics/GraphicsLayer.h" |
53 #include "platform/scroll/Scrollbar.h" | 51 #include "platform/scroll/Scrollbar.h" |
54 #include "platform/scroll/ScrollbarThemeOverlay.h" | 52 #include "platform/scroll/ScrollbarThemeOverlay.h" |
55 #include "public/platform/WebCompositorSupport.h" | 53 #include "public/platform/WebCompositorSupport.h" |
56 #include "public/platform/WebLayer.h" | 54 #include "public/platform/WebLayer.h" |
57 #include "public/platform/WebLayerTreeView.h" | 55 #include "public/platform/WebLayerTreeView.h" |
58 #include "public/platform/WebScrollbar.h" | 56 #include "public/platform/WebScrollbar.h" |
59 #include "public/platform/WebScrollbarLayer.h" | 57 #include "public/platform/WebScrollbarLayer.h" |
60 | 58 |
61 using blink::WebLayer; | 59 using blink::WebLayer; |
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
401 coordinator->setLayerIsContainerForFixedPositionLayers(m_innerViewportSc
rollLayer.get(), true); | 399 coordinator->setLayerIsContainerForFixedPositionLayers(m_innerViewportSc
rollLayer.get(), true); |
402 | 400 |
403 // Set masks to bounds so the compositor doesn't clobber a manually | 401 // Set masks to bounds so the compositor doesn't clobber a manually |
404 // set inner viewport container layer size. | 402 // set inner viewport container layer size. |
405 m_innerViewportContainerLayer->setMasksToBounds(frameHost().settings().m
ainFrameClipsContent()); | 403 m_innerViewportContainerLayer->setMasksToBounds(frameHost().settings().m
ainFrameClipsContent()); |
406 m_innerViewportContainerLayer->setSize(FloatSize(m_size)); | 404 m_innerViewportContainerLayer->setSize(FloatSize(m_size)); |
407 | 405 |
408 m_innerViewportScrollLayer->platformLayer()->setScrollClipLayer( | 406 m_innerViewportScrollLayer->platformLayer()->setScrollClipLayer( |
409 m_innerViewportContainerLayer->platformLayer()); | 407 m_innerViewportContainerLayer->platformLayer()); |
410 m_innerViewportScrollLayer->platformLayer()->setUserScrollable(true, tru
e); | 408 m_innerViewportScrollLayer->platformLayer()->setUserScrollable(true, tru
e); |
411 if (mainFrame()) { | |
412 if (Document* document = mainFrame()->document()) | |
413 m_innerViewportScrollLayer->setElementId(createCompositorElement
Id(DOMNodeIds::idForNode(document), CompositorSubElementId::Scroll)); | |
414 } | |
415 | 409 |
416 m_rootTransformLayer->addChild(m_innerViewportContainerLayer.get()); | 410 m_rootTransformLayer->addChild(m_innerViewportContainerLayer.get()); |
417 m_innerViewportContainerLayer->addChild(m_overscrollElasticityLayer.get(
)); | 411 m_innerViewportContainerLayer->addChild(m_overscrollElasticityLayer.get(
)); |
418 m_overscrollElasticityLayer->addChild(m_pageScaleLayer.get()); | 412 m_overscrollElasticityLayer->addChild(m_pageScaleLayer.get()); |
419 m_pageScaleLayer->addChild(m_innerViewportScrollLayer.get()); | 413 m_pageScaleLayer->addChild(m_innerViewportScrollLayer.get()); |
420 | 414 |
421 // Ensure this class is set as the scroll layer's ScrollableArea. | 415 // Ensure this class is set as the scroll layer's ScrollableArea. |
422 coordinator->scrollableAreaScrollLayerDidChange(this); | 416 coordinator->scrollableAreaScrollLayerDidChange(this); |
423 | 417 |
424 initializeScrollbars(); | 418 initializeScrollbars(); |
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
841 } else if (graphicsLayer == m_rootTransformLayer) { | 835 } else if (graphicsLayer == m_rootTransformLayer) { |
842 name = "Root Transform Layer"; | 836 name = "Root Transform Layer"; |
843 } else { | 837 } else { |
844 ASSERT_NOT_REACHED(); | 838 ASSERT_NOT_REACHED(); |
845 } | 839 } |
846 | 840 |
847 return name; | 841 return name; |
848 } | 842 } |
849 | 843 |
850 } // namespace blink | 844 } // namespace blink |
OLD | NEW |