summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjin.a.yang@intel.com <jin.a.yang@intel.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-04 06:35:25 +0000
committerjin.a.yang@intel.com <jin.a.yang@intel.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-04 06:35:25 +0000
commit5750c520339e4bd5ff202a1ce17be8e2c659be2b (patch)
tree394ae20ff579968b2909667201fa932d8b80ab0b
parent2aebc4598ad8ac8e135396b9e538eea2b4ff8a1d (diff)
downloadchromium_src-5750c520339e4bd5ff202a1ce17be8e2c659be2b.zip
chromium_src-5750c520339e4bd5ff202a1ce17be8e2c659be2b.tar.gz
chromium_src-5750c520339e4bd5ff202a1ce17be8e2c659be2b.tar.bz2
Fix GPU acceleration failure with single process mode
It's still useful to debug in single process mode. This is a regression caused by recent change: gpu info collection has removed from thread startup and will do on demand. But for normal mode we have GpuMain to do GL interface binding at startup while none for single process mode. So we should do GL binding for single process mode at thread start up, otherwise Gpu acceleration will fail because no GL binding will be found. BUG=130258 TEST= Review URL: https://chromiumcodereview.appspot.com/10441089 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@140263 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--AUTHORS1
-rw-r--r--content/gpu/gpu_child_thread.cc17
2 files changed, 15 insertions, 3 deletions
diff --git a/AUTHORS b/AUTHORS
index cfca2c8..5fb948d 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -169,6 +169,7 @@ Aaron Randolph <aaron.randolph@gmail.com>
Yumikiyo Osanai <yumios.art@gmail.com>
Matthew Robertson <matthewrobertson03@gmail.com>
Mao Yujie <yujie.mao@intel.com>
+Jin Yang <jin.a.yang@intel.com>
Xinchao He <hexinchao@gmail.com>
Stephen Searles <stephen.searles@gmail.com>
Arun Mankuzhi <arun.m@samsung.com>
diff --git a/content/gpu/gpu_child_thread.cc b/content/gpu/gpu_child_thread.cc
index 2fd64c2..76f482e 100644
--- a/content/gpu/gpu_child_thread.cc
+++ b/content/gpu/gpu_child_thread.cc
@@ -65,6 +65,14 @@ GpuChildThread::GpuChildThread(const std::string& channel_id)
target_services_ = NULL;
collecting_dx_diagnostics_ = false;
#endif
+ if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess) ||
+ CommandLine::ForCurrentProcess()->HasSwitch(switches::kInProcessGPU)) {
+ // For single process and in-process GPU mode, we need to load and
+ // initialize the GL implementation and locate the GL entry points here.
+ if (!gfx::GLSurface::InitializeOneOff()) {
+ VLOG(1) << "gfx::GLSurface::InitializeOneOff()";
+ }
+ }
}
@@ -176,9 +184,12 @@ void GpuChildThread::StopWatchdog() {
void GpuChildThread::OnCollectGraphicsInfo() {
if (!gpu_info_.finalized &&
- CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kDisableGpuSandbox)) {
- // GPU full info collection should only happen on un-sandboxed GPU process.
+ (CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kDisableGpuSandbox) ||
+ CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess) ||
+ CommandLine::ForCurrentProcess()->HasSwitch(switches::kInProcessGPU))) {
+ // GPU full info collection should only happen on un-sandboxed GPU process
+ // or single process/in-process gpu mode.
if (!gpu_info_collector::CollectGraphicsInfo(&gpu_info_))
VLOG(1) << "gpu_info_collector::CollectGraphicsInfo failed";