Chromium Code Reviews| 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/thread.h" | 13 #include "cc/thread.h" |
| 14 #include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsContext3 D.h" | 14 #include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsContext3 D.h" |
| 15 #include "third_party/WebKit/Source/Platform/chromium/public/WebInputHandler.h" | 15 #include "third_party/WebKit/Source/Platform/chromium/public/WebInputHandler.h" |
| 16 #include "third_party/WebKit/Source/Platform/chromium/public/WebLayer.h" | 16 #include "third_party/WebKit/Source/Platform/chromium/public/WebLayer.h" |
| 17 #include "third_party/WebKit/Source/Platform/chromium/public/WebLayerTreeViewCli ent.h" | 17 #include "third_party/WebKit/Source/Platform/chromium/public/WebLayerTreeViewCli ent.h" |
| 18 #include "third_party/WebKit/Source/Platform/chromium/public/WebLayerTreeView.h" | 18 #include "third_party/WebKit/Source/Platform/chromium/public/WebLayerTreeView.h" |
| 19 #include "third_party/WebKit/Source/Platform/chromium/public/WebRenderingStats.h " | 19 #include "third_party/WebKit/Source/Platform/chromium/public/WebRenderingStats.h " |
| 20 #include "third_party/WebKit/Source/Platform/chromium/public/WebSharedGraphicsCo ntext3D.h" | |
| 20 #include "third_party/WebKit/Source/Platform/chromium/public/WebSize.h" | 21 #include "third_party/WebKit/Source/Platform/chromium/public/WebSize.h" |
| 21 #include "web_layer_impl.h" | 22 #include "web_layer_impl.h" |
| 22 #include "web_to_ccinput_handler_adapter.h" | 23 #include "web_to_ccinput_handler_adapter.h" |
| 23 #include "webkit/compositor_bindings/web_rendering_stats_impl.h" | 24 #include "webkit/compositor_bindings/web_rendering_stats_impl.h" |
| 24 | 25 |
| 25 using namespace cc; | 26 using namespace cc; |
| 26 | 27 |
| 27 namespace WebKit { | 28 namespace WebKit { |
| 28 | 29 |
| 29 WebLayerTreeViewImpl::WebLayerTreeViewImpl(WebLayerTreeViewClient* client) | 30 WebLayerTreeViewImpl::WebLayerTreeViewImpl(WebLayerTreeViewClient* client) |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 258 { | 259 { |
| 259 WebKit::WebCompositorOutputSurface* web = m_client->createOutputSurface(); | 260 WebKit::WebCompositorOutputSurface* web = m_client->createOutputSurface(); |
| 260 return make_scoped_ptr(static_cast<cc::OutputSurface*>(web)); | 261 return make_scoped_ptr(static_cast<cc::OutputSurface*>(web)); |
| 261 } | 262 } |
| 262 | 263 |
| 263 void WebLayerTreeViewImpl::didRecreateOutputSurface(bool success) | 264 void WebLayerTreeViewImpl::didRecreateOutputSurface(bool success) |
| 264 { | 265 { |
| 265 m_client->didRecreateOutputSurface(success); | 266 m_client->didRecreateOutputSurface(success); |
| 266 } | 267 } |
| 267 | 268 |
| 269 WebKit::WebGraphicsContext3D* WebLayerTreeViewImpl::OffscreenContext3dForMainThr ead() | |
| 270 { | |
| 271 return WebSharedGraphicsContext3D::mainThreadContext(); | |
|
danakj
2013/02/12 07:34:04
Should this be going right to the webkit/ version
| |
| 272 } | |
| 273 | |
| 274 WebKit::WebGraphicsContext3D* WebLayerTreeViewImpl::OffscreenContext3dForComposi torThread() | |
| 275 { | |
| 276 if (!WebSharedGraphicsContext3D::haveCompositorThreadContext() && !WebShared GraphicsContext3D::createCompositorThreadContext()) | |
| 277 return NULL; | |
| 278 return WebSharedGraphicsContext3D::compositorThreadContext(); | |
| 279 } | |
| 280 | |
| 268 scoped_ptr<InputHandler> WebLayerTreeViewImpl::createInputHandler() | 281 scoped_ptr<InputHandler> WebLayerTreeViewImpl::createInputHandler() |
| 269 { | 282 { |
| 270 scoped_ptr<InputHandler> ret; | 283 scoped_ptr<InputHandler> ret; |
| 271 scoped_ptr<WebInputHandler> handler(m_client->createInputHandler()); | 284 scoped_ptr<WebInputHandler> handler(m_client->createInputHandler()); |
| 272 if (handler) | 285 if (handler) |
| 273 ret = WebToCCInputHandlerAdapter::create(handler.Pass()); | 286 ret = WebToCCInputHandlerAdapter::create(handler.Pass()); |
| 274 return ret.Pass(); | 287 return ret.Pass(); |
| 275 } | 288 } |
| 276 | 289 |
| 277 void WebLayerTreeViewImpl::willCommit() | 290 void WebLayerTreeViewImpl::willCommit() |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 293 { | 306 { |
| 294 m_client->didCompleteSwapBuffers(); | 307 m_client->didCompleteSwapBuffers(); |
| 295 } | 308 } |
| 296 | 309 |
| 297 void WebLayerTreeViewImpl::scheduleComposite() | 310 void WebLayerTreeViewImpl::scheduleComposite() |
| 298 { | 311 { |
| 299 m_client->scheduleComposite(); | 312 m_client->scheduleComposite(); |
| 300 } | 313 } |
| 301 | 314 |
| 302 } // namespace WebKit | 315 } // namespace WebKit |
| OLD | NEW |