| Index: ui/gl/gl_surface.cc
|
| diff --git a/ui/gl/gl_surface.cc b/ui/gl/gl_surface.cc
|
| index c84326699e61c83e48530cfa895ea5fe78f6d5ff..24c882a9bb429a954881d5e3ba75de7f3c3717fb 100644
|
| --- a/ui/gl/gl_surface.cc
|
| +++ b/ui/gl/gl_surface.cc
|
| @@ -24,75 +24,6 @@ base::LazyInstance<base::ThreadLocalPointer<GLSurface> >::Leaky
|
| current_surface_ = LAZY_INSTANCE_INITIALIZER;
|
| } // namespace
|
|
|
| -// static
|
| -bool GLSurface::InitializeOneOff() {
|
| - DCHECK_EQ(kGLImplementationNone, GetGLImplementation());
|
| -
|
| - TRACE_EVENT0("gpu,startup", "GLSurface::InitializeOneOff");
|
| -
|
| - std::vector<GLImplementation> allowed_impls;
|
| - GetAllowedGLImplementations(&allowed_impls);
|
| - DCHECK(!allowed_impls.empty());
|
| -
|
| - base::CommandLine* cmd = base::CommandLine::ForCurrentProcess();
|
| -
|
| - // The default implementation is always the first one in list.
|
| - GLImplementation impl = allowed_impls[0];
|
| - bool fallback_to_osmesa = false;
|
| - if (cmd->HasSwitch(switches::kOverrideUseGLWithOSMesaForTests)) {
|
| - impl = kGLImplementationOSMesaGL;
|
| - } else if (cmd->HasSwitch(switches::kUseGL)) {
|
| - std::string requested_implementation_name =
|
| - cmd->GetSwitchValueASCII(switches::kUseGL);
|
| - if (requested_implementation_name == "any") {
|
| - fallback_to_osmesa = true;
|
| - } else if (requested_implementation_name ==
|
| - kGLImplementationSwiftShaderName ||
|
| - requested_implementation_name == kGLImplementationANGLEName) {
|
| - impl = kGLImplementationEGLGLES2;
|
| - } else {
|
| - impl = GetNamedGLImplementation(requested_implementation_name);
|
| - if (!ContainsValue(allowed_impls, impl)) {
|
| - LOG(ERROR) << "Requested GL implementation is not available.";
|
| - return false;
|
| - }
|
| - }
|
| - }
|
| -
|
| - bool gpu_service_logging = cmd->HasSwitch(switches::kEnableGPUServiceLogging);
|
| - bool disable_gl_drawing = cmd->HasSwitch(switches::kDisableGLDrawingForTests);
|
| -
|
| - return InitializeOneOffImplementation(
|
| - impl, fallback_to_osmesa, gpu_service_logging, disable_gl_drawing);
|
| -}
|
| -
|
| -// static
|
| -bool GLSurface::InitializeOneOffImplementation(GLImplementation impl,
|
| - bool fallback_to_osmesa,
|
| - bool gpu_service_logging,
|
| - bool disable_gl_drawing) {
|
| - bool initialized =
|
| - InitializeStaticGLBindings(impl) && InitializeOneOffInternal();
|
| - if (!initialized && fallback_to_osmesa) {
|
| - ClearGLBindings();
|
| - initialized = InitializeStaticGLBindings(kGLImplementationOSMesaGL) &&
|
| - InitializeOneOffInternal();
|
| - }
|
| - if (!initialized)
|
| - ClearGLBindings();
|
| -
|
| - if (initialized) {
|
| - DVLOG(1) << "Using "
|
| - << GetGLImplementationName(GetGLImplementation())
|
| - << " GL implementation.";
|
| - if (gpu_service_logging)
|
| - InitializeDebugGLBindings();
|
| - if (disable_gl_drawing)
|
| - InitializeNullDrawGLBindings();
|
| - }
|
| - return initialized;
|
| -}
|
| -
|
| GLSurface::GLSurface() {}
|
|
|
| bool GLSurface::Initialize() {
|
|
|