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

Side by Side Diff: ui/aura/mus/gpu_service.cc

Issue 2464123003: Enabling Aura-Mus clients to submit frames to Mus. (Closed)
Patch Set: Rebase, addressing feedback, removing some unneded imports/deps. Created 4 years, 1 month 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 | « ui/aura/mus/gpu_service.h ('k') | ui/aura/mus/mojo_gpu_memory_buffer.h » ('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 #include "services/ui/public/cpp/gpu_service.h" 5 #include "ui/aura/mus/gpu_service.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/memory/singleton.h" 8 #include "base/memory/singleton.h"
9 #include "base/threading/thread_task_runner_handle.h" 9 #include "base/threading/thread_task_runner_handle.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
11 #include "mojo/public/cpp/bindings/sync_call_restrictions.h" 11 #include "mojo/public/cpp/bindings/sync_call_restrictions.h"
12 #include "mojo/public/cpp/system/platform_handle.h" 12 #include "mojo/public/cpp/system/platform_handle.h"
13 #include "services/service_manager/public/cpp/connector.h" 13 #include "services/service_manager/public/cpp/connector.h"
14 #include "services/ui/common/switches.h"
15 #include "services/ui/public/cpp/mojo_gpu_memory_buffer_manager.h"
16 #include "services/ui/public/interfaces/gpu_service.mojom.h" 14 #include "services/ui/public/interfaces/gpu_service.mojom.h"
15 #include "ui/aura/mus/mojo_gpu_memory_buffer_manager.h"
17 16
18 namespace ui { 17 namespace aura {
19 18
20 GpuService::GpuService(service_manager::Connector* connector, 19 GpuService::GpuService(service_manager::Connector* connector,
21 scoped_refptr<base::SingleThreadTaskRunner> task_runner) 20 scoped_refptr<base::SingleThreadTaskRunner> task_runner)
22 : main_task_runner_(base::ThreadTaskRunnerHandle::Get()), 21 : main_task_runner_(base::ThreadTaskRunnerHandle::Get()),
23 io_task_runner_(std::move(task_runner)), 22 io_task_runner_(std::move(task_runner)),
24 connector_(connector), 23 connector_(connector),
25 shutdown_event_(base::WaitableEvent::ResetPolicy::AUTOMATIC, 24 shutdown_event_(base::WaitableEvent::ResetPolicy::AUTOMATIC,
26 base::WaitableEvent::InitialState::NOT_SIGNALED), 25 base::WaitableEvent::InitialState::NOT_SIGNALED),
27 gpu_memory_buffer_manager_(new MojoGpuMemoryBufferManager) { 26 gpu_memory_buffer_manager_(new MojoGpuMemoryBufferManager) {
28 DCHECK(main_task_runner_); 27 DCHECK(main_task_runner_);
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 bool readonly; 144 bool readonly;
146 MojoResult result = mojo::UnwrapSharedMemoryHandle( 145 MojoResult result = mojo::UnwrapSharedMemoryHandle(
147 std::move(handle), &platform_handle, &shared_memory_size, &readonly); 146 std::move(handle), &platform_handle, &shared_memory_size, &readonly);
148 if (result != MOJO_RESULT_OK) 147 if (result != MOJO_RESULT_OK)
149 return nullptr; 148 return nullptr;
150 DCHECK_EQ(shared_memory_size, size); 149 DCHECK_EQ(shared_memory_size, size);
151 150
152 return base::MakeUnique<base::SharedMemory>(platform_handle, readonly); 151 return base::MakeUnique<base::SharedMemory>(platform_handle, readonly);
153 } 152 }
154 153
155 } // namespace ui 154 } // namespace aura
OLDNEW
« no previous file with comments | « ui/aura/mus/gpu_service.h ('k') | ui/aura/mus/mojo_gpu_memory_buffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698