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

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

Issue 2257693002: services/ui: Use a gpu::GpuChannelHost when creating ui::OutputSurface. (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 21 matching lines...) Expand all
32 routing_id_, render_thread->GetCompositorMainThreadTaskRunner(), 32 routing_id_, render_thread->GetCompositorMainThreadTaskRunner(),
33 render_thread->compositor_task_runner(), std::move(request), 33 render_thread->compositor_task_runner(), std::move(request),
34 render_thread->input_handler_manager()); 34 render_thread->input_handler_manager());
35 if (window_surface_binding_) { 35 if (window_surface_binding_) {
36 compositor_mus_connection_->AttachSurfaceOnMainThread( 36 compositor_mus_connection_->AttachSurfaceOnMainThread(
37 std::move(window_surface_binding_)); 37 std::move(window_surface_binding_));
38 } 38 }
39 } 39 }
40 40
41 std::unique_ptr<cc::OutputSurface> 41 std::unique_ptr<cc::OutputSurface>
42 RenderWidgetMusConnection::CreateOutputSurface(ui::GpuService* gpu_service) { 42 RenderWidgetMusConnection::CreateOutputSurface(
43 scoped_refptr<gpu::GpuChannelHost> gpu_channel_host) {
43 DCHECK(thread_checker_.CalledOnValidThread()); 44 DCHECK(thread_checker_.CalledOnValidThread());
44 DCHECK(!window_surface_binding_); 45 DCHECK(!window_surface_binding_);
45 46
46 std::unique_ptr<cc::OutputSurface> surface(new ui::OutputSurface( 47 std::unique_ptr<cc::OutputSurface> surface(new ui::OutputSurface(
47 gpu_service, ui::WindowSurface::Create(&window_surface_binding_))); 48 std::move(gpu_channel_host),
49 ui::WindowSurface::Create(&window_surface_binding_)));
48 if (compositor_mus_connection_) { 50 if (compositor_mus_connection_) {
49 compositor_mus_connection_->AttachSurfaceOnMainThread( 51 compositor_mus_connection_->AttachSurfaceOnMainThread(
50 std::move(window_surface_binding_)); 52 std::move(window_surface_binding_));
51 } 53 }
52 return surface; 54 return surface;
53 } 55 }
54 56
55 // static 57 // static
56 RenderWidgetMusConnection* RenderWidgetMusConnection::Get(int routing_id) { 58 RenderWidgetMusConnection* RenderWidgetMusConnection::Get(int routing_id) {
57 auto it = g_connections.Get().find(routing_id); 59 auto it = g_connections.Get().find(routing_id);
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 // previous event. 167 // previous event.
166 // DCHECK(pending_ack_.is_null()); 168 // DCHECK(pending_ack_.is_null());
167 pending_ack_ = ack; 169 pending_ack_ = ack;
168 // TODO(fsamuel, sadrul): Track real latency info. 170 // TODO(fsamuel, sadrul): Track real latency info.
169 ui::LatencyInfo latency_info; 171 ui::LatencyInfo latency_info;
170 input_handler_->HandleInputEvent(*input_event, latency_info, 172 input_handler_->HandleInputEvent(*input_event, latency_info,
171 DISPATCH_TYPE_BLOCKING); 173 DISPATCH_TYPE_BLOCKING);
172 } 174 }
173 175
174 } // namespace content 176 } // 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