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

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

Issue 2654993004: Move GPU blacklist calculation to GPU proc (Closed)
Patch Set: cleanup Created 3 years, 11 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
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_switches.h"
13 #include "gpu/config/gpu_util.h"
12 #include "gpu/ipc/common/gpu_memory_buffer_support.h" 14 #include "gpu/ipc/common/gpu_memory_buffer_support.h"
13 #include "gpu/ipc/service/gpu_memory_buffer_factory.h" 15 #include "gpu/ipc/service/gpu_memory_buffer_factory.h"
14 #include "ui/gl/init/gl_factory.h" 16 #include "ui/gl/init/gl_factory.h"
15 17
16 #if defined(OS_ANDROID) 18 #if defined(OS_ANDROID)
17 #include "base/android/jni_android.h" 19 #include "base/android/jni_android.h"
18 #endif 20 #endif
19 21
20 namespace content { 22 namespace content {
21 23
(...skipping 27 matching lines...) Expand all
49 #endif 51 #endif
50 52
51 gpu_process_ = new GpuProcess(io_thread_priority); 53 gpu_process_ = new GpuProcess(io_thread_priority);
52 54
53 gpu::GPUInfo gpu_info; 55 gpu::GPUInfo gpu_info;
54 if (!gl::init::InitializeGLOneOff()) 56 if (!gl::init::InitializeGLOneOff())
55 VLOG(1) << "gl::init::InitializeGLOneOff failed"; 57 VLOG(1) << "gl::init::InitializeGLOneOff failed";
56 else 58 else
57 gpu::CollectContextGraphicsInfo(&gpu_info); 59 gpu::CollectContextGraphicsInfo(&gpu_info);
58 60
61 gpu::GPUFeatureStatus feature_status;
62 const base::CommandLine* command_line =
63 base::CommandLine::ForCurrentProcess();
64 if (!command_line->HasSwitch(switches::kIgnoreGpuBlacklist)) {
65 feature_status = gpu::GetGpuFeatureStatus(gpu_info, *command_line);
66 }
67
59 // The process object takes ownership of the thread object, so do not 68 // The process object takes ownership of the thread object, so do not
60 // save and delete the pointer. 69 // save and delete the pointer.
61 GpuChildThread* child_thread = 70 GpuChildThread* child_thread = new GpuChildThread(
62 new GpuChildThread(params_, gpu_info, gpu_memory_buffer_factory_.get()); 71 params_, gpu_info, feature_status, gpu_memory_buffer_factory_.get());
63 72
64 // Since we are in the browser process, use the thread start time as the 73 // Since we are in the browser process, use the thread start time as the
65 // process start time. 74 // process start time.
66 child_thread->Init(base::Time::Now()); 75 child_thread->Init(base::Time::Now());
67 76
68 gpu_process_->set_main_thread(child_thread); 77 gpu_process_->set_main_thread(child_thread);
69 } 78 }
70 79
71 void InProcessGpuThread::CleanUp() { 80 void InProcessGpuThread::CleanUp() {
72 SetThreadWasQuitProperly(true); 81 SetThreadWasQuitProperly(true);
73 delete gpu_process_; 82 delete gpu_process_;
74 } 83 }
75 84
76 base::Thread* CreateInProcessGpuThread( 85 base::Thread* CreateInProcessGpuThread(
77 const InProcessChildThreadParams& params, 86 const InProcessChildThreadParams& params,
78 const gpu::GpuPreferences& gpu_preferences) { 87 const gpu::GpuPreferences& gpu_preferences) {
79 return new InProcessGpuThread(params, gpu_preferences); 88 return new InProcessGpuThread(params, gpu_preferences);
80 } 89 }
81 90
82 } // namespace content 91 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698