OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009, 2010 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 631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
642 } | 642 } |
643 | 643 |
644 // Scroll position = scroll origin + scroll offset. Adjust the layer's | 644 // Scroll position = scroll origin + scroll offset. Adjust the layer's |
645 // position to handle whatever the scroll coordinator isn't handling. | 645 // position to handle whatever the scroll coordinator isn't handling. |
646 // The scroll origin is non-zero for RTL pages with overflow. | 646 // The scroll origin is non-zero for RTL pages with overflow. |
647 if (scrollingCoordinatorHandlesOffset) | 647 if (scrollingCoordinatorHandlesOffset) |
648 m_scrollLayer->setPosition(frameView->scrollOrigin()); | 648 m_scrollLayer->setPosition(frameView->scrollOrigin()); |
649 else | 649 else |
650 m_scrollLayer->setPosition(IntPoint(-scrollOffset)); | 650 m_scrollLayer->setPosition(IntPoint(-scrollOffset)); |
651 | 651 |
| 652 showScrollbarLayersIfNeeded(); |
| 653 |
652 DEFINE_STATIC_LOCAL(EnumerationHistogram, acceleratedBackgroundHistogram, | 654 DEFINE_STATIC_LOCAL(EnumerationHistogram, acceleratedBackgroundHistogram, |
653 ("Renderer.AcceleratedFixedRootBackground", | 655 ("Renderer.AcceleratedFixedRootBackground", |
654 AcceleratedFixedRootBackgroundHistogramMax)); | 656 AcceleratedFixedRootBackgroundHistogramMax)); |
655 acceleratedBackgroundHistogram.count(ScrolledMainFrameBucket); | 657 acceleratedBackgroundHistogram.count(ScrolledMainFrameBucket); |
656 } | 658 } |
657 | 659 |
658 void PaintLayerCompositor::frameViewScrollbarsExistenceDidChange() { | 660 void PaintLayerCompositor::frameViewScrollbarsExistenceDidChange() { |
659 if (m_containerLayer) | 661 if (m_containerLayer) |
660 updateOverflowControlsLayers(); | 662 updateOverflowControlsLayers(); |
661 } | 663 } |
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1071 m_layerForScrollCorner = GraphicsLayer::create(this); | 1073 m_layerForScrollCorner = GraphicsLayer::create(this); |
1072 | 1074 |
1073 if (m_layerForScrollCorner->parent() != controlsParent) | 1075 if (m_layerForScrollCorner->parent() != controlsParent) |
1074 controlsParent->addChild(m_layerForScrollCorner.get()); | 1076 controlsParent->addChild(m_layerForScrollCorner.get()); |
1075 } else if (m_layerForScrollCorner) { | 1077 } else if (m_layerForScrollCorner) { |
1076 m_layerForScrollCorner->removeFromParent(); | 1078 m_layerForScrollCorner->removeFromParent(); |
1077 m_layerForScrollCorner = nullptr; | 1079 m_layerForScrollCorner = nullptr; |
1078 } | 1080 } |
1079 | 1081 |
1080 m_layoutView.frameView()->positionScrollbarLayers(); | 1082 m_layoutView.frameView()->positionScrollbarLayers(); |
| 1083 showScrollbarLayersIfNeeded(); |
| 1084 } |
| 1085 |
| 1086 void PaintLayerCompositor::showScrollbarLayersIfNeeded() { |
| 1087 FrameView* frameView = m_layoutView.frameView(); |
| 1088 if (m_scrollLayer && frameView->needsShowScrollbarLayers()) { |
| 1089 m_scrollLayer->platformLayer()->showScrollbars(); |
| 1090 frameView->didShowScrollbarLayers(); |
| 1091 } |
1081 } | 1092 } |
1082 | 1093 |
1083 void PaintLayerCompositor::ensureRootLayer() { | 1094 void PaintLayerCompositor::ensureRootLayer() { |
1084 if (m_rootLayerAttachment != RootLayerUnattached) | 1095 if (m_rootLayerAttachment != RootLayerUnattached) |
1085 return; | 1096 return; |
1086 | 1097 |
1087 if (isMainFrame()) | 1098 if (isMainFrame()) |
1088 visualViewport().createLayerTree(); | 1099 visualViewport().createLayerTree(); |
1089 | 1100 |
1090 // When RLS is enabled, none of the PLC GraphicsLayers exist. | 1101 // When RLS is enabled, none of the PLC GraphicsLayers exist. |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1306 } else if (graphicsLayer == m_scrollLayer.get()) { | 1317 } else if (graphicsLayer == m_scrollLayer.get()) { |
1307 name = "Frame Scrolling Layer"; | 1318 name = "Frame Scrolling Layer"; |
1308 } else { | 1319 } else { |
1309 NOTREACHED(); | 1320 NOTREACHED(); |
1310 } | 1321 } |
1311 | 1322 |
1312 return name; | 1323 return name; |
1313 } | 1324 } |
1314 | 1325 |
1315 } // namespace blink | 1326 } // namespace blink |
OLD | NEW |