| OLD | NEW |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "config.h" | 5 #include "config.h" |
| 6 #include "web_layer_tree_view_impl.h" | 6 #include "web_layer_tree_view_impl.h" |
| 7 | 7 |
| 8 #include "cc/font_atlas.h" | 8 #include "cc/font_atlas.h" |
| 9 #include "cc/input_handler.h" | 9 #include "cc/input_handler.h" |
| 10 #include "cc/layer.h" | 10 #include "cc/layer.h" |
| 11 #include "cc/layer_tree_host.h" | 11 #include "cc/layer_tree_host.h" |
| 12 #include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsContext3
D.h" | 12 #include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsContext3
D.h" |
| 13 #include "third_party/WebKit/Source/Platform/chromium/public/WebInputHandler.h" | 13 #include "third_party/WebKit/Source/Platform/chromium/public/WebInputHandler.h" |
| 14 #include "third_party/WebKit/Source/Platform/chromium/public/WebLayer.h" | 14 #include "third_party/WebKit/Source/Platform/chromium/public/WebLayer.h" |
| 15 #include "third_party/WebKit/Source/Platform/chromium/public/WebLayerTreeViewCli
ent.h" | 15 #include "third_party/WebKit/Source/Platform/chromium/public/WebLayerTreeViewCli
ent.h" |
| 16 #include "third_party/WebKit/Source/Platform/chromium/public/WebLayerTreeView.h" | 16 #include "third_party/WebKit/Source/Platform/chromium/public/WebLayerTreeView.h" |
| 17 #include "third_party/WebKit/Source/Platform/chromium/public/WebRenderingStats.h
" | 17 #include "third_party/WebKit/Source/Platform/chromium/public/WebRenderingStats.h
" |
| 18 #include "third_party/WebKit/Source/Platform/chromium/public/WebSize.h" | 18 #include "third_party/WebKit/Source/Platform/chromium/public/WebSize.h" |
| 19 #include "webcore_convert.h" | |
| 20 #include "web_layer_impl.h" | 19 #include "web_layer_impl.h" |
| 21 #include "web_to_ccinput_handler_adapter.h" | 20 #include "web_to_ccinput_handler_adapter.h" |
| 22 | 21 |
| 23 using namespace cc; | 22 using namespace cc; |
| 24 | 23 |
| 25 namespace WebKit { | 24 namespace WebKit { |
| 26 | 25 |
| 27 WebLayerTreeView* WebLayerTreeView::create(WebLayerTreeViewClient* client, const
WebLayer& root, const WebLayerTreeView::Settings& settings) | 26 WebLayerTreeView* WebLayerTreeView::create(WebLayerTreeViewClient* client, const
WebLayer& root, const WebLayerTreeView::Settings& settings) |
| 28 { | 27 { |
| 29 scoped_ptr<WebLayerTreeViewImpl> layerTreeViewImpl(new WebLayerTreeViewImpl(
client)); | 28 scoped_ptr<WebLayerTreeViewImpl> layerTreeViewImpl(new WebLayerTreeViewImpl(
client)); |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 } | 122 } |
| 124 | 123 |
| 125 void WebLayerTreeViewImpl::setPageScaleFactorAndLimits(float pageScaleFactor, fl
oat minimum, float maximum) | 124 void WebLayerTreeViewImpl::setPageScaleFactorAndLimits(float pageScaleFactor, fl
oat minimum, float maximum) |
| 126 { | 125 { |
| 127 m_layerTreeHost->setPageScaleFactorAndLimits(pageScaleFactor, minimum, maxim
um); | 126 m_layerTreeHost->setPageScaleFactorAndLimits(pageScaleFactor, minimum, maxim
um); |
| 128 } | 127 } |
| 129 | 128 |
| 130 void WebLayerTreeViewImpl::startPageScaleAnimation(const WebPoint& scroll, bool
useAnchor, float newPageScale, double durationSec) | 129 void WebLayerTreeViewImpl::startPageScaleAnimation(const WebPoint& scroll, bool
useAnchor, float newPageScale, double durationSec) |
| 131 { | 130 { |
| 132 base::TimeDelta duration = base::TimeDelta::FromMicroseconds(durationSec * b
ase::Time::kMicrosecondsPerSecond); | 131 base::TimeDelta duration = base::TimeDelta::FromMicroseconds(durationSec * b
ase::Time::kMicrosecondsPerSecond); |
| 133 m_layerTreeHost->startPageScaleAnimation(IntSize(scroll.x, scroll.y), useAnc
hor, newPageScale, duration); | 132 m_layerTreeHost->startPageScaleAnimation(gfx::Vector2d(scroll.x, scroll.y),
useAnchor, newPageScale, duration); |
| 134 } | 133 } |
| 135 | 134 |
| 136 void WebLayerTreeViewImpl::setNeedsAnimate() | 135 void WebLayerTreeViewImpl::setNeedsAnimate() |
| 137 { | 136 { |
| 138 m_layerTreeHost->setNeedsAnimate(); | 137 m_layerTreeHost->setNeedsAnimate(); |
| 139 } | 138 } |
| 140 | 139 |
| 141 void WebLayerTreeViewImpl::setNeedsRedraw() | 140 void WebLayerTreeViewImpl::setNeedsRedraw() |
| 142 { | 141 { |
| 143 m_layerTreeHost->setNeedsRedraw(); | 142 m_layerTreeHost->setNeedsRedraw(); |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 void WebLayerTreeViewImpl::animate(double monotonicFrameBeginTime) | 223 void WebLayerTreeViewImpl::animate(double monotonicFrameBeginTime) |
| 225 { | 224 { |
| 226 m_client->updateAnimations(monotonicFrameBeginTime); | 225 m_client->updateAnimations(monotonicFrameBeginTime); |
| 227 } | 226 } |
| 228 | 227 |
| 229 void WebLayerTreeViewImpl::layout() | 228 void WebLayerTreeViewImpl::layout() |
| 230 { | 229 { |
| 231 m_client->layout(); | 230 m_client->layout(); |
| 232 } | 231 } |
| 233 | 232 |
| 234 void WebLayerTreeViewImpl::applyScrollAndScale(const cc::IntSize& scrollDelta, f
loat pageScale) | 233 void WebLayerTreeViewImpl::applyScrollAndScale(gfx::Vector2d scrollDelta, float
pageScale) |
| 235 { | 234 { |
| 236 m_client->applyScrollAndScale(convert(scrollDelta), pageScale); | 235 m_client->applyScrollAndScale(scrollDelta, pageScale); |
| 237 } | 236 } |
| 238 | 237 |
| 239 scoped_ptr<WebCompositorOutputSurface> WebLayerTreeViewImpl::createOutputSurface
() | 238 scoped_ptr<WebCompositorOutputSurface> WebLayerTreeViewImpl::createOutputSurface
() |
| 240 { | 239 { |
| 241 return scoped_ptr<WebCompositorOutputSurface>(m_client->createOutputSurface(
)); | 240 return scoped_ptr<WebCompositorOutputSurface>(m_client->createOutputSurface(
)); |
| 242 } | 241 } |
| 243 | 242 |
| 244 void WebLayerTreeViewImpl::didRecreateOutputSurface(bool success) | 243 void WebLayerTreeViewImpl::didRecreateOutputSurface(bool success) |
| 245 { | 244 { |
| 246 m_client->didRecreateOutputSurface(success); | 245 m_client->didRecreateOutputSurface(success); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 274 { | 273 { |
| 275 m_client->didCompleteSwapBuffers(); | 274 m_client->didCompleteSwapBuffers(); |
| 276 } | 275 } |
| 277 | 276 |
| 278 void WebLayerTreeViewImpl::scheduleComposite() | 277 void WebLayerTreeViewImpl::scheduleComposite() |
| 279 { | 278 { |
| 280 m_client->scheduleComposite(); | 279 m_client->scheduleComposite(); |
| 281 } | 280 } |
| 282 | 281 |
| 283 } // namespace WebKit | 282 } // namespace WebKit |
| OLD | NEW |