| Index: content/gpu/gpu_child_thread.cc
|
| diff --git a/content/gpu/gpu_child_thread.cc b/content/gpu/gpu_child_thread.cc
|
| index 7a37c9f2d56711207bbc89f1b75442ed266c3a53..7ecccc2a27763d99e9ab7365e34e8b43cc4ed9b6 100644
|
| --- a/content/gpu/gpu_child_thread.cc
|
| +++ b/content/gpu/gpu_child_thread.cc
|
| @@ -44,15 +44,6 @@ namespace {
|
| static base::LazyInstance<scoped_refptr<ThreadSafeSender> >
|
| g_thread_safe_sender = LAZY_INSTANCE_INITIALIZER;
|
|
|
| -bool GetSizeTFromSwitch(const base::CommandLine* command_line,
|
| - const base::StringPiece& switch_string,
|
| - size_t* value) {
|
| - if (!command_line->HasSwitch(switch_string))
|
| - return false;
|
| - std::string switch_value(command_line->GetSwitchValueASCII(switch_string));
|
| - return base::StringToSizeT(switch_value, value);
|
| -}
|
| -
|
| bool GpuProcessLogMessageHandler(int severity,
|
| const char* file, int line,
|
| size_t message_start,
|
| @@ -156,7 +147,6 @@ GpuChildThread::GpuChildThread(
|
| GpuMemoryBufferFactory* gpu_memory_buffer_factory,
|
| gpu::SyncPointManager* sync_point_manager)
|
| : ChildThreadImpl(GetOptions(gpu_memory_buffer_factory)),
|
| - gpu_preferences_(GetGpuPreferencesFromCommandLine()),
|
| dead_on_arrival_(dead_on_arrival),
|
| sync_point_manager_(sync_point_manager),
|
| gpu_info_(gpu_info),
|
| @@ -345,7 +335,8 @@ void GpuChildThread::StoreShaderToDisk(int32_t client_id,
|
| Send(new GpuHostMsg_CacheShader(client_id, key, shader));
|
| }
|
|
|
| -void GpuChildThread::OnInitialize() {
|
| +void GpuChildThread::OnInitialize(const gpu::GpuPreferences& gpu_preferences) {
|
| + gpu_preferences_ = gpu_preferences;
|
| // Record initialization only after collecting the GPU info because that can
|
| // take a significant amount of time.
|
| gpu_info_.initialization_time = base::Time::Now() - process_start_time_;
|
| @@ -394,70 +385,6 @@ void GpuChildThread::StopWatchdog() {
|
| }
|
| }
|
|
|
| -// static
|
| -gpu::GpuPreferences GpuChildThread::GetGpuPreferencesFromCommandLine() {
|
| - // TODO(penghuang): share below code with
|
| - // android_webview/browser/deferred_gpu_command_service.cc
|
| - // http://crbug.com/590825
|
| - // For any modification of below code, deferred_gpu_command_service.cc should
|
| - // be updated as well.
|
| - DCHECK(base::CommandLine::InitializedForCurrentProcess());
|
| - const base::CommandLine* command_line =
|
| - base::CommandLine::ForCurrentProcess();
|
| - gpu::GpuPreferences gpu_preferences;
|
| - gpu_preferences.single_process =
|
| - command_line->HasSwitch(switches::kSingleProcess);
|
| - gpu_preferences.in_process_gpu =
|
| - command_line->HasSwitch(switches::kInProcessGPU);
|
| - gpu_preferences.ui_prioritize_in_gpu_process =
|
| - command_line->HasSwitch(switches::kUIPrioritizeInGpuProcess);
|
| - gpu_preferences.compile_shader_always_succeeds =
|
| - command_line->HasSwitch(switches::kCompileShaderAlwaysSucceeds);
|
| - gpu_preferences.disable_gl_error_limit =
|
| - command_line->HasSwitch(switches::kDisableGLErrorLimit);
|
| - gpu_preferences.disable_glsl_translator =
|
| - command_line->HasSwitch(switches::kDisableGLSLTranslator);
|
| - gpu_preferences.disable_gpu_driver_bug_workarounds =
|
| - command_line->HasSwitch(switches::kDisableGpuDriverBugWorkarounds);
|
| - gpu_preferences.disable_shader_name_hashing =
|
| - command_line->HasSwitch(switches::kDisableShaderNameHashing);
|
| - gpu_preferences.enable_gpu_command_logging =
|
| - command_line->HasSwitch(switches::kEnableGPUCommandLogging);
|
| - gpu_preferences.enable_gpu_debugging =
|
| - command_line->HasSwitch(switches::kEnableGPUDebugging);
|
| - gpu_preferences.enable_gpu_service_logging_gpu =
|
| - command_line->HasSwitch(switches::kEnableGPUServiceLoggingGPU);
|
| - gpu_preferences.disable_gpu_program_cache =
|
| - command_line->HasSwitch(switches::kDisableGpuProgramCache);
|
| - gpu_preferences.enforce_gl_minimums =
|
| - command_line->HasSwitch(switches::kEnforceGLMinimums);
|
| - if (GetSizeTFromSwitch(command_line, switches::kForceGpuMemAvailableMb,
|
| - &gpu_preferences.force_gpu_mem_available)) {
|
| - gpu_preferences.force_gpu_mem_available *= 1024 * 1024;
|
| - }
|
| - if (GetSizeTFromSwitch(command_line, switches::kGpuProgramCacheSizeKb,
|
| - &gpu_preferences.gpu_program_cache_size)) {
|
| - gpu_preferences.gpu_program_cache_size *= 1024;
|
| - }
|
| - gpu_preferences.enable_share_group_async_texture_upload =
|
| - command_line->HasSwitch(switches::kEnableShareGroupAsyncTextureUpload);
|
| - gpu_preferences.enable_subscribe_uniform_extension =
|
| - command_line->HasSwitch(switches::kEnableSubscribeUniformExtension);
|
| - gpu_preferences.enable_threaded_texture_mailboxes =
|
| - command_line->HasSwitch(switches::kEnableThreadedTextureMailboxes);
|
| - gpu_preferences.gl_shader_interm_output =
|
| - command_line->HasSwitch(switches::kGLShaderIntermOutput);
|
| - gpu_preferences.emulate_shader_precision =
|
| - command_line->HasSwitch(switches::kEmulateShaderPrecision);
|
| - gpu_preferences.enable_gpu_service_logging =
|
| - command_line->HasSwitch(switches::kEnableGPUServiceLogging);
|
| - gpu_preferences.enable_gpu_service_tracing =
|
| - command_line->HasSwitch(switches::kEnableGPUServiceTracing);
|
| - gpu_preferences.enable_unsafe_es3_apis =
|
| - command_line->HasSwitch(switches::kEnableUnsafeES3APIs);
|
| - return gpu_preferences;
|
| -}
|
| -
|
| void GpuChildThread::OnCollectGraphicsInfo() {
|
| #if defined(OS_WIN)
|
| // GPU full info collection should only happen on un-sandboxed GPU process
|
|
|