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 /ui | |
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 'ui')
-rw-r--r-- | ui/aura/bench/DEPS | 1 | ||||
-rw-r--r-- | ui/aura/bench/bench_main.cc | 4 | ||||
-rw-r--r-- | ui/aura/demo/DEPS | 3 | ||||
-rw-r--r-- | ui/aura/demo/demo_main.cc | 3 | ||||
-rw-r--r-- | ui/compositor/test/context_factories_for_test.cc | 7 | ||||
-rw-r--r-- | ui/compositor/test/default_context_factory.cc | 10 | ||||
-rw-r--r-- | ui/compositor/test/default_context_factory.h | 2 | ||||
-rw-r--r-- | ui/compositor/test/test_suite.cc | 4 | ||||
-rw-r--r-- | ui/gl/gl_bindings.h | 2 | ||||
-rw-r--r-- | ui/gl/gl_gl_api_implementation.cc | 19 | ||||
-rw-r--r-- | ui/gl/gl_implementation.h | 2 | ||||
-rw-r--r-- | ui/gl/gl_implementation_android.cc | 3 | ||||
-rw-r--r-- | ui/gl/gl_implementation_mac.cc | 3 | ||||
-rw-r--r-- | ui/gl/gl_implementation_ozone.cc | 3 | ||||
-rw-r--r-- | ui/gl/gl_implementation_win.cc | 3 | ||||
-rw-r--r-- | ui/gl/gl_implementation_x11.cc | 3 | ||||
-rw-r--r-- | ui/gl/gl_surface.cc | 88 | ||||
-rw-r--r-- | ui/gl/gl_surface.h | 12 | ||||
-rw-r--r-- | ui/gl/gl_surface_egl.cc | 16 | ||||
-rw-r--r-- | ui/keyboard/DEPS | 1 | ||||
-rw-r--r-- | ui/keyboard/test/run_all_unittests.cc | 2 | ||||
-rw-r--r-- | ui/views/examples/DEPS | 1 | ||||
-rw-r--r-- | ui/views/examples/examples_main.cc | 3 |
23 files changed, 47 insertions, 148 deletions
diff --git a/ui/aura/bench/DEPS b/ui/aura/bench/DEPS index 7fa58f9..319a251 100644 --- a/ui/aura/bench/DEPS +++ b/ui/aura/bench/DEPS @@ -3,5 +3,4 @@ include_rules = [ "-cc/surfaces", "+gpu/command_buffer/client/gles2_interface.h", "+third_party/khronos", - "+ui/gl/gl_surface.h", # To initialize GL bindings. ] diff --git a/ui/aura/bench/bench_main.cc b/ui/aura/bench/bench_main.cc index 58dbde9..077afd4 100644 --- a/ui/aura/bench/bench_main.cc +++ b/ui/aura/bench/bench_main.cc @@ -29,8 +29,6 @@ #include "ui/gfx/canvas.h" #include "ui/gfx/rect.h" #include "ui/gfx/skia_util.h" -#include "ui/gl/gl_surface.h" - #ifndef GL_GLEXT_PROTOTYPES #define GL_GLEXT_PROTOTYPES 1 #endif @@ -293,8 +291,6 @@ int main(int argc, char** argv) { base::AtExitManager exit_manager; - gfx::GLSurface::InitializeOneOff(); - // The ContextFactory must exist before any Compositors are created. bool allow_test_contexts = false; ui::InitializeContextFactoryForTests(allow_test_contexts); diff --git a/ui/aura/demo/DEPS b/ui/aura/demo/DEPS deleted file mode 100644 index 07d8243..0000000 --- a/ui/aura/demo/DEPS +++ /dev/null @@ -1,3 +0,0 @@ -include_rules = [ - "+ui/gl/gl_surface.h", # To initialize GL bindings. -] diff --git a/ui/aura/demo/demo_main.cc b/ui/aura/demo/demo_main.cc index 7739ed5..3dcd7db 100644 --- a/ui/aura/demo/demo_main.cc +++ b/ui/aura/demo/demo_main.cc @@ -21,7 +21,6 @@ #include "ui/events/event.h" #include "ui/gfx/canvas.h" #include "ui/gfx/rect.h" -#include "ui/gl/gl_surface.h" #if defined(USE_X11) #include "base/message_loop/message_pump_x11.h" @@ -109,8 +108,6 @@ int DemoMain() { // Create the message-loop here before creating the root window. base::MessageLoopForUI message_loop; - gfx::GLSurface::InitializeOneOff(); - // The ContextFactory must exist before any Compositors are created. bool allow_test_contexts = false; ui::InitializeContextFactoryForTests(allow_test_contexts); diff --git a/ui/compositor/test/context_factories_for_test.cc b/ui/compositor/test/context_factories_for_test.cc index b03fa34..795f56d 100644 --- a/ui/compositor/test/context_factories_for_test.cc +++ b/ui/compositor/test/context_factories_for_test.cc @@ -10,7 +10,6 @@ #include "ui/compositor/compositor_switches.h" #include "ui/compositor/test/default_context_factory.h" #include "ui/compositor/test/test_context_factory.h" -#include "ui/gl/gl_implementation.h" namespace ui { @@ -41,9 +40,11 @@ void InitializeContextFactoryForTests(bool allow_test_contexts) { if (use_test_contexts) { g_implicit_factory = new ui::TestContextFactory; } else { - DCHECK_NE(gfx::kGLImplementationNone, gfx::GetGLImplementation()); DVLOG(1) << "Using DefaultContextFactory"; - g_implicit_factory = new ui::DefaultContextFactory(); + scoped_ptr<ui::DefaultContextFactory> instance( + new ui::DefaultContextFactory()); + if (instance->Initialize()) + g_implicit_factory = instance.release(); } ContextFactory::SetInstance(g_implicit_factory); } diff --git a/ui/compositor/test/default_context_factory.cc b/ui/compositor/test/default_context_factory.cc index 21c004d..4839e1f1 100644 --- a/ui/compositor/test/default_context_factory.cc +++ b/ui/compositor/test/default_context_factory.cc @@ -15,12 +15,20 @@ namespace ui { DefaultContextFactory::DefaultContextFactory() { - DCHECK_NE(gfx::GetGLImplementation(), gfx::kGLImplementationNone); } DefaultContextFactory::~DefaultContextFactory() { } +bool DefaultContextFactory::Initialize() { + if (!gfx::GLSurface::InitializeOneOff() || + gfx::GetGLImplementation() == gfx::kGLImplementationNone) { + LOG(ERROR) << "Could not load the GL bindings"; + return false; + } + return true; +} + scoped_ptr<cc::OutputSurface> DefaultContextFactory::CreateOutputSurface( Compositor* compositor, bool software_fallback) { DCHECK(!software_fallback); diff --git a/ui/compositor/test/default_context_factory.h b/ui/compositor/test/default_context_factory.h index f377f2f..7b8501b 100644 --- a/ui/compositor/test/default_context_factory.h +++ b/ui/compositor/test/default_context_factory.h @@ -37,6 +37,8 @@ class DefaultContextFactory : public ContextFactory { virtual void RemoveCompositor(Compositor* compositor) OVERRIDE; virtual bool DoesCreateTestContexts() OVERRIDE; + bool Initialize(); + private: scoped_refptr<webkit::gpu::ContextProviderInProcess> offscreen_compositor_contexts_; diff --git a/ui/compositor/test/test_suite.cc b/ui/compositor/test/test_suite.cc index 18b4060..aa21ece 100644 --- a/ui/compositor/test/test_suite.cc +++ b/ui/compositor/test/test_suite.cc @@ -9,7 +9,7 @@ #include "ui/compositor/compositor.h" #include "ui/compositor/compositor_switches.h" #include "ui/gfx/gfx_paths.h" -#include "ui/gl/gl_surface.h" +#include "ui/gl/gl_implementation.h" #if defined(USE_X11) #include <X11/Xlib.h> @@ -31,8 +31,8 @@ void CompositorTestSuite::Initialize() { #if defined(USE_X11) XInitThreads(); #endif + CHECK(gfx::InitializeStaticGLBindings(gfx::kGLImplementationOSMesaGL)); base::TestSuite::Initialize(); - gfx::GLSurface::InitializeOneOffForTests(); gfx::RegisterPathProvider(); diff --git a/ui/gl/gl_bindings.h b/ui/gl/gl_bindings.h index 510596a..74e20fe 100644 --- a/ui/gl/gl_bindings.h +++ b/ui/gl/gl_bindings.h @@ -225,8 +225,6 @@ typedef uint64 EGLuint64CHROMIUM; namespace gfx { struct GL_EXPORT DriverGL { - DriverGL(); - void InitializeStaticBindings(); void InitializeCustomDynamicBindings(GLContext* context); void InitializeDebugBindings(); diff --git a/ui/gl/gl_gl_api_implementation.cc b/ui/gl/gl_gl_api_implementation.cc index 1f9a06d..ce8a711 100644 --- a/ui/gl/gl_gl_api_implementation.cc +++ b/ui/gl/gl_gl_api_implementation.cc @@ -146,35 +146,18 @@ static void GL_BINDING_CALL CustomRenderbufferStorageMultisampleEXT( } // anonymous namespace -DriverGL::DriverGL() { ClearBindings(); } - void DriverGL::InitializeCustomDynamicBindings(GLContext* context) { InitializeDynamicBindings(context); - - DCHECK(orig_fn.glTexImage2DFn == NULL); - orig_fn.glTexImage2DFn = fn.glTexImage2DFn; + orig_fn = fn; fn.glTexImage2DFn = reinterpret_cast<glTexImage2DProc>(CustomTexImage2D); - - DCHECK(orig_fn.glTexSubImage2DFn == NULL); - orig_fn.glTexSubImage2DFn = fn.glTexSubImage2DFn; fn.glTexSubImage2DFn = reinterpret_cast<glTexSubImage2DProc>(CustomTexSubImage2D); - - DCHECK(orig_fn.glTexStorage2DEXTFn == NULL); - orig_fn.glTexStorage2DEXTFn = fn.glTexStorage2DEXTFn; fn.glTexStorage2DEXTFn = reinterpret_cast<glTexStorage2DEXTProc>(CustomTexStorage2DEXT); - - DCHECK(orig_fn.glRenderbufferStorageEXTFn == NULL); - orig_fn.glRenderbufferStorageEXTFn = fn.glRenderbufferStorageEXTFn; fn.glRenderbufferStorageEXTFn = reinterpret_cast<glRenderbufferStorageEXTProc>( CustomRenderbufferStorageEXT); - - DCHECK(orig_fn.glRenderbufferStorageMultisampleEXTFn == NULL); - orig_fn.glRenderbufferStorageMultisampleEXTFn = - fn.glRenderbufferStorageMultisampleEXTFn; fn.glRenderbufferStorageMultisampleEXTFn = reinterpret_cast<glRenderbufferStorageMultisampleEXTProc>( CustomRenderbufferStorageMultisampleEXT); diff --git a/ui/gl/gl_implementation.h b/ui/gl/gl_implementation.h index 0881e10..628fc1f 100644 --- a/ui/gl/gl_implementation.h +++ b/ui/gl/gl_implementation.h @@ -47,7 +47,7 @@ GL_EXPORT bool InitializeStaticGLBindings(GLImplementation implementation); // Initialize function bindings that depend on the context for a GL // implementation. GL_EXPORT bool InitializeDynamicGLBindings(GLImplementation implementation, - GLContext* context); + GLContext* context); // Initialize Debug logging wrappers for GL bindings. void InitializeDebugGLBindings(); diff --git a/ui/gl/gl_implementation_android.cc b/ui/gl/gl_implementation_android.cc index 190f669..31fec9a 100644 --- a/ui/gl/gl_implementation_android.cc +++ b/ui/gl/gl_implementation_android.cc @@ -52,7 +52,8 @@ bool InitializeStaticGLBindings(GLImplementation implementation) { // Prevent reinitialization with a different implementation. Once the gpu // unit tests have initialized with kGLImplementationMock, we don't want to // later switch to another GL implementation. - DCHECK_EQ(kGLImplementationNone, GetGLImplementation()); + if (GetGLImplementation() != kGLImplementationNone) + return true; switch (implementation) { case kGLImplementationEGLGLES2: { diff --git a/ui/gl/gl_implementation_mac.cc b/ui/gl/gl_implementation_mac.cc index 1011406..546a082f 100644 --- a/ui/gl/gl_implementation_mac.cc +++ b/ui/gl/gl_implementation_mac.cc @@ -31,7 +31,8 @@ bool InitializeStaticGLBindings(GLImplementation implementation) { // Prevent reinitialization with a different implementation. Once the gpu // unit tests have initialized with kGLImplementationMock, we don't want to // later switch to another GL implementation. - DCHECK_EQ(kGLImplementationNone, GetGLImplementation()); + if (GetGLImplementation() != kGLImplementationNone) + return true; // Allow the main thread or another to initialize these bindings // after instituting restrictions on I/O. Going forward they will diff --git a/ui/gl/gl_implementation_ozone.cc b/ui/gl/gl_implementation_ozone.cc index b8dd2c4..3659a02 100644 --- a/ui/gl/gl_implementation_ozone.cc +++ b/ui/gl/gl_implementation_ozone.cc @@ -37,7 +37,8 @@ bool InitializeStaticGLBindings(GLImplementation implementation) { // Prevent reinitialization with a different implementation. Once the gpu // unit tests have initialized with kGLImplementationMock, we don't want to // later switch to another GL implementation. - DCHECK_EQ(kGLImplementationNone, GetGLImplementation()); + if (GetGLImplementation() != kGLImplementationNone) + return true; switch (implementation) { case kGLImplementationOSMesaGL: diff --git a/ui/gl/gl_implementation_win.cc b/ui/gl/gl_implementation_win.cc index 5269297..ddc9c57 100644 --- a/ui/gl/gl_implementation_win.cc +++ b/ui/gl/gl_implementation_win.cc @@ -112,7 +112,8 @@ bool InitializeStaticGLBindings(GLImplementation implementation) { // Prevent reinitialization with a different implementation. Once the gpu // unit tests have initialized with kGLImplementationMock, we don't want to // later switch to another GL implementation. - DCHECK_EQ(kGLImplementationNone, GetGLImplementation()); + if (GetGLImplementation() != kGLImplementationNone) + return true; // Allow the main thread or another to initialize these bindings // after instituting restrictions on I/O. Going forward they will diff --git a/ui/gl/gl_implementation_x11.cc b/ui/gl/gl_implementation_x11.cc index c19b39e..7588a37 100644 --- a/ui/gl/gl_implementation_x11.cc +++ b/ui/gl/gl_implementation_x11.cc @@ -43,7 +43,8 @@ bool InitializeStaticGLBindings(GLImplementation implementation) { // Prevent reinitialization with a different implementation. Once the gpu // unit tests have initialized with kGLImplementationMock, we don't want to // later switch to another GL implementation. - DCHECK_EQ(kGLImplementationNone, GetGLImplementation()); + if (GetGLImplementation() != kGLImplementationNone) + return true; // Allow the main thread or another to initialize these bindings // after instituting restrictions on I/O. Going forward they will diff --git a/ui/gl/gl_surface.cc b/ui/gl/gl_surface.cc index e9c7ce9..a52a3f7 100644 --- a/ui/gl/gl_surface.cc +++ b/ui/gl/gl_surface.cc @@ -14,7 +14,6 @@ #include "base/threading/thread_local.h" #include "ui/gl/gl_context.h" #include "ui/gl/gl_implementation.h" -#include "ui/gl/gl_switches.h" namespace gfx { @@ -25,7 +24,9 @@ base::LazyInstance<base::ThreadLocalPointer<GLSurface> >::Leaky // static bool GLSurface::InitializeOneOff() { - DCHECK_EQ(kGLImplementationNone, GetGLImplementation()); + static bool initialized = false; + if (initialized) + return true; TRACE_EVENT0("gpu", "GLSurface::InitializeOneOff"); @@ -33,14 +34,12 @@ bool GLSurface::InitializeOneOff() { GetAllowedGLImplementations(&allowed_impls); DCHECK(!allowed_impls.empty()); - CommandLine* cmd = 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::kUseGL)) { + if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kUseGL)) { std::string requested_implementation_name = - cmd->GetSwitchValueASCII(switches::kUseGL); + CommandLine::ForCurrentProcess()->GetSwitchValueASCII(switches::kUseGL); if (requested_implementation_name == "any") { fallback_to_osmesa = true; } else if (requested_implementation_name == "swiftshader") { @@ -56,94 +55,27 @@ bool GLSurface::InitializeOneOff() { } } - 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(); + 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) + if (CommandLine::ForCurrentProcess()->HasSwitch( + switches::kEnableGPUServiceLogging)) InitializeDebugGLBindings(); - if (disable_gl_drawing) + if (CommandLine::ForCurrentProcess()->HasSwitch( + switches::kDisableGLDrawingForTests)) InitializeNullDrawGLBindings(); } return initialized; } -// static -void GLSurface::InitializeOneOffForTests() { - bool use_osmesa = true; - -#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(!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 = false; - // TODO(danakj): Unit tests do not produce pixel output by default. - // bool disable_gl_drawing = true; - - CHECK(InitializeOneOffImplementation( - impl, fallback_to_osmesa, gpu_service_logging, disable_gl_drawing)); -} - -// static -void GLSurface::InitializeOneOffWithMockBindingsForTests() { - DCHECK(!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() { diff --git a/ui/gl/gl_surface.h b/ui/gl/gl_surface.h index f7a02f0..8eaf60d 100644 --- a/ui/gl/gl_surface.h +++ b/ui/gl/gl_surface.h @@ -12,7 +12,6 @@ #include "ui/gfx/native_widget_types.h" #include "ui/gfx/size.h" #include "ui/gl/gl_export.h" -#include "ui/gl/gl_implementation.h" namespace gfx { @@ -70,15 +69,8 @@ class GL_EXPORT GLSurface : public base::RefCounted<GLSurface> { // Copy part of the backbuffer to the frontbuffer. virtual bool PostSubBuffer(int x, int y, int width, int height); - // Initialize GL bindings. static bool InitializeOneOff(); - // Unit tests should call these instead of InitializeOneOff() to set up - // GL bindings appropriate for tests. - static void InitializeOneOffForTests(); - static void InitializeOneOffWithMockBindingsForTests(); - static void InitializeDynamicMockBindingsForTests(GLContext* context); - // Called after a context is made current with this surface. Returns false // on error. virtual bool OnMakeCurrent(GLContext* context); @@ -117,10 +109,6 @@ class GL_EXPORT GLSurface : public base::RefCounted<GLSurface> { protected: virtual ~GLSurface(); - static bool InitializeOneOffImplementation(GLImplementation impl, - bool fallback_to_osmesa, - bool gpu_service_logging, - bool disable_gl_drawing); static bool InitializeOneOffInternal(); static void SetCurrent(GLSurface* surface); diff --git a/ui/gl/gl_surface_egl.cc b/ui/gl/gl_surface_egl.cc index 635595c..0db2fc7 100644 --- a/ui/gl/gl_surface_egl.cc +++ b/ui/gl/gl_surface_egl.cc @@ -784,14 +784,14 @@ GLSurfaceOSMesaHeadless::~GLSurfaceOSMesaHeadless() { Destroy(); } // static bool GLSurface::InitializeOneOffInternal() { - switch (GetGLImplementation()) { - case kGLImplementationEGLGLES2: - if (!GLSurfaceEGL::InitializeOneOff()) { - LOG(ERROR) << "GLSurfaceEGL::InitializeOneOff failed."; - return false; - } - default: - break; + if (GetGLImplementation() == kGLImplementationOSMesaGL) { + return true; + } + DCHECK(GetGLImplementation() == kGLImplementationEGLGLES2); + + if (!GLSurfaceEGL::InitializeOneOff()) { + LOG(ERROR) << "GLSurfaceEGL::InitializeOneOff failed."; + return false; } return true; } diff --git a/ui/keyboard/DEPS b/ui/keyboard/DEPS index ec5b911..defb61d 100644 --- a/ui/keyboard/DEPS +++ b/ui/keyboard/DEPS @@ -6,7 +6,6 @@ include_rules = [ "+ui/base", "+ui/compositor", "+ui/gfx", - "+ui/gl/gl_surface.h", # To initialize GL for tests. "+ui/test", "+ui/wm", ] diff --git a/ui/keyboard/test/run_all_unittests.cc b/ui/keyboard/test/run_all_unittests.cc index d5e5bc0..e95dcbe 100644 --- a/ui/keyboard/test/run_all_unittests.cc +++ b/ui/keyboard/test/run_all_unittests.cc @@ -10,7 +10,6 @@ #include "base/test/test_suite.h" #include "ui/base/resource/resource_bundle.h" #include "ui/base/ui_base_paths.h" -#include "ui/gl/gl_surface.h" namespace { @@ -21,7 +20,6 @@ class KeyboardTestSuite : public base::TestSuite { protected: virtual void Initialize() OVERRIDE { base::TestSuite::Initialize(); - gfx::GLSurface::InitializeOneOffForTests(); ui::RegisterPathProvider(); base::FilePath pak_dir; diff --git a/ui/views/examples/DEPS b/ui/views/examples/DEPS index 44d965d..1108a45 100644 --- a/ui/views/examples/DEPS +++ b/ui/views/examples/DEPS @@ -2,5 +2,4 @@ include_rules = [ "+content/public", "+content/shell", "+sandbox", - "+ui/gl/gl_surface.h", # To initialize GL bindings. ] diff --git a/ui/views/examples/examples_main.cc b/ui/views/examples/examples_main.cc index 53a206f..62a6405 100644 --- a/ui/views/examples/examples_main.cc +++ b/ui/views/examples/examples_main.cc @@ -14,7 +14,6 @@ #include "ui/base/resource/resource_bundle.h" #include "ui/compositor/test/context_factories_for_test.h" #include "ui/gfx/screen.h" -#include "ui/gl/gl_surface.h" #include "ui/views/corewm/wm_state.h" #include "ui/views/examples/example_base.h" #include "ui/views/examples/examples_window.h" @@ -47,8 +46,6 @@ int main(int argc, char** argv) { ui::ResourceBundle::InitSharedInstanceWithPakPath(pak_file); - gfx::GLSurface::InitializeOneOff(); - // The ContextFactory must exist before any Compositors are created. bool allow_test_contexts = false; ui::InitializeContextFactoryForTests(allow_test_contexts); |