| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/mus/render_widget_mus_connection.h" | 5 #include "content/renderer/mus/render_widget_mus_connection.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 | 8 |
| 9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 render_thread->compositor_task_runner(), std::move(request), | 32 render_thread->compositor_task_runner(), std::move(request), |
| 33 render_thread->input_handler_manager()); | 33 render_thread->input_handler_manager()); |
| 34 if (window_compositor_frame_sink_binding_) { | 34 if (window_compositor_frame_sink_binding_) { |
| 35 compositor_mus_connection_->AttachCompositorFrameSinkOnMainThread( | 35 compositor_mus_connection_->AttachCompositorFrameSinkOnMainThread( |
| 36 std::move(window_compositor_frame_sink_binding_)); | 36 std::move(window_compositor_frame_sink_binding_)); |
| 37 } | 37 } |
| 38 } | 38 } |
| 39 | 39 |
| 40 std::unique_ptr<cc::CompositorFrameSink> | 40 std::unique_ptr<cc::CompositorFrameSink> |
| 41 RenderWidgetMusConnection::CreateCompositorFrameSink( | 41 RenderWidgetMusConnection::CreateCompositorFrameSink( |
| 42 const cc::FrameSinkId& frame_sink_id, |
| 42 scoped_refptr<cc::ContextProvider> context_provider, | 43 scoped_refptr<cc::ContextProvider> context_provider, |
| 43 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager) { | 44 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager) { |
| 44 DCHECK(thread_checker_.CalledOnValidThread()); | 45 DCHECK(thread_checker_.CalledOnValidThread()); |
| 45 DCHECK(!window_compositor_frame_sink_binding_); | 46 DCHECK(!window_compositor_frame_sink_binding_); |
| 46 | 47 |
| 47 std::unique_ptr<cc::CompositorFrameSink> compositor_frame_sink( | 48 std::unique_ptr<cc::CompositorFrameSink> compositor_frame_sink( |
| 48 ui::WindowCompositorFrameSink::Create( | 49 ui::WindowCompositorFrameSink::Create( |
| 49 std::move(context_provider), gpu_memory_buffer_manager, | 50 frame_sink_id, std::move(context_provider), gpu_memory_buffer_manager, |
| 50 &window_compositor_frame_sink_binding_)); | 51 &window_compositor_frame_sink_binding_)); |
| 51 if (compositor_mus_connection_) { | 52 if (compositor_mus_connection_) { |
| 52 compositor_mus_connection_->AttachCompositorFrameSinkOnMainThread( | 53 compositor_mus_connection_->AttachCompositorFrameSinkOnMainThread( |
| 53 std::move(window_compositor_frame_sink_binding_)); | 54 std::move(window_compositor_frame_sink_binding_)); |
| 54 } | 55 } |
| 55 return compositor_frame_sink; | 56 return compositor_frame_sink; |
| 56 } | 57 } |
| 57 | 58 |
| 58 // static | 59 // static |
| 59 RenderWidgetMusConnection* RenderWidgetMusConnection::Get(int routing_id) { | 60 RenderWidgetMusConnection* RenderWidgetMusConnection::Get(int routing_id) { |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 // previous event. | 169 // previous event. |
| 169 // DCHECK(pending_ack_.is_null()); | 170 // DCHECK(pending_ack_.is_null()); |
| 170 pending_ack_ = ack; | 171 pending_ack_ = ack; |
| 171 // TODO(fsamuel, sadrul): Track real latency info. | 172 // TODO(fsamuel, sadrul): Track real latency info. |
| 172 ui::LatencyInfo latency_info; | 173 ui::LatencyInfo latency_info; |
| 173 input_handler_->HandleInputEvent(*input_event, latency_info, | 174 input_handler_->HandleInputEvent(*input_event, latency_info, |
| 174 DISPATCH_TYPE_BLOCKING); | 175 DISPATCH_TYPE_BLOCKING); |
| 175 } | 176 } |
| 176 | 177 |
| 177 } // namespace content | 178 } // namespace content |
| OLD | NEW |