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

Side by Side Diff: services/ui/ws/gpu_host.cc

Issue 2939953004: viz: Move some code into //components/viz/common. (Closed)
Patch Set: . Created 3 years, 6 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 | « services/ui/ws/gpu_host.h ('k') | no next file » | 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/ws/gpu_host.h" 5 #include "services/ui/ws/gpu_host.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "base/memory/shared_memory.h" 8 #include "base/memory/shared_memory.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
11 #include "base/threading/thread_task_runner_handle.h" 11 #include "base/threading/thread_task_runner_handle.h"
12 #include "components/viz/common/server_gpu_memory_buffer_manager.h"
12 #include "gpu/ipc/client/gpu_channel_host.h" 13 #include "gpu/ipc/client/gpu_channel_host.h"
13 #include "gpu/ipc/client/gpu_memory_buffer_impl_shared_memory.h" 14 #include "gpu/ipc/client/gpu_memory_buffer_impl_shared_memory.h"
14 #include "mojo/public/cpp/bindings/strong_binding.h" 15 #include "mojo/public/cpp/bindings/strong_binding.h"
15 #include "mojo/public/cpp/system/buffer.h" 16 #include "mojo/public/cpp/system/buffer.h"
16 #include "mojo/public/cpp/system/platform_handle.h" 17 #include "mojo/public/cpp/system/platform_handle.h"
17 #include "services/ui/common/server_gpu_memory_buffer_manager.h"
18 #include "services/ui/ws/gpu_client.h" 18 #include "services/ui/ws/gpu_client.h"
19 #include "services/ui/ws/gpu_host_delegate.h" 19 #include "services/ui/ws/gpu_host_delegate.h"
20 #include "ui/gfx/buffer_format_util.h" 20 #include "ui/gfx/buffer_format_util.h"
21 21
22 #if defined(OS_WIN) 22 #if defined(OS_WIN)
23 #include "ui/gfx/win/rendering_window_manager.h" 23 #include "ui/gfx/win/rendering_window_manager.h"
24 #endif 24 #endif
25 25
26 namespace ui { 26 namespace ui {
27 namespace ws { 27 namespace ws {
(...skipping 15 matching lines...) Expand all
43 gpu_main_impl_ = base::MakeUnique<GpuMain>(MakeRequest(&gpu_main_)); 43 gpu_main_impl_ = base::MakeUnique<GpuMain>(MakeRequest(&gpu_main_));
44 44
45 // TODO(sad): Correctly initialize gpu::GpuPreferences (like it is initialized 45 // TODO(sad): Correctly initialize gpu::GpuPreferences (like it is initialized
46 // in GpuProcessHost::Init()). 46 // in GpuProcessHost::Init()).
47 gpu::GpuPreferences preferences; 47 gpu::GpuPreferences preferences;
48 mojom::GpuHostPtr gpu_host_proxy; 48 mojom::GpuHostPtr gpu_host_proxy;
49 gpu_host_binding_.Bind(mojo::MakeRequest(&gpu_host_proxy)); 49 gpu_host_binding_.Bind(mojo::MakeRequest(&gpu_host_proxy));
50 gpu_main_->CreateGpuService(MakeRequest(&gpu_service_), 50 gpu_main_->CreateGpuService(MakeRequest(&gpu_service_),
51 std::move(gpu_host_proxy), preferences, 51 std::move(gpu_host_proxy), preferences,
52 mojo::ScopedSharedBufferHandle()); 52 mojo::ScopedSharedBufferHandle());
53 gpu_memory_buffer_manager_ = base::MakeUnique<ServerGpuMemoryBufferManager>( 53 gpu_memory_buffer_manager_ =
54 gpu_service_.get(), next_client_id_++); 54 base::MakeUnique<viz::ServerGpuMemoryBufferManager>(gpu_service_.get(),
55 next_client_id_++);
55 } 56 }
56 57
57 DefaultGpuHost::~DefaultGpuHost() {} 58 DefaultGpuHost::~DefaultGpuHost() {}
58 59
59 void DefaultGpuHost::Add(mojom::GpuRequest request) { 60 void DefaultGpuHost::Add(mojom::GpuRequest request) {
60 AddInternal(std::move(request)); 61 AddInternal(std::move(request));
61 } 62 }
62 63
63 void DefaultGpuHost::OnAcceleratedWidgetAvailable( 64 void DefaultGpuHost::OnAcceleratedWidgetAvailable(
64 gfx::AcceleratedWidget widget) { 65 gfx::AcceleratedWidget widget) {
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 void DefaultGpuHost::StoreShaderToDisk(int32_t client_id, 140 void DefaultGpuHost::StoreShaderToDisk(int32_t client_id,
140 const std::string& key, 141 const std::string& key,
141 const std::string& shader) {} 142 const std::string& shader) {}
142 143
143 void DefaultGpuHost::RecordLogMessage(int32_t severity, 144 void DefaultGpuHost::RecordLogMessage(int32_t severity,
144 const std::string& header, 145 const std::string& header,
145 const std::string& message) {} 146 const std::string& message) {}
146 147
147 } // namespace ws 148 } // namespace ws
148 } // namespace ui 149 } // namespace ui
OLDNEW
« no previous file with comments | « services/ui/ws/gpu_host.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698