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

Side by Side Diff: services/ui/gpu/gpu_main.h

Issue 2778863002: Introduce DisplayProvider for DisplayCompositor. (Closed)
Patch Set: Delete extra task runner ref. Created 3 years, 8 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
« no previous file with comments | « no previous file | services/ui/gpu/gpu_main.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #ifndef SERVICES_UI_GPU_GPU_MAIN_H_ 5 #ifndef SERVICES_UI_GPU_GPU_MAIN_H_
6 #define SERVICES_UI_GPU_GPU_MAIN_H_ 6 #define SERVICES_UI_GPU_GPU_MAIN_H_
7 7
8 #include "base/power_monitor/power_monitor.h" 8 #include "base/power_monitor/power_monitor.h"
9 #include "base/threading/thread.h" 9 #include "base/threading/thread.h"
10 #include "gpu/ipc/in_process_command_buffer.h" 10 #include "gpu/ipc/in_process_command_buffer.h"
11 #include "gpu/ipc/service/gpu_init.h" 11 #include "gpu/ipc/service/gpu_init.h"
12 #include "services/ui/gpu/interfaces/gpu_main.mojom.h" 12 #include "services/ui/gpu/interfaces/gpu_main.mojom.h"
13 #include "services/ui/gpu/interfaces/gpu_service.mojom.h" 13 #include "services/ui/gpu/interfaces/gpu_service.mojom.h"
14 #include "services/ui/surfaces/display_compositor.h" 14 #include "services/ui/surfaces/display_compositor.h"
15 #include "services/ui/surfaces/display_provider.h"
15 16
16 namespace gpu { 17 namespace gpu {
17 class GpuMemoryBufferFactory; 18 class GpuMemoryBufferFactory;
18 class ImageFactory; 19 class ImageFactory;
19 } 20 }
20 21
21 namespace ui { 22 namespace ui {
22 23
23 class GpuService; 24 class GpuService;
24 25
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 // The InCommandCommandBuffer::Service used by the display compositor. 78 // The InCommandCommandBuffer::Service used by the display compositor.
78 scoped_refptr<gpu::InProcessCommandBuffer::Service> gpu_command_service_; 79 scoped_refptr<gpu::InProcessCommandBuffer::Service> gpu_command_service_;
79 80
80 // If the gpu service is not yet ready then we stash pending MessagePipes in 81 // If the gpu service is not yet ready then we stash pending MessagePipes in
81 // these member variables. 82 // these member variables.
82 cc::mojom::DisplayCompositorRequest pending_display_compositor_request_; 83 cc::mojom::DisplayCompositorRequest pending_display_compositor_request_;
83 cc::mojom::DisplayCompositorClientPtrInfo 84 cc::mojom::DisplayCompositorClientPtrInfo
84 pending_display_compositor_client_info_; 85 pending_display_compositor_client_info_;
85 86
86 std::unique_ptr<DisplayCompositor> display_compositor_; 87 std::unique_ptr<DisplayCompositor> display_compositor_;
88 std::unique_ptr<DisplayProvider> display_provider_;
87 89
88 std::unique_ptr<gpu::GpuMemoryBufferFactory> gpu_memory_buffer_factory_; 90 std::unique_ptr<gpu::GpuMemoryBufferFactory> gpu_memory_buffer_factory_;
89 91
90 // The main thread for Gpu. 92 // The main thread for Gpu.
91 base::Thread gpu_thread_; 93 base::Thread gpu_thread_;
92 scoped_refptr<base::SingleThreadTaskRunner> gpu_thread_task_runner_; 94 scoped_refptr<base::SingleThreadTaskRunner> gpu_thread_task_runner_;
93 95
94 // The thread that handles IO events for Gpu. 96 // The thread that handles IO events for Gpu.
95 base::Thread io_thread_; 97 base::Thread io_thread_;
96 98
97 // The display compositor gets its own thread in mus-gpu. The gpu service, 99 // The display compositor gets its own thread in mus-gpu. The gpu service,
98 // where GL commands are processed resides on its own thread. Various 100 // where GL commands are processed resides on its own thread. Various
99 // components of the display compositor such as Display, ResourceProvider, 101 // components of the display compositor such as Display, ResourceProvider,
100 // and GLRenderer block on sync tokens from other command buffers. Thus, 102 // and GLRenderer block on sync tokens from other command buffers. Thus,
101 // the gpu service must live on a separate thread. 103 // the gpu service must live on a separate thread.
102 base::Thread compositor_thread_; 104 base::Thread compositor_thread_;
103 scoped_refptr<base::SingleThreadTaskRunner> compositor_thread_task_runner_; 105 scoped_refptr<base::SingleThreadTaskRunner> compositor_thread_task_runner_;
104 106
105 base::PowerMonitor power_monitor_; 107 base::PowerMonitor power_monitor_;
106 mojo::Binding<mojom::GpuMain> binding_; 108 mojo::Binding<mojom::GpuMain> binding_;
107 109
108 DISALLOW_COPY_AND_ASSIGN(GpuMain); 110 DISALLOW_COPY_AND_ASSIGN(GpuMain);
109 }; 111 };
110 112
111 } // namespace ui 113 } // namespace ui
112 114
113 #endif // SERVICES_UI_GPU_GPU_MAIN_H_ 115 #endif // SERVICES_UI_GPU_GPU_MAIN_H_
OLDNEW
« no previous file with comments | « no previous file | services/ui/gpu/gpu_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698