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

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

Issue 2338483003: Revert of services/ui: Use new gpu::GpuInit to do the GPU initialization. (Closed)
Patch Set: Created 4 years, 3 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/gpu/gpu_main.h ('k') | services/ui/gpu/gpu_service_internal.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "services/ui/gpu/gpu_main.h"
6
7 #include "base/command_line.h"
8 #include "gpu/ipc/common/gpu_memory_buffer_support.h"
9 #include "gpu/ipc/service/gpu_memory_buffer_factory.h"
10 #include "gpu/ipc/service/gpu_watchdog_thread.h"
11 #include "services/ui/gpu/gpu_service_internal.h"
12
13 namespace ui {
14
15 GpuMain::GpuMain() {
16 gpu_init_.set_sandbox_helper(this);
17 bool success = gpu_init_.InitializeAndStartSandbox(
18 *base::CommandLine::ForCurrentProcess());
19 if (success) {
20 if (gpu::GetNativeGpuMemoryBufferType() != gfx::EMPTY_BUFFER) {
21 gpu_memory_buffer_factory_ =
22 gpu::GpuMemoryBufferFactory::CreateNativeType();
23 }
24 gpu_service_internal_.reset(new GpuServiceInternal(
25 gpu_init_.gpu_info(), gpu_init_.watchdog_thread(),
26 gpu_memory_buffer_factory_.get()));
27 }
28 }
29
30 GpuMain::~GpuMain() {
31 gpu_init_.watchdog_thread()->Stop();
32 }
33
34 void GpuMain::Add(mojom::GpuServiceInternalRequest request) {
35 if (gpu_service_internal_)
36 gpu_service_internal_->Add(std::move(request));
37 }
38
39 void GpuMain::PreSandboxStartup() {
40 // TODO(sad): https://crbug.com/645602
41 }
42
43 bool GpuMain::EnsureSandboxInitialized() {
44 // TODO(sad): https://crbug.com/645602
45 return true;
46 }
47
48 } // namespace ui
OLDNEW
« no previous file with comments | « services/ui/gpu/gpu_main.h ('k') | services/ui/gpu/gpu_service_internal.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698