| 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" |
| 11 #include "content/public/common/mojo_shell_connection.h" |
| 11 #include "content/renderer/mus/compositor_mus_connection.h" | 12 #include "content/renderer/mus/compositor_mus_connection.h" |
| 12 #include "content/renderer/render_thread_impl.h" | 13 #include "content/renderer/render_thread_impl.h" |
| 13 #include "content/renderer/render_view_impl.h" | 14 #include "content/renderer/render_view_impl.h" |
| 15 #include "services/shell/public/cpp/connector.h" |
| 14 #include "services/ui/public/cpp/context_provider.h" | 16 #include "services/ui/public/cpp/context_provider.h" |
| 15 #include "services/ui/public/cpp/output_surface.h" | 17 #include "services/ui/public/cpp/output_surface.h" |
| 16 #include "services/ui/public/interfaces/command_buffer.mojom.h" | 18 #include "services/ui/public/interfaces/command_buffer.mojom.h" |
| 17 #include "services/ui/public/interfaces/surface.mojom.h" | 19 #include "services/ui/public/interfaces/surface.mojom.h" |
| 18 #include "services/ui/public/interfaces/window_tree.mojom.h" | 20 #include "services/ui/public/interfaces/window_tree.mojom.h" |
| 19 | 21 |
| 20 namespace content { | 22 namespace content { |
| 21 | 23 |
| 22 namespace { | 24 namespace { |
| 23 | 25 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 37 if (window_surface_binding_) { | 39 if (window_surface_binding_) { |
| 38 compositor_mus_connection_->AttachSurfaceOnMainThread( | 40 compositor_mus_connection_->AttachSurfaceOnMainThread( |
| 39 std::move(window_surface_binding_)); | 41 std::move(window_surface_binding_)); |
| 40 } | 42 } |
| 41 } | 43 } |
| 42 | 44 |
| 43 std::unique_ptr<cc::OutputSurface> | 45 std::unique_ptr<cc::OutputSurface> |
| 44 RenderWidgetMusConnection::CreateOutputSurface() { | 46 RenderWidgetMusConnection::CreateOutputSurface() { |
| 45 DCHECK(thread_checker_.CalledOnValidThread()); | 47 DCHECK(thread_checker_.CalledOnValidThread()); |
| 46 DCHECK(!window_surface_binding_); | 48 DCHECK(!window_surface_binding_); |
| 47 scoped_refptr<cc::ContextProvider> context_provider(new ui::ContextProvider); | 49 scoped_refptr<cc::ContextProvider> context_provider(new ui::ContextProvider( |
| 50 ChildThread::Get()->GetMojoShellConnection()->GetConnector())); |
| 48 | 51 |
| 49 std::unique_ptr<cc::OutputSurface> surface(new ui::OutputSurface( | 52 std::unique_ptr<cc::OutputSurface> surface(new ui::OutputSurface( |
| 50 context_provider, ui::WindowSurface::Create(&window_surface_binding_))); | 53 context_provider, ui::WindowSurface::Create(&window_surface_binding_))); |
| 51 if (compositor_mus_connection_) { | 54 if (compositor_mus_connection_) { |
| 52 compositor_mus_connection_->AttachSurfaceOnMainThread( | 55 compositor_mus_connection_->AttachSurfaceOnMainThread( |
| 53 std::move(window_surface_binding_)); | 56 std::move(window_surface_binding_)); |
| 54 } | 57 } |
| 55 return surface; | 58 return surface; |
| 56 } | 59 } |
| 57 | 60 |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 // previous event. | 171 // previous event. |
| 169 // DCHECK(pending_ack_.is_null()); | 172 // DCHECK(pending_ack_.is_null()); |
| 170 pending_ack_ = ack; | 173 pending_ack_ = ack; |
| 171 // TODO(fsamuel, sadrul): Track real latency info. | 174 // TODO(fsamuel, sadrul): Track real latency info. |
| 172 ui::LatencyInfo latency_info; | 175 ui::LatencyInfo latency_info; |
| 173 input_handler_->HandleInputEvent(*input_event, latency_info, | 176 input_handler_->HandleInputEvent(*input_event, latency_info, |
| 174 DISPATCH_TYPE_BLOCKING); | 177 DISPATCH_TYPE_BLOCKING); |
| 175 } | 178 } |
| 176 | 179 |
| 177 } // namespace content | 180 } // namespace content |
| OLD | NEW |