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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 #include "core/platform/graphics/ColorSpace.h" | 148 #include "core/platform/graphics/ColorSpace.h" |
149 #include "core/platform/graphics/Extensions3D.h" | 149 #include "core/platform/graphics/Extensions3D.h" |
150 #include "core/platform/graphics/FontCache.h" | 150 #include "core/platform/graphics/FontCache.h" |
151 #include "core/platform/graphics/FontDescription.h" | 151 #include "core/platform/graphics/FontDescription.h" |
152 #include "core/platform/graphics/GraphicsContext.h" | 152 #include "core/platform/graphics/GraphicsContext.h" |
153 #include "core/platform/graphics/GraphicsContext3D.h" | 153 #include "core/platform/graphics/GraphicsContext3D.h" |
154 #include "core/platform/graphics/Image.h" | 154 #include "core/platform/graphics/Image.h" |
155 #include "core/platform/graphics/ImageBuffer.h" | 155 #include "core/platform/graphics/ImageBuffer.h" |
156 #include "core/platform/graphics/chromium/LayerPainterChromium.h" | 156 #include "core/platform/graphics/chromium/LayerPainterChromium.h" |
157 #include "core/platform/graphics/gpu/SharedGraphicsContext3D.h" | 157 #include "core/platform/graphics/gpu/SharedGraphicsContext3D.h" |
| 158 #include "core/rendering/RenderLayerCompositor.h" |
158 #include "core/rendering/RenderView.h" | 159 #include "core/rendering/RenderView.h" |
159 #include "core/rendering/RenderWidget.h" | 160 #include "core/rendering/RenderWidget.h" |
160 #include "core/rendering/TextAutosizer.h" | 161 #include "core/rendering/TextAutosizer.h" |
161 #include "modules/geolocation/GeolocationController.h" | 162 #include "modules/geolocation/GeolocationController.h" |
162 #include "weborigin/SchemeRegistry.h" | 163 #include "weborigin/SchemeRegistry.h" |
163 #include "weborigin/SecurityOrigin.h" | 164 #include "weborigin/SecurityOrigin.h" |
164 #include "weborigin/SecurityPolicy.h" | 165 #include "weborigin/SecurityPolicy.h" |
165 #include "painting/ContinuousPainter.h" | 166 #include "painting/ContinuousPainter.h" |
166 | 167 |
167 #if ENABLE(DEFAULT_RENDER_THEME) | 168 #if ENABLE(DEFAULT_RENDER_THEME) |
(...skipping 3628 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 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 Loading... |
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 |
OLD | NEW |