summaryrefslogtreecommitdiffstats
path: root/cc/test/layer_tree_pixel_test.cc
diff options
context:
space:
mode:
authoroetuaho@nvidia.com <oetuaho@nvidia.com@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-17 21:31:00 +0000
committeroetuaho@nvidia.com <oetuaho@nvidia.com@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-17 21:31:00 +0000
commita37d7ff28cf1c56e1858abbf93d18ed227199d43 (patch)
treee132b417b5738510d4a9944130c64c9b8a58839b /cc/test/layer_tree_pixel_test.cc
parentc53c94738a7fe7dd596eae410561e5144de499f2 (diff)
downloadchromium_src-a37d7ff28cf1c56e1858abbf93d18ed227199d43.zip
chromium_src-a37d7ff28cf1c56e1858abbf93d18ed227199d43.tar.gz
chromium_src-a37d7ff28cf1c56e1858abbf93d18ed227199d43.tar.bz2
Take GL version and extensions correctly into account when binding functions
Platform libraries may return non-null function pointers from dlsym or getProcAddress for unsupported GL functions. Previously the function binding logic tried to address this with a separate extension function binding step, but since some of the bindings were still done without consulting the extension string, this failed to account for some conflicts between core and extension functions such as glDiscardFramebufferEXT vs. glInvalidateFramebuffer. Fix this by binding all functions that have multiple versions only after the context has been made current, and consulting the extension and version strings. The logic for binding each function is now only in one place in the generated code and easy to follow. The patch still does not guarantee that the function pointers would be set to null if the function is unsupported. It only attempts to guarantee that an incorrect version of a function is not bound in case another version is supported. The patch is conservative like this to avoid requiring the exact specification of binding conditions in case a function only has one name, and to make it less likely to expose bugs elsewhere. GetGLCoreProcAddress and GetGLProcAddress are combined into one function, which always first looks for the function pointer with dlsym and then with GetProcAddress. The new conditions for binding make sure that this does not result in errors. The patched bindings do not query for incorrect OES or ARB extension strings without the GL_ prefix. Including the incorrect extension strings without the prefix is assumed to have been a mistake. This applies to OES_get_program_binary, OES_vertex_array_object, ARB_get_program_binary, ARB_vertex_array_object, and APPLE_vertex_array_object. BUG=322489 TEST=gpu_unittests, cc_unittests, WebGL conformance tests Review URL: https://codereview.chromium.org/98643013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@245623 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/test/layer_tree_pixel_test.cc')
-rw-r--r--cc/test/layer_tree_pixel_test.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/cc/test/layer_tree_pixel_test.cc b/cc/test/layer_tree_pixel_test.cc
index fb54ce2..806b877 100644
--- a/cc/test/layer_tree_pixel_test.cc
+++ b/cc/test/layer_tree_pixel_test.cc
@@ -55,7 +55,7 @@ scoped_ptr<OutputSurface> LayerTreePixelTest::CreateOutputSurface(
case GL_WITH_DEFAULT:
case GL_WITH_BITMAP: {
- CHECK(gfx::InitializeGLBindings(gfx::kGLImplementationOSMesaGL));
+ CHECK(gfx::InitializeStaticGLBindings(gfx::kGLImplementationOSMesaGL));
output_surface = make_scoped_ptr(
new PixelTestOutputSurface(new TestInProcessContextProvider));
@@ -316,7 +316,7 @@ void LayerTreePixelTest::CopyBitmapToTextureMailboxAsTexture(
DCHECK_GT(bitmap.width(), 0);
DCHECK_GT(bitmap.height(), 0);
- CHECK(gfx::InitializeGLBindings(gfx::kGLImplementationOSMesaGL));
+ CHECK(gfx::InitializeStaticGLBindings(gfx::kGLImplementationOSMesaGL));
scoped_ptr<gpu::GLInProcessContext> context = CreateTestInProcessContext();
GLES2Interface* gl = context->GetImplementation();