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 /gpu/command_buffer/service | |
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 'gpu/command_buffer/service')
-rw-r--r-- | gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc index c41777a..097d8cd 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc +++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc @@ -22,7 +22,6 @@ #include "testing/gtest/include/gtest/gtest.h" #include "ui/gl/gl_implementation.h" #include "ui/gl/gl_mock.h" -#include "ui/gl/gl_surface.h" using ::gfx::MockGLInterface; using ::testing::_; @@ -116,8 +115,9 @@ void GLES2DecoderTestBase::InitDecoderWithCommandLine( const CommandLine* command_line) { Framebuffer::ClearFramebufferCompleteComboMap(); + gfx::ClearGLBindings(); gfx::SetGLGetProcAddressProc(gfx::MockGLInterface::GetGLProcAddress); - gfx::GLSurface::InitializeOneOffWithMockBindingsForTests(); + gfx::InitializeStaticGLBindings(gfx::kGLImplementationMockGL); gl_.reset(new StrictMock<MockGLInterface>()); ::gfx::MockGLInterface::SetGLInterface(gl_.get()); @@ -289,7 +289,7 @@ void GLES2DecoderTestBase::InitDecoderWithCommandLine( context_->SetGLVersionString(gl_version); context_->MakeCurrent(surface_.get()); - gfx::GLSurface::InitializeDynamicMockBindingsForTests(context_); + gfx::InitializeDynamicGLBindings(gfx::kGLImplementationMockGL, context_); int32 attributes[] = { EGL_ALPHA_SIZE, request_alpha ? 8 : 0, |