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

Side by Side Diff: services/ui/public/cpp/gpu/gpu.h

Issue 2965103002: gpu: Make the mus-gpu client-lib test-friendly. (Closed)
Patch Set: Created 3 years, 5 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/public/cpp/gpu/gpu.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_PUBLIC_CPP_GPU_GPU_H_ 5 #ifndef SERVICES_UI_PUBLIC_CPP_GPU_GPU_H_
6 #define SERVICES_UI_PUBLIC_CPP_GPU_GPU_H_ 6 #define SERVICES_UI_PUBLIC_CPP_GPU_GPU_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 scoped_refptr<cc::ContextProvider> CreateContextProvider( 44 scoped_refptr<cc::ContextProvider> CreateContextProvider(
45 scoped_refptr<gpu::GpuChannelHost> gpu_channel); 45 scoped_refptr<gpu::GpuChannelHost> gpu_channel);
46 46
47 // gpu::GpuChannelEstablishFactory: 47 // gpu::GpuChannelEstablishFactory:
48 void EstablishGpuChannel( 48 void EstablishGpuChannel(
49 const gpu::GpuChannelEstablishedCallback& callback) override; 49 const gpu::GpuChannelEstablishedCallback& callback) override;
50 scoped_refptr<gpu::GpuChannelHost> EstablishGpuChannelSync() override; 50 scoped_refptr<gpu::GpuChannelHost> EstablishGpuChannelSync() override;
51 gpu::GpuMemoryBufferManager* GetGpuMemoryBufferManager() override; 51 gpu::GpuMemoryBufferManager* GetGpuMemoryBufferManager() override;
52 52
53 private: 53 private:
54 friend struct base::DefaultSingletonTraits<Gpu>; 54 friend class GpuTest;
55 55
56 Gpu(service_manager::Connector* connector, 56 using GpuPtrFactory = base::RepeatingCallback<mojom::GpuPtr(void)>;
57 const std::string& service_name, 57 Gpu(GpuPtrFactory factory,
58 scoped_refptr<base::SingleThreadTaskRunner> task_runner); 58 scoped_refptr<base::SingleThreadTaskRunner> task_runner);
59 59
60 scoped_refptr<gpu::GpuChannelHost> GetGpuChannel(); 60 scoped_refptr<gpu::GpuChannelHost> GetGpuChannel();
61 void OnEstablishedGpuChannel(int client_id, 61 void OnEstablishedGpuChannel(int client_id,
62 mojo::ScopedMessagePipeHandle channel_handle, 62 mojo::ScopedMessagePipeHandle channel_handle,
63 const gpu::GPUInfo& gpu_info); 63 const gpu::GPUInfo& gpu_info);
64 64
65 // gpu::GpuChannelHostFactory overrides: 65 // gpu::GpuChannelHostFactory overrides:
66 bool IsMainThread() override; 66 bool IsMainThread() override;
67 scoped_refptr<base::SingleThreadTaskRunner> GetIOThreadTaskRunner() override; 67 scoped_refptr<base::SingleThreadTaskRunner> GetIOThreadTaskRunner() override;
68 std::unique_ptr<base::SharedMemory> AllocateSharedMemory( 68 std::unique_ptr<base::SharedMemory> AllocateSharedMemory(
69 size_t size) override; 69 size_t size) override;
70 70
71 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; 71 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_;
72 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; 72 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_;
73 service_manager::Connector* connector_; 73 GpuPtrFactory factory_;
74 const std::string service_name_;
75 base::WaitableEvent shutdown_event_; 74 base::WaitableEvent shutdown_event_;
76 std::unique_ptr<base::Thread> io_thread_; 75 std::unique_ptr<base::Thread> io_thread_;
77 std::unique_ptr<ClientGpuMemoryBufferManager> gpu_memory_buffer_manager_; 76 std::unique_ptr<ClientGpuMemoryBufferManager> gpu_memory_buffer_manager_;
78 77
79 ui::mojom::GpuPtr gpu_; 78 ui::mojom::GpuPtr gpu_;
80 scoped_refptr<gpu::GpuChannelHost> gpu_channel_; 79 scoped_refptr<gpu::GpuChannelHost> gpu_channel_;
81 std::vector<gpu::GpuChannelEstablishedCallback> establish_callbacks_; 80 std::vector<gpu::GpuChannelEstablishedCallback> establish_callbacks_;
82 81
83 DISALLOW_COPY_AND_ASSIGN(Gpu); 82 DISALLOW_COPY_AND_ASSIGN(Gpu);
84 }; 83 };
85 84
86 } // namespace ui 85 } // namespace ui
87 86
88 #endif // SERVICES_UI_PUBLIC_CPP_GPU_GPU_H_ 87 #endif // SERVICES_UI_PUBLIC_CPP_GPU_GPU_H_
OLDNEW
« no previous file with comments | « no previous file | services/ui/public/cpp/gpu/gpu.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698