Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(121)

Side by Side Diff: content/renderer/mus/render_widget_mus_connection.cc

Issue 2233003003: services/ui: Inject GpuService instance where needed, instead of singleton. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 22 matching lines...) Expand all
33 routing_id_, render_thread->GetCompositorMainThreadTaskRunner(), 33 routing_id_, render_thread->GetCompositorMainThreadTaskRunner(),
34 render_thread->compositor_task_runner(), std::move(request), 34 render_thread->compositor_task_runner(), std::move(request),
35 render_thread->input_handler_manager()); 35 render_thread->input_handler_manager());
36 if (window_surface_binding_) { 36 if (window_surface_binding_) {
37 compositor_mus_connection_->AttachSurfaceOnMainThread( 37 compositor_mus_connection_->AttachSurfaceOnMainThread(
38 std::move(window_surface_binding_)); 38 std::move(window_surface_binding_));
39 } 39 }
40 } 40 }
41 41
42 std::unique_ptr<cc::OutputSurface> 42 std::unique_ptr<cc::OutputSurface>
43 RenderWidgetMusConnection::CreateOutputSurface() { 43 RenderWidgetMusConnection::CreateOutputSurface(ui::GpuService* gpu_service) {
44 DCHECK(thread_checker_.CalledOnValidThread()); 44 DCHECK(thread_checker_.CalledOnValidThread());
45 DCHECK(!window_surface_binding_); 45 DCHECK(!window_surface_binding_);
46 46
47 std::unique_ptr<cc::OutputSurface> surface(new ui::OutputSurface( 47 std::unique_ptr<cc::OutputSurface> surface(new ui::OutputSurface(
48 ui::WindowSurface::Create(&window_surface_binding_))); 48 gpu_service, ui::WindowSurface::Create(&window_surface_binding_)));
49 if (compositor_mus_connection_) { 49 if (compositor_mus_connection_) {
50 compositor_mus_connection_->AttachSurfaceOnMainThread( 50 compositor_mus_connection_->AttachSurfaceOnMainThread(
51 std::move(window_surface_binding_)); 51 std::move(window_surface_binding_));
52 } 52 }
53 return surface; 53 return surface;
54 } 54 }
55 55
56 // static 56 // static
57 RenderWidgetMusConnection* RenderWidgetMusConnection::Get(int routing_id) { 57 RenderWidgetMusConnection* RenderWidgetMusConnection::Get(int routing_id) {
58 auto it = g_connections.Get().find(routing_id); 58 auto it = g_connections.Get().find(routing_id);
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 // previous event. 166 // previous event.
167 // DCHECK(pending_ack_.is_null()); 167 // DCHECK(pending_ack_.is_null());
168 pending_ack_ = ack; 168 pending_ack_ = ack;
169 // TODO(fsamuel, sadrul): Track real latency info. 169 // TODO(fsamuel, sadrul): Track real latency info.
170 ui::LatencyInfo latency_info; 170 ui::LatencyInfo latency_info;
171 input_handler_->HandleInputEvent(*input_event, latency_info, 171 input_handler_->HandleInputEvent(*input_event, latency_info,
172 DISPATCH_TYPE_BLOCKING); 172 DISPATCH_TYPE_BLOCKING);
173 } 173 }
174 174
175 } // namespace content 175 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/mus/render_widget_mus_connection.h ('k') | content/renderer/render_thread_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698