diff options
Diffstat (limited to 'content')
-rw-r--r-- | content/gpu/gpu_child_thread.cc | 19 | ||||
-rw-r--r-- | content/gpu/gpu_child_thread.h | 5 | ||||
-rw-r--r-- | content/gpu/gpu_main.cc | 19 |
3 files changed, 25 insertions, 18 deletions
diff --git a/content/gpu/gpu_child_thread.cc b/content/gpu/gpu_child_thread.cc index 3aae568..9d5ac55 100644 --- a/content/gpu/gpu_child_thread.cc +++ b/content/gpu/gpu_child_thread.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -13,7 +13,6 @@ #include "build/build_config.h" #include "content/common/child_process.h" #include "content/common/gpu/gpu_messages.h" -#include "content/public/common/content_client.h" #include "content/public/common/content_switches.h" #include "content/gpu/gpu_info_collector.h" #include "content/gpu/gpu_watchdog_thread.h" @@ -37,8 +36,10 @@ bool GpuProcessLogMessageHandler(int severity, } // namespace -GpuChildThread::GpuChildThread(bool dead_on_arrival) - : dead_on_arrival_(dead_on_arrival) { +GpuChildThread::GpuChildThread(bool dead_on_arrival, + const content::GPUInfo& gpu_info) + : dead_on_arrival_(dead_on_arrival), + gpu_info_(gpu_info) { #if defined(OS_WIN) target_services_ = NULL; collecting_dx_diagnostics_ = false; @@ -52,6 +53,9 @@ GpuChildThread::GpuChildThread(const std::string& channel_id) target_services_ = NULL; collecting_dx_diagnostics_ = false; #endif + if (!gpu_info_collector::CollectGraphicsInfo(&gpu_info_)) { + LOG(INFO) << "gpu_info_collector::CollectGraphicsInfo failed"; + } } @@ -103,13 +107,6 @@ void GpuChildThread::OnInitialize() { !CommandLine::ForCurrentProcess()->HasSwitch(switches::kInProcessGPU)) logging::SetLogMessageHandler(GpuProcessLogMessageHandler); - // Always set gpu info and send it back, even if there's an error and it's - // impartially collected. - bool succeeded = gpu_info_collector::CollectGraphicsInfo(&gpu_info_); - content::GetContentClient()->SetGpuInfo(gpu_info_); - LOG(INFO) << "gpu_info_collector::CollectGraphicsInfo complete. success = " << - succeeded; - // 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_; diff --git a/content/gpu/gpu_child_thread.h b/content/gpu/gpu_child_thread.h index 111626a..0f39b42 100644 --- a/content/gpu/gpu_child_thread.h +++ b/content/gpu/gpu_child_thread.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -34,7 +34,8 @@ class GpuWatchdogThread; // commands to the GPU. class GpuChildThread : public ChildThread { public: - explicit GpuChildThread(bool dead_on_arrival); + explicit GpuChildThread(bool dead_on_arrival, + const content::GPUInfo& gpu_info); // For single-process mode. explicit GpuChildThread(const std::string& channel_id); diff --git a/content/gpu/gpu_main.cc b/content/gpu/gpu_main.cc index b1d6629..49155a31 100644 --- a/content/gpu/gpu_main.cc +++ b/content/gpu/gpu_main.cc @@ -15,9 +15,11 @@ #include "base/win/scoped_com_initializer.h" #include "build/build_config.h" #include "content/common/gpu/gpu_config.h" +#include "content/public/common/content_client.h" #include "content/public/common/content_switches.h" #include "content/public/common/main_function_params.h" #include "content/gpu/gpu_child_thread.h" +#include "content/gpu/gpu_info_collector.h" #include "content/gpu/gpu_process.h" #include "ui/gfx/gl/gl_surface.h" #include "ui/gfx/gl/gl_switches.h" @@ -71,10 +73,17 @@ int GpuMain(const content::MainFunctionParams& parameters) { // GpuMsg_Initialize message from the browser. bool dead_on_arrival = false; - // Load the GL implementation and locate the bindings before starting the GPU - // watchdog because this can take a lot of time and the GPU watchdog might - // terminate the GPU process. - if (!gfx::GLSurface::InitializeOneOff()) { + // Load and initialize the GL implementation and locate the GL entry points. + content::GPUInfo gpu_info; + if (gfx::GLSurface::InitializeOneOff()) { + // Collect information about the GPU. + if (!gpu_info_collector::CollectGraphicsInfo(&gpu_info)) { + LOG(INFO) << "gpu_info_collector::CollectGraphicsInfo failed"; + } + + // Set the GPU info even if it failed. + content::GetContentClient()->SetGpuInfo(gpu_info); + } else { LOG(INFO) << "gfx::GLSurface::InitializeOneOff failed"; dead_on_arrival = true; } @@ -114,7 +123,7 @@ int GpuMain(const content::MainFunctionParams& parameters) { GpuProcess gpu_process; - GpuChildThread* child_thread = new GpuChildThread(dead_on_arrival); + GpuChildThread* child_thread = new GpuChildThread(dead_on_arrival, gpu_info); child_thread->Init(start_time); |