From 639716736f5d87b64a43a20f39f37dee6bd98806 Mon Sep 17 00:00:00 2001 From: Mathias Agopian Date: Mon, 25 Oct 2010 15:51:24 -0700 Subject: [PATCH] fix eglChooseConfig() for special attributes. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit affects software renderer (emu) only. per EGL spec: If EGL_MAX_PBUFFER_WIDTH, EGL_MAX_PBUFFER_HEIGHT, EGL_MAX_PBUFFER_PIXELS, or EGL_NATIVE_VISUAL_ID are speciļ¬ed in attrib list, then they are ignored Change-Id: I3d5214ce896986da2f11d2eb1889afc41731eaa6 --- opengl/libagl/egl.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/opengl/libagl/egl.cpp b/opengl/libagl/egl.cpp index ba33e17c1..662a1fa77 100644 --- a/opengl/libagl/egl.cpp +++ b/opengl/libagl/egl.cpp @@ -833,6 +833,9 @@ struct config_management_t { static bool mask(GLint reqValue, GLint confValue) { return (confValue & reqValue) == reqValue; } + static bool ignore(GLint reqValue, GLint confValue) { + return true; + } }; // ---------------------------------------------------------------------------- @@ -1060,11 +1063,11 @@ static config_management_t const gConfigManagement[] = { { EGL_CONFIG_CAVEAT, config_management_t::exact }, { EGL_CONFIG_ID, config_management_t::exact }, { EGL_LEVEL, config_management_t::exact }, - { EGL_MAX_PBUFFER_HEIGHT, config_management_t::exact }, - { EGL_MAX_PBUFFER_PIXELS, config_management_t::exact }, - { EGL_MAX_PBUFFER_WIDTH, config_management_t::exact }, + { EGL_MAX_PBUFFER_HEIGHT, config_management_t::ignore }, + { EGL_MAX_PBUFFER_PIXELS, config_management_t::ignore }, + { EGL_MAX_PBUFFER_WIDTH, config_management_t::ignore }, { EGL_NATIVE_RENDERABLE, config_management_t::exact }, - { EGL_NATIVE_VISUAL_ID, config_management_t::exact }, + { EGL_NATIVE_VISUAL_ID, config_management_t::ignore }, { EGL_NATIVE_VISUAL_TYPE, config_management_t::exact }, { EGL_SAMPLES, config_management_t::exact }, { EGL_SAMPLE_BUFFERS, config_management_t::exact },