diff options
author | yoz@chromium.org <yoz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-30 02:06:08 +0000 |
---|---|---|
committer | yoz@chromium.org <yoz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-30 02:06:08 +0000 |
commit | 64437e622c11f77938e41b473bd77421ec2482e1 (patch) | |
tree | 09baeeb57cf7f5d40829051c1d75adb58c7e9393 /content/gpu | |
parent | cb99348010b1e026f4ef4c0d242434731e497dca (diff) | |
download | chromium_src-64437e622c11f77938e41b473bd77421ec2482e1.zip chromium_src-64437e622c11f77938e41b473bd77421ec2482e1.tar.gz chromium_src-64437e622c11f77938e41b473bd77421ec2482e1.tar.bz2 |
Revert 247793 "Ensure GL initialization only happens once, and p..."
due to new static initializers in gl_bindings_autogen_gl.cc
> Ensure GL initialization only happens once, and provide common init path
>
> Currently tests initialize GL by calling into methods that should be
> internal to the gl bindings code. Instead, everyone should go through
> GLSurface::InitializeOneOff.
>
> Also GLSurface::InitializeOneOff early outs if it was already called,
> leading to a pattern of initializing GL all over the place just in case
> and not having a clear idea of where it should be set up. Instead, DCHECK
> that it is not called more than once, and move calls to this method to
> be during process startup for unit test suites instead of mid-test.
>
> This adds two test variants of InitializeOneOff for tests to call, that
> set up OSMesa or Mock GL bindings, via GLSurface::InitializeOneOff.
>
> R=piman, sievers
> BUG=270918
>
> Review URL: https://codereview.chromium.org/135213003
TBR=danakj@chromium.org
Review URL: https://codereview.chromium.org/149953003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@247811 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/gpu')
-rw-r--r-- | content/gpu/gpu_child_thread.cc | 9 | ||||
-rw-r--r-- | content/gpu/gpu_main.cc | 19 |
2 files changed, 4 insertions, 24 deletions
diff --git a/content/gpu/gpu_child_thread.cc b/content/gpu/gpu_child_thread.cc index 63f850f..170b364 100644 --- a/content/gpu/gpu_child_thread.cc +++ b/content/gpu/gpu_child_thread.cc @@ -65,14 +65,11 @@ GpuChildThread::GpuChildThread(const std::string& channel_id) DCHECK( CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess) || CommandLine::ForCurrentProcess()->HasSwitch(switches::kInProcessGPU)); -#if !defined(OS_ANDROID) // For single process and in-process GPU mode, we need to load and // initialize the GL implementation and locate the GL entry points here. - // On Android, GLSurface::InitializeOneOff() is called from BrowserMainLoop - // before getting here. crbug.com/326295 - if (!gfx::GLSurface::InitializeOneOff()) - VLOG(1) << "gfx::GLSurface::InitializeOneOff failed"; -#endif + if (!gfx::GLSurface::InitializeOneOff()) { + VLOG(1) << "gfx::GLSurface::InitializeOneOff()"; + } g_thread_safe_sender.Get() = thread_safe_sender(); } diff --git a/content/gpu/gpu_main.cc b/content/gpu/gpu_main.cc index 9e6160d..f7650e7 100644 --- a/content/gpu/gpu_main.cc +++ b/content/gpu/gpu_main.cc @@ -219,25 +219,8 @@ int GpuMain(const MainFunctionParams& parameters) { base::TimeTicks before_initialize_one_off = base::TimeTicks::Now(); - // Determine if we need to initialize GL here or it has already been done. - bool gl_already_initialized = false; -#if defined(OS_MACOSX) - // On Mac, GLSurface::InitializeOneOff() is called from the sandbox warmup - // code before getting here. - gl_already_initialized = true; -#endif - if (command_line.HasSwitch(switches::kInProcessGPU)) { - // With in-process GPU, GLSurface::InitializeOneOff() is called from - // GpuChildThread before getting here. - gl_already_initialized = true; - } - // Load and initialize the GL implementation and locate the GL entry points. - bool gl_initialized = - gl_already_initialized - ? gfx::GetGLImplementation() != gfx::kGLImplementationNone - : gfx::GLSurface::InitializeOneOff(); - if (gl_initialized) { + if (gfx::GLSurface::InitializeOneOff()) { // We need to collect GL strings (VENDOR, RENDERER) for blacklisting // purposes. However, on Mac we don't actually use them. As documented in // crbug.com/222934, due to some driver issues, glGetString could take |