| 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 845 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 856 // render_thread may be NULL in tests. | 856 // render_thread may be NULL in tests. |
| 857 InputHandlerManager* input_handler_manager = | 857 InputHandlerManager* input_handler_manager = |
| 858 render_thread ? render_thread->input_handler_manager() : NULL; | 858 render_thread ? render_thread->input_handler_manager() : NULL; |
| 859 if (input_handler_manager) | 859 if (input_handler_manager) |
| 860 input_handler_manager->ProcessRafAlignedInputOnMainThread(routing_id_); | 860 input_handler_manager->ProcessRafAlignedInputOnMainThread(routing_id_); |
| 861 | 861 |
| 862 GetWebWidget()->beginFrame(frame_time_sec); | 862 GetWebWidget()->beginFrame(frame_time_sec); |
| 863 } | 863 } |
| 864 | 864 |
| 865 std::unique_ptr<cc::CompositorFrameSink> | 865 std::unique_ptr<cc::CompositorFrameSink> |
| 866 RenderWidget::CreateCompositorFrameSink(bool fallback) { | 866 RenderWidget::CreateCompositorFrameSink(const cc::FrameSinkId& frame_sink_id, |
| 867 bool fallback) { |
| 867 DCHECK(GetWebWidget()); | 868 DCHECK(GetWebWidget()); |
| 868 // For widgets that are never visible, we don't start the compositor, so we | 869 // For widgets that are never visible, we don't start the compositor, so we |
| 869 // never get a request for a cc::CompositorFrameSink. | 870 // never get a request for a cc::CompositorFrameSink. |
| 870 DCHECK(!compositor_never_visible_); | 871 DCHECK(!compositor_never_visible_); |
| 871 return RenderThreadImpl::current()->CreateCompositorFrameSink( | 872 return RenderThreadImpl::current()->CreateCompositorFrameSink( |
| 872 fallback, routing_id_, frame_swap_message_queue_, | 873 frame_sink_id, fallback, routing_id_, frame_swap_message_queue_, |
| 873 GetURLForGraphicsContext3D()); | 874 GetURLForGraphicsContext3D()); |
| 874 } | 875 } |
| 875 | 876 |
| 876 void RenderWidget::DidCommitAndDrawCompositorFrame() { | 877 void RenderWidget::DidCommitAndDrawCompositorFrame() { |
| 877 // NOTE: Tests may break if this event is renamed or moved. See | 878 // NOTE: Tests may break if this event is renamed or moved. See |
| 878 // tab_capture_performancetest.cc. | 879 // tab_capture_performancetest.cc. |
| 879 TRACE_EVENT0("gpu", "RenderWidget::DidCommitAndDrawCompositorFrame"); | 880 TRACE_EVENT0("gpu", "RenderWidget::DidCommitAndDrawCompositorFrame"); |
| 880 | 881 |
| 881 for (auto& observer : render_frames_) | 882 for (auto& observer : render_frames_) |
| 882 observer.DidCommitAndDrawCompositorFrame(); | 883 observer.DidCommitAndDrawCompositorFrame(); |
| (...skipping 1402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2285 // browser side (https://crbug.com/669219). | 2286 // browser side (https://crbug.com/669219). |
| 2286 // If there is no WebFrameWidget, then there will be no | 2287 // If there is no WebFrameWidget, then there will be no |
| 2287 // InputMethodControllers for a WebLocalFrame. | 2288 // InputMethodControllers for a WebLocalFrame. |
| 2288 return nullptr; | 2289 return nullptr; |
| 2289 } | 2290 } |
| 2290 return static_cast<blink::WebFrameWidget*>(GetWebWidget()) | 2291 return static_cast<blink::WebFrameWidget*>(GetWebWidget()) |
| 2291 ->getActiveWebInputMethodController(); | 2292 ->getActiveWebInputMethodController(); |
| 2292 } | 2293 } |
| 2293 | 2294 |
| 2294 } // namespace content | 2295 } // namespace content |
| OLD | NEW |