| 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 <limits> | 7 #include <limits> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/string_number_conversions.h" | 12 #include "base/string_number_conversions.h" |
| 13 #include "base/synchronization/lock.h" | 13 #include "base/synchronization/lock.h" |
| 14 #include "base/time.h" | 14 #include "base/time.h" |
| 15 #include "cc/base/switches.h" | 15 #include "cc/base/switches.h" |
| 16 #include "cc/base/thread_impl.h" | 16 #include "cc/base/thread_impl.h" |
| 17 #include "cc/debug/layer_tree_debug_state.h" | 17 #include "cc/debug/layer_tree_debug_state.h" |
| 18 #include "cc/input/input_handler.h" |
| 18 #include "cc/layers/layer.h" | 19 #include "cc/layers/layer.h" |
| 19 #include "cc/trees/layer_tree_host.h" | 20 #include "cc/trees/layer_tree_host.h" |
| 20 #include "content/common/gpu/client/context_provider_command_buffer.h" | 21 #include "content/common/gpu/client/context_provider_command_buffer.h" |
| 21 #include "content/public/common/content_switches.h" | 22 #include "content/public/common/content_switches.h" |
| 22 #include "content/renderer/gpu/input_handler_manager.h" | 23 #include "content/renderer/gpu/input_handler_manager.h" |
| 23 #include "content/renderer/render_thread_impl.h" | 24 #include "content/renderer/render_thread_impl.h" |
| 24 #include "third_party/WebKit/Source/Platform/chromium/public/WebSize.h" | 25 #include "third_party/WebKit/Source/Platform/chromium/public/WebSize.h" |
| 25 #include "third_party/WebKit/Source/WebKit/chromium/public/WebWidget.h" | 26 #include "third_party/WebKit/Source/WebKit/chromium/public/WebWidget.h" |
| 26 #include "ui/gl/gl_switches.h" | 27 #include "ui/gl/gl_switches.h" |
| 27 #include "webkit/renderer/compositor_bindings/web_layer_impl.h" | 28 #include "webkit/renderer/compositor_bindings/web_layer_impl.h" |
| (...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 530 | 531 |
| 531 scoped_ptr<cc::OutputSurface> RenderWidgetCompositor::CreateOutputSurface() { | 532 scoped_ptr<cc::OutputSurface> RenderWidgetCompositor::CreateOutputSurface() { |
| 532 return widget_->CreateOutputSurface(); | 533 return widget_->CreateOutputSurface(); |
| 533 } | 534 } |
| 534 | 535 |
| 535 void RenderWidgetCompositor::DidInitializeOutputSurface(bool success) { | 536 void RenderWidgetCompositor::DidInitializeOutputSurface(bool success) { |
| 536 if (!success) | 537 if (!success) |
| 537 widget_->webwidget()->didExitCompositingMode(); | 538 widget_->webwidget()->didExitCompositingMode(); |
| 538 } | 539 } |
| 539 | 540 |
| 541 scoped_ptr<cc::InputHandlerClient> |
| 542 RenderWidgetCompositor::CreateInputHandlerClient() { |
| 543 return widget_->CreateInputHandlerClient(); |
| 544 } |
| 545 |
| 540 void RenderWidgetCompositor::WillCommit() { | 546 void RenderWidgetCompositor::WillCommit() { |
| 541 widget_->InstrumentWillComposite(); | 547 widget_->InstrumentWillComposite(); |
| 542 } | 548 } |
| 543 | 549 |
| 544 void RenderWidgetCompositor::DidCommit() { | 550 void RenderWidgetCompositor::DidCommit() { |
| 545 widget_->DidCommitCompositorFrame(); | 551 widget_->DidCommitCompositorFrame(); |
| 546 widget_->didBecomeReadyForAdditionalInput(); | 552 widget_->didBecomeReadyForAdditionalInput(); |
| 547 } | 553 } |
| 548 | 554 |
| 549 void RenderWidgetCompositor::DidCommitAndDrawFrame() { | 555 void RenderWidgetCompositor::DidCommitAndDrawFrame() { |
| (...skipping 14 matching lines...) Expand all Loading... |
| 564 return RenderThreadImpl::current()->OffscreenContextProviderForMainThread(); | 570 return RenderThreadImpl::current()->OffscreenContextProviderForMainThread(); |
| 565 } | 571 } |
| 566 | 572 |
| 567 scoped_refptr<cc::ContextProvider> | 573 scoped_refptr<cc::ContextProvider> |
| 568 RenderWidgetCompositor::OffscreenContextProviderForCompositorThread() { | 574 RenderWidgetCompositor::OffscreenContextProviderForCompositorThread() { |
| 569 return RenderThreadImpl::current()-> | 575 return RenderThreadImpl::current()-> |
| 570 OffscreenContextProviderForCompositorThread(); | 576 OffscreenContextProviderForCompositorThread(); |
| 571 } | 577 } |
| 572 | 578 |
| 573 } // namespace content | 579 } // namespace content |
| OLD | NEW |