| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/render_widget.h" | 5 #include "content/renderer/render_widget.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
| (...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 741 bool fallback) { | 741 bool fallback) { |
| 742 DCHECK(webwidget_); | 742 DCHECK(webwidget_); |
| 743 // For widgets that are never visible, we don't start the compositor, so we | 743 // For widgets that are never visible, we don't start the compositor, so we |
| 744 // never get a request for a cc::OutputSurface. | 744 // never get a request for a cc::OutputSurface. |
| 745 DCHECK(!compositor_never_visible_); | 745 DCHECK(!compositor_never_visible_); |
| 746 return RenderThreadImpl::current()->CreateCompositorOutputSurface( | 746 return RenderThreadImpl::current()->CreateCompositorOutputSurface( |
| 747 fallback, routing_id_, frame_swap_message_queue_, | 747 fallback, routing_id_, frame_swap_message_queue_, |
| 748 GetURLForGraphicsContext3D()); | 748 GetURLForGraphicsContext3D()); |
| 749 } | 749 } |
| 750 | 750 |
| 751 std::unique_ptr<cc::BeginFrameSource> | |
| 752 RenderWidget::CreateExternalBeginFrameSource() { | |
| 753 return compositor_deps_->CreateExternalBeginFrameSource(routing_id_); | |
| 754 } | |
| 755 | |
| 756 void RenderWidget::DidCommitAndDrawCompositorFrame() { | 751 void RenderWidget::DidCommitAndDrawCompositorFrame() { |
| 757 // NOTE: Tests may break if this event is renamed or moved. See | 752 // NOTE: Tests may break if this event is renamed or moved. See |
| 758 // tab_capture_performancetest.cc. | 753 // tab_capture_performancetest.cc. |
| 759 TRACE_EVENT0("gpu", "RenderWidget::DidCommitAndDrawCompositorFrame"); | 754 TRACE_EVENT0("gpu", "RenderWidget::DidCommitAndDrawCompositorFrame"); |
| 760 | 755 |
| 761 FOR_EACH_OBSERVER(RenderFrameImpl, render_frames_, | 756 FOR_EACH_OBSERVER(RenderFrameImpl, render_frames_, |
| 762 DidCommitAndDrawCompositorFrame()); | 757 DidCommitAndDrawCompositorFrame()); |
| 763 | 758 |
| 764 // Notify subclasses that we initiated the paint operation. | 759 // Notify subclasses that we initiated the paint operation. |
| 765 DidInitiatePaint(); | 760 DidInitiatePaint(); |
| (...skipping 1349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2115 void RenderWidget::requestPointerUnlock() { | 2110 void RenderWidget::requestPointerUnlock() { |
| 2116 mouse_lock_dispatcher_->UnlockMouse(webwidget_mouse_lock_target_.get()); | 2111 mouse_lock_dispatcher_->UnlockMouse(webwidget_mouse_lock_target_.get()); |
| 2117 } | 2112 } |
| 2118 | 2113 |
| 2119 bool RenderWidget::isPointerLocked() { | 2114 bool RenderWidget::isPointerLocked() { |
| 2120 return mouse_lock_dispatcher_->IsMouseLockedTo( | 2115 return mouse_lock_dispatcher_->IsMouseLockedTo( |
| 2121 webwidget_mouse_lock_target_.get()); | 2116 webwidget_mouse_lock_target_.get()); |
| 2122 } | 2117 } |
| 2123 | 2118 |
| 2124 } // namespace content | 2119 } // namespace content |
| OLD | NEW |