Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2011, 2012 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 13 matching lines...) Expand all Loading... | |
| 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 "config.h" | 31 #include "config.h" |
| 32 #include "WebViewImpl.h" | 32 #include "WebViewImpl.h" |
| 33 | 33 |
| 34 #include "core/rendering/RenderLayerCompositor.h" | |
| 34 #include "public/platform/Platform.h" | 35 #include "public/platform/Platform.h" |
| 35 #include "public/platform/WebDragData.h" | 36 #include "public/platform/WebDragData.h" |
| 36 #include "public/platform/WebFloatPoint.h" | 37 #include "public/platform/WebFloatPoint.h" |
| 37 #include "public/platform/WebGestureCurve.h" | 38 #include "public/platform/WebGestureCurve.h" |
| 38 #include "public/platform/WebImage.h" | 39 #include "public/platform/WebImage.h" |
| 39 #include "public/platform/WebLayer.h" | 40 #include "public/platform/WebLayer.h" |
| 40 #include "public/platform/WebLayerTreeView.h" | 41 #include "public/platform/WebLayerTreeView.h" |
| 41 #include "public/platform/WebPoint.h" | 42 #include "public/platform/WebPoint.h" |
| 42 #include "public/platform/WebRect.h" | 43 #include "public/platform/WebRect.h" |
| 43 #include "public/platform/WebString.h" | 44 #include "public/platform/WebString.h" |
| (...skipping 3752 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3796 | 3797 |
| 3797 if (page()->settings().pinchVirtualViewportEnabled()) { | 3798 if (page()->settings().pinchVirtualViewportEnabled()) { |
| 3798 if (!m_pinchViewports) | 3799 if (!m_pinchViewports) |
| 3799 m_pinchViewports = PinchViewports::create(this); | 3800 m_pinchViewports = PinchViewports::create(this); |
| 3800 | 3801 |
| 3801 m_pinchViewports->setOverflowControlsHostLayer(layer); | 3802 m_pinchViewports->setOverflowControlsHostLayer(layer); |
| 3802 m_pinchViewports->setViewportSize(mainFrameImpl()->frame()->view()->fram eRect().size()); | 3803 m_pinchViewports->setViewportSize(mainFrameImpl()->frame()->view()->fram eRect().size()); |
| 3803 if (layer) { | 3804 if (layer) { |
| 3804 m_rootGraphicsLayer = m_pinchViewports->rootGraphicsLayer(); | 3805 m_rootGraphicsLayer = m_pinchViewports->rootGraphicsLayer(); |
| 3805 m_rootLayer = m_pinchViewports->rootGraphicsLayer()->platformLayer() ; | 3806 m_rootLayer = m_pinchViewports->rootGraphicsLayer()->platformLayer() ; |
| 3806 m_pinchViewports->registerViewportLayersWithTreeView(m_layerTreeView ); | |
| 3807 } else { | 3807 } else { |
| 3808 m_rootGraphicsLayer = 0; | 3808 m_rootGraphicsLayer = 0; |
| 3809 m_rootLayer = 0; | 3809 m_rootLayer = 0; |
| 3810 m_pinchViewports->clearViewportLayersForTreeView(m_layerTreeView); | |
| 3811 } | 3810 } |
| 3812 } else { | 3811 } else { |
| 3813 m_rootGraphicsLayer = layer; | 3812 m_rootGraphicsLayer = layer; |
| 3814 m_rootLayer = layer ? layer->platformLayer() : 0; | 3813 m_rootLayer = layer ? layer->platformLayer() : 0; |
| 3815 } | 3814 } |
| 3816 | 3815 |
| 3817 setIsAcceleratedCompositingActive(layer); | 3816 setIsAcceleratedCompositingActive(layer); |
| 3818 | 3817 |
| 3819 if (m_layerTreeView) { | 3818 if (m_layerTreeView) { |
| 3820 if (m_rootLayer) | 3819 if (m_rootLayer) { |
| 3821 m_layerTreeView->setRootLayer(*m_rootLayer); | 3820 m_layerTreeView->setRootLayer(*m_rootLayer); |
| 3822 else | 3821 // We register viewport layers here since there may not be a layer |
| 3822 // tree view prior to this point. | |
| 3823 if (m_pinchViewports) { | |
| 3824 m_pinchViewports->registerViewportLayersWithTreeView(m_layerTree View); | |
| 3825 } else { | |
| 3826 GraphicsLayer* rootScrollLayer = compositor()->scrollLayer(); | |
| 3827 rootScrollLayer->platformLayer()->setScrollClipLayer(m_rootLayer ); | |
|
enne (OOO)
2013/09/12 18:51:21
I don't think the root layer is the clip layer for
wjmaclean
2013/09/12 19:01:56
Oops, you're right ... I'll fix this.
| |
| 3828 m_layerTreeView->registerViewportLayers(m_rootLayer, rootScrollL ayer->platformLayer(), 0); | |
| 3829 } | |
| 3830 } else { | |
| 3823 m_layerTreeView->clearRootLayer(); | 3831 m_layerTreeView->clearRootLayer(); |
| 3832 if (m_pinchViewports) | |
| 3833 m_pinchViewports->clearViewportLayersForTreeView(m_layerTreeView ); | |
| 3834 else | |
| 3835 m_layerTreeView->clearViewportLayers(); | |
| 3836 } | |
| 3824 } | 3837 } |
| 3825 | 3838 |
| 3826 suppressInvalidations(false); | 3839 suppressInvalidations(false); |
| 3827 } | 3840 } |
| 3828 | 3841 |
| 3829 void WebViewImpl::scheduleCompositingLayerSync() | 3842 void WebViewImpl::scheduleCompositingLayerSync() |
| 3830 { | 3843 { |
| 3831 m_layerTreeView->setNeedsRedraw(); | 3844 m_layerTreeView->setNeedsRedraw(); |
| 3832 } | 3845 } |
| 3833 | 3846 |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4113 // the initial viewport width. | 4126 // the initial viewport width. |
| 4114 // 2. The author has disabled viewport zoom. | 4127 // 2. The author has disabled viewport zoom. |
| 4115 | 4128 |
| 4116 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints(); | 4129 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints(); |
| 4117 | 4130 |
| 4118 return fixedLayoutSize().width == m_size.width | 4131 return fixedLayoutSize().width == m_size.width |
| 4119 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1); | 4132 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1); |
| 4120 } | 4133 } |
| 4121 | 4134 |
| 4122 } // namespace WebKit | 4135 } // namespace WebKit |
| OLD | NEW |