Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "content/renderer/gpu/render_widget_compositor.h" | 5 #include "content/renderer/gpu/render_widget_compositor.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/string_number_conversions.h" | 9 #include "base/string_number_conversions.h" |
| 10 #include "base/time.h" | 10 #include "base/time.h" |
| 11 #include "cc/font_atlas.h" | 11 #include "cc/font_atlas.h" |
| 12 #include "cc/layer.h" | 12 #include "cc/layer.h" |
| 13 #include "cc/layer_tree_debug_state.h" | 13 #include "cc/layer_tree_debug_state.h" |
| 14 #include "cc/layer_tree_host.h" | 14 #include "cc/layer_tree_host.h" |
| 15 #include "cc/switches.h" | 15 #include "cc/switches.h" |
| 16 #include "cc/thread_impl.h" | 16 #include "cc/thread_impl.h" |
| 17 #include "content/renderer/gpu/compositor_thread.h" | 17 #include "content/renderer/gpu/compositor_thread.h" |
| 18 #include "content/renderer/render_thread_impl.h" | 18 #include "content/renderer/render_thread_impl.h" |
| 19 #include "third_party/WebKit/Source/Platform/chromium/public/WebLayerTreeViewCli ent.h" | 19 #include "third_party/WebKit/Source/Platform/chromium/public/WebLayerTreeViewCli ent.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 "webkit/compositor_bindings/web_layer_impl.h" | 22 #include "webkit/compositor_bindings/web_layer_impl.h" |
| 22 #include "webkit/compositor_bindings/web_to_ccinput_handler_adapter.h" | 23 #include "webkit/compositor_bindings/web_to_ccinput_handler_adapter.h" |
| 23 | 24 |
| 24 namespace cc { | 25 namespace cc { |
| 25 class Layer; | 26 class Layer; |
| 26 } | 27 } |
| 27 | 28 |
| 28 using WebKit::WebFloatPoint; | 29 using WebKit::WebFloatPoint; |
| 29 using WebKit::WebSize; | 30 using WebKit::WebSize; |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 280 | 281 |
| 281 scoped_ptr<cc::OutputSurface> RenderWidgetCompositor::createOutputSurface() { | 282 scoped_ptr<cc::OutputSurface> RenderWidgetCompositor::createOutputSurface() { |
| 282 return widget_->CreateOutputSurface(); | 283 return widget_->CreateOutputSurface(); |
| 283 } | 284 } |
| 284 | 285 |
| 285 // TODO(jamesr): This should go through WebWidget | 286 // TODO(jamesr): This should go through WebWidget |
| 286 void RenderWidgetCompositor::didRecreateOutputSurface(bool success) { | 287 void RenderWidgetCompositor::didRecreateOutputSurface(bool success) { |
| 287 client_->didRecreateOutputSurface(success); | 288 client_->didRecreateOutputSurface(success); |
| 288 } | 289 } |
| 289 | 290 |
| 291 // TODO(danakj): This should go through WebWidget | |
|
jamesr
2013/02/09 02:48:11
what would this have to do with WebWidget?
danakj
2013/02/09 02:50:51
I copied this from the other methods, I assumed yo
| |
| 292 WebKit::WebGraphicsContext3D* RenderWidgetCompositor:: | |
| 293 offscreenContext3dForMainThread() { | |
| 294 return WebKit::WebSharedGraphicsContext3D::mainThreadContext(); | |
| 295 } | |
| 296 | |
| 297 // TODO(danakj): This should go through WebWidget | |
| 298 WebKit::WebGraphicsContext3D* RenderWidgetCompositor:: | |
| 299 offscreenContext3dForCompositorThread() { | |
| 300 if (!WebKit::WebSharedGraphicsContext3D::haveCompositorThreadContext() && | |
| 301 !WebKit::WebSharedGraphicsContext3D::createCompositorThreadContext()) | |
| 302 return NULL; | |
| 303 return WebKit::WebSharedGraphicsContext3D::compositorThreadContext(); | |
| 304 } | |
| 305 | |
| 306 // TODO(danakj): This should go through WebWidget | |
| 307 GrContext* RenderWidgetCompositor::offscreenGrContextForMainThread() { | |
| 308 return WebKit::WebSharedGraphicsContext3D::mainThreadGrContext(); | |
| 309 } | |
| 310 | |
| 311 // TODO(danakj): This should go through WebWidget | |
| 312 GrContext* RenderWidgetCompositor::offscreenGrContextForCompositorThread() { | |
| 313 return WebKit::WebSharedGraphicsContext3D::compositorThreadGrContext(); | |
| 314 } | |
| 315 | |
| 290 // TODO(jamesr): This should go through WebWidget | 316 // TODO(jamesr): This should go through WebWidget |
| 291 scoped_ptr<cc::InputHandler> RenderWidgetCompositor::createInputHandler() { | 317 scoped_ptr<cc::InputHandler> RenderWidgetCompositor::createInputHandler() { |
| 292 scoped_ptr<cc::InputHandler> ret; | 318 scoped_ptr<cc::InputHandler> ret; |
| 293 scoped_ptr<WebKit::WebInputHandler> web_handler( | 319 scoped_ptr<WebKit::WebInputHandler> web_handler( |
| 294 client_->createInputHandler()); | 320 client_->createInputHandler()); |
| 295 if (web_handler) | 321 if (web_handler) |
| 296 ret = WebKit::WebToCCInputHandlerAdapter::create(web_handler.Pass()); | 322 ret = WebKit::WebToCCInputHandlerAdapter::create(web_handler.Pass()); |
| 297 return ret.Pass(); | 323 return ret.Pass(); |
| 298 } | 324 } |
| 299 | 325 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 331 | 357 |
| 332 client_->createFontAtlas(bitmap, ascii_to_web_rect_table, font_height); | 358 client_->createFontAtlas(bitmap, ascii_to_web_rect_table, font_height); |
| 333 | 359 |
| 334 for (int i = 0; i < 128; ++i) | 360 for (int i = 0; i < 128; ++i) |
| 335 ascii_to_rect_table[i] = ascii_to_web_rect_table[i]; | 361 ascii_to_rect_table[i] = ascii_to_web_rect_table[i]; |
| 336 | 362 |
| 337 return cc::FontAtlas::create(bitmap, ascii_to_rect_table, font_height).Pass(); | 363 return cc::FontAtlas::create(bitmap, ascii_to_rect_table, font_height).Pass(); |
| 338 } | 364 } |
| 339 | 365 |
| 340 } // namespace content | 366 } // namespace content |
| OLD | NEW |