diff options
Diffstat (limited to 'ui/gl/gl_surface.cc')
-rw-r--r-- | ui/gl/gl_surface.cc | 64 |
1 files changed, 0 insertions, 64 deletions
diff --git a/ui/gl/gl_surface.cc b/ui/gl/gl_surface.cc index 8a60ca5..a4a6035 100644 --- a/ui/gl/gl_surface.cc +++ b/ui/gl/gl_surface.cc @@ -97,70 +97,6 @@ bool GLSurface::InitializeOneOffImplementation(GLImplementation impl, return initialized; } -// static -void GLSurface::InitializeOneOffForTests() { - DCHECK_EQ(kGLImplementationNone, GetGLImplementation()); - -#if defined(USE_X11) - XInitThreads(); -#endif - - bool use_osmesa = true; - - // We usually use OSMesa as this works on all bots. The command line can - // override this behaviour to use hardware GL. - if (base::CommandLine::ForCurrentProcess()->HasSwitch( - switches::kUseGpuInTests)) - use_osmesa = false; - -#if defined(OS_ANDROID) - // On Android we always use hardware GL. - use_osmesa = false; -#endif - - std::vector<GLImplementation> allowed_impls; - GetAllowedGLImplementations(&allowed_impls); - DCHECK(!allowed_impls.empty()); - - GLImplementation impl = allowed_impls[0]; - if (use_osmesa) - impl = kGLImplementationOSMesaGL; - - DCHECK(!base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kUseGL)) - << "kUseGL has not effect in tests"; - - bool fallback_to_osmesa = false; - bool gpu_service_logging = false; - bool disable_gl_drawing = true; - - CHECK(InitializeOneOffImplementation( - impl, fallback_to_osmesa, gpu_service_logging, disable_gl_drawing)); -} - -// static -void GLSurface::InitializeOneOffWithMockBindingsForTests() { - DCHECK(!base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kUseGL)) - << "kUseGL has not effect in tests"; - - // This method may be called multiple times in the same process to set up - // mock bindings in different ways. - ClearGLBindings(); - - bool fallback_to_osmesa = false; - bool gpu_service_logging = false; - bool disable_gl_drawing = false; - - CHECK(InitializeOneOffImplementation(kGLImplementationMockGL, - fallback_to_osmesa, - gpu_service_logging, - disable_gl_drawing)); -} - -// static -void GLSurface::InitializeDynamicMockBindingsForTests(GLContext* context) { - CHECK(InitializeDynamicGLBindings(kGLImplementationMockGL, context)); -} - GLSurface::GLSurface() {} bool GLSurface::Initialize() { |