| 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 "web_layer_tree_view_impl.h" | 5 #include "web_layer_tree_view_impl.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/string_number_conversions.h" | 8 #include "base/string_number_conversions.h" |
| 9 #include "cc/font_atlas.h" | 9 #include "cc/font_atlas.h" |
| 10 #include "cc/input_handler.h" | 10 #include "cc/input_handler.h" |
| 11 #include "cc/layer.h" | 11 #include "cc/layer.h" |
| 12 #include "cc/layer_tree_host.h" | 12 #include "cc/layer_tree_host.h" |
| 13 #include "cc/switches.h" | 13 #include "cc/switches.h" |
| 14 #include "cc/thread.h" | 14 #include "cc/thread.h" |
| 15 #include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsContext3
D.h" | 15 #include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsContext3
D.h" |
| 16 #include "third_party/WebKit/Source/Platform/chromium/public/WebInputHandler.h" | 16 #include "third_party/WebKit/Source/Platform/chromium/public/WebInputHandler.h" |
| 17 #include "third_party/WebKit/Source/Platform/chromium/public/WebLayer.h" | 17 #include "third_party/WebKit/Source/Platform/chromium/public/WebLayer.h" |
| 18 #include "third_party/WebKit/Source/Platform/chromium/public/WebLayerTreeViewCli
ent.h" | 18 #include "third_party/WebKit/Source/Platform/chromium/public/WebLayerTreeViewCli
ent.h" |
| 19 #include "third_party/WebKit/Source/Platform/chromium/public/WebLayerTreeView.h" | 19 #include "third_party/WebKit/Source/Platform/chromium/public/WebLayerTreeView.h" |
| 20 #include "third_party/WebKit/Source/Platform/chromium/public/WebRenderingStats.h
" | 20 #include "third_party/WebKit/Source/Platform/chromium/public/WebRenderingStats.h
" |
| 21 #include "third_party/WebKit/Source/Platform/chromium/public/WebSharedGraphicsCo
ntext3D.h" |
| 21 #include "third_party/WebKit/Source/Platform/chromium/public/WebSize.h" | 22 #include "third_party/WebKit/Source/Platform/chromium/public/WebSize.h" |
| 22 #include "web_layer_impl.h" | 23 #include "web_layer_impl.h" |
| 23 #include "web_to_ccinput_handler_adapter.h" | 24 #include "web_to_ccinput_handler_adapter.h" |
| 24 #include "webkit/compositor_bindings/web_rendering_stats_impl.h" | 25 #include "webkit/compositor_bindings/web_rendering_stats_impl.h" |
| 25 | 26 |
| 26 using namespace cc; | 27 using namespace cc; |
| 27 | 28 |
| 28 namespace WebKit { | 29 namespace WebKit { |
| 29 | 30 |
| 30 WebLayerTreeViewImpl::WebLayerTreeViewImpl(WebLayerTreeViewClient* client) | 31 WebLayerTreeViewImpl::WebLayerTreeViewImpl(WebLayerTreeViewClient* client) |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 { | 269 { |
| 269 WebKit::WebCompositorOutputSurface* web = m_client->createOutputSurface(); | 270 WebKit::WebCompositorOutputSurface* web = m_client->createOutputSurface(); |
| 270 return make_scoped_ptr(static_cast<cc::OutputSurface*>(web)); | 271 return make_scoped_ptr(static_cast<cc::OutputSurface*>(web)); |
| 271 } | 272 } |
| 272 | 273 |
| 273 void WebLayerTreeViewImpl::didRecreateOutputSurface(bool success) | 274 void WebLayerTreeViewImpl::didRecreateOutputSurface(bool success) |
| 274 { | 275 { |
| 275 m_client->didRecreateOutputSurface(success); | 276 m_client->didRecreateOutputSurface(success); |
| 276 } | 277 } |
| 277 | 278 |
| 279 WebKit::WebGraphicsContext3D* WebLayerTreeViewImpl::offscreenContext3dForMainThr
ead() |
| 280 { |
| 281 return WebSharedGraphicsContext3D::mainThreadContext(); |
| 282 } |
| 283 |
| 284 WebKit::WebGraphicsContext3D* WebLayerTreeViewImpl::offscreenContext3dForComposi
torThread() |
| 285 { |
| 286 if (!WebSharedGraphicsContext3D::haveCompositorThreadContext() && !WebShared
GraphicsContext3D::createCompositorThreadContext()) |
| 287 return NULL; |
| 288 return WebSharedGraphicsContext3D::compositorThreadContext(); |
| 289 } |
| 290 |
| 291 GrContext* WebLayerTreeViewImpl::offscreenGrContextForMainThread() |
| 292 { |
| 293 return WebSharedGraphicsContext3D::mainThreadGrContext(); |
| 294 } |
| 295 |
| 296 GrContext* WebLayerTreeViewImpl::offscreenGrContextForCompositorThread() |
| 297 { |
| 298 return WebSharedGraphicsContext3D::compositorThreadGrContext(); |
| 299 } |
| 300 |
| 278 scoped_ptr<InputHandler> WebLayerTreeViewImpl::createInputHandler() | 301 scoped_ptr<InputHandler> WebLayerTreeViewImpl::createInputHandler() |
| 279 { | 302 { |
| 280 scoped_ptr<InputHandler> ret; | 303 scoped_ptr<InputHandler> ret; |
| 281 scoped_ptr<WebInputHandler> handler(m_client->createInputHandler()); | 304 scoped_ptr<WebInputHandler> handler(m_client->createInputHandler()); |
| 282 if (handler) | 305 if (handler) |
| 283 ret = WebToCCInputHandlerAdapter::create(handler.Pass()); | 306 ret = WebToCCInputHandlerAdapter::create(handler.Pass()); |
| 284 return ret.Pass(); | 307 return ret.Pass(); |
| 285 } | 308 } |
| 286 | 309 |
| 287 void WebLayerTreeViewImpl::willCommit() | 310 void WebLayerTreeViewImpl::willCommit() |
| (...skipping 15 matching lines...) Expand all Loading... |
| 303 { | 326 { |
| 304 m_client->didCompleteSwapBuffers(); | 327 m_client->didCompleteSwapBuffers(); |
| 305 } | 328 } |
| 306 | 329 |
| 307 void WebLayerTreeViewImpl::scheduleComposite() | 330 void WebLayerTreeViewImpl::scheduleComposite() |
| 308 { | 331 { |
| 309 m_client->scheduleComposite(); | 332 m_client->scheduleComposite(); |
| 310 } | 333 } |
| 311 | 334 |
| 312 } // namespace WebKit | 335 } // namespace WebKit |
| OLD | NEW |