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

Side by Side Diff: content/gpu/in_process_gpu_thread.cc

Issue 2749873002: Move Ozone GPU initialization. (Closed)
Patch Set: Fixes. Created 3 years, 9 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 | gpu/ipc/service/gpu_init.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "content/gpu/in_process_gpu_thread.h" 5 #include "content/gpu/in_process_gpu_thread.h"
6 6
7 #include "base/time/time.h" 7 #include "base/time/time.h"
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 #include "content/gpu/gpu_child_thread.h" 9 #include "content/gpu/gpu_child_thread.h"
10 #include "content/gpu/gpu_process.h" 10 #include "content/gpu/gpu_process.h"
11 #include "gpu/config/gpu_info_collector.h" 11 #include "gpu/config/gpu_info_collector.h"
12 #include "gpu/config/gpu_util.h" 12 #include "gpu/config/gpu_util.h"
13 #include "gpu/ipc/common/gpu_memory_buffer_support.h" 13 #include "gpu/ipc/common/gpu_memory_buffer_support.h"
14 #include "gpu/ipc/service/gpu_memory_buffer_factory.h" 14 #include "gpu/ipc/service/gpu_memory_buffer_factory.h"
15 #include "ui/gl/init/gl_factory.h" 15 #include "ui/gl/init/gl_factory.h"
16 16
17 #if defined(OS_ANDROID) 17 #if defined(OS_ANDROID)
18 #include "base/android/jni_android.h" 18 #include "base/android/jni_android.h"
19 #endif 19 #endif
20 20
21 #if defined(USE_OZONE)
22 #include "ui/ozone/public/ozone_platform.h"
23 #endif
24
21 namespace content { 25 namespace content {
22 26
23 InProcessGpuThread::InProcessGpuThread( 27 InProcessGpuThread::InProcessGpuThread(
24 const InProcessChildThreadParams& params, 28 const InProcessChildThreadParams& params,
25 const gpu::GpuPreferences& gpu_preferences) 29 const gpu::GpuPreferences& gpu_preferences)
26 : base::Thread("Chrome_InProcGpuThread"), 30 : base::Thread("Chrome_InProcGpuThread"),
27 params_(params), 31 params_(params),
28 gpu_process_(NULL), 32 gpu_process_(NULL),
29 gpu_preferences_(gpu_preferences), 33 gpu_preferences_(gpu_preferences),
30 gpu_memory_buffer_factory_( 34 gpu_memory_buffer_factory_(
(...skipping 13 matching lines...) Expand all
44 // calls. The latter causes Java VM to assign Thread-??? to the thread name. 48 // calls. The latter causes Java VM to assign Thread-??? to the thread name.
45 // Please note calls to AttachCurrentThreadWithName after AttachCurrentThread 49 // Please note calls to AttachCurrentThreadWithName after AttachCurrentThread
46 // will not change the thread name kept in Java VM. 50 // will not change the thread name kept in Java VM.
47 base::android::AttachCurrentThreadWithName(thread_name()); 51 base::android::AttachCurrentThreadWithName(thread_name());
48 // Up the priority of the |io_thread_| on Android. 52 // Up the priority of the |io_thread_| on Android.
49 io_thread_priority = base::ThreadPriority::DISPLAY; 53 io_thread_priority = base::ThreadPriority::DISPLAY;
50 #endif 54 #endif
51 55
52 gpu_process_ = new GpuProcess(io_thread_priority); 56 gpu_process_ = new GpuProcess(io_thread_priority);
53 57
58 #if defined(USE_OZONE)
59 ui::OzonePlatform::InitParams params;
60 params.single_process = true;
61 ui::OzonePlatform::InitializeForGPU(params);
62 #endif
63
54 gpu::GPUInfo gpu_info; 64 gpu::GPUInfo gpu_info;
55 if (!gl::init::InitializeGLOneOff()) 65 if (!gl::init::InitializeGLOneOff())
56 VLOG(1) << "gl::init::InitializeGLOneOff failed"; 66 VLOG(1) << "gl::init::InitializeGLOneOff failed";
57 else 67 else
58 gpu::CollectContextGraphicsInfo(&gpu_info); 68 gpu::CollectContextGraphicsInfo(&gpu_info);
59 69
60 gpu::GpuFeatureInfo gpu_feature_info = 70 gpu::GpuFeatureInfo gpu_feature_info =
61 gpu::GetGpuFeatureInfo(gpu_info, *base::CommandLine::ForCurrentProcess()); 71 gpu::GetGpuFeatureInfo(gpu_info, *base::CommandLine::ForCurrentProcess());
62 72
63 // The process object takes ownership of the thread object, so do not 73 // The process object takes ownership of the thread object, so do not
(...skipping 13 matching lines...) Expand all
77 delete gpu_process_; 87 delete gpu_process_;
78 } 88 }
79 89
80 base::Thread* CreateInProcessGpuThread( 90 base::Thread* CreateInProcessGpuThread(
81 const InProcessChildThreadParams& params, 91 const InProcessChildThreadParams& params,
82 const gpu::GpuPreferences& gpu_preferences) { 92 const gpu::GpuPreferences& gpu_preferences) {
83 return new InProcessGpuThread(params, gpu_preferences); 93 return new InProcessGpuThread(params, gpu_preferences);
84 } 94 }
85 95
86 } // namespace content 96 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | gpu/ipc/service/gpu_init.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698