Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(125)

Side by Side Diff: Source/web/WebViewImpl.cpp

Issue 23464035: Create Pinch Virtual Viewport scrollbar layers in Blink. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Remove setClip[Layer() code; resolve this in a subsequent patch. Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/web/PinchViewports.cpp ('k') | public/platform/WebLayerTreeView.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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"
jamesr 2013/09/12 20:35:03 could you put this with the rest of the core/... i
wjmaclean 2013/09/12 20:42:54 Done.
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
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 m_layerTreeView->registerViewportLayers(m_rootLayer, rootScrollL ayer->platformLayer(), 0);
3828 }
3829 } else {
3823 m_layerTreeView->clearRootLayer(); 3830 m_layerTreeView->clearRootLayer();
3831 if (m_pinchViewports)
3832 m_pinchViewports->clearViewportLayersForTreeView(m_layerTreeView );
3833 else
3834 m_layerTreeView->clearViewportLayers();
3835 }
3824 } 3836 }
3825 3837
3826 suppressInvalidations(false); 3838 suppressInvalidations(false);
3827 } 3839 }
3828 3840
3829 void WebViewImpl::scheduleCompositingLayerSync() 3841 void WebViewImpl::scheduleCompositingLayerSync()
3830 { 3842 {
3831 m_layerTreeView->setNeedsRedraw(); 3843 m_layerTreeView->setNeedsRedraw();
3832 } 3844 }
3833 3845
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
4113 // the initial viewport width. 4125 // the initial viewport width.
4114 // 2. The author has disabled viewport zoom. 4126 // 2. The author has disabled viewport zoom.
4115 4127
4116 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints(); 4128 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints();
4117 4129
4118 return fixedLayoutSize().width == m_size.width 4130 return fixedLayoutSize().width == m_size.width
4119 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1); 4131 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1);
4120 } 4132 }
4121 4133
4122 } // namespace WebKit 4134 } // namespace WebKit
OLDNEW
« no previous file with comments | « Source/web/PinchViewports.cpp ('k') | public/platform/WebLayerTreeView.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698