Module: wine
Branch: stable
Commit: 3c49f0a67a6e2ff73f92dec06ec1bd3268a54baa
URL: http://source.winehq.org/git/wine.git/?a=commit;h=3c49f0a67a6e2ff73f92dec06…
Author: Rico Schüller <kgbricola(a)web.de>
Date: Fri Nov 1 18:18:19 2013 +0100
opengl32: Allow multiple extensions to support the same function.
This allows that gl functions are available for different extensions,
e.g. "glVertexP2ui" which is new GL_ARB_vertex_type_2_10_10_10_rev and
also in GL_VERSION_3_3. It is valid to get that function for each gl
version when GL_ARB_vertex_type_2_10_10_10_rev is in the extension list.
On the other hand that function is available, when the gl version is >= 3.3.
(cherry picked from commit 8a23fbf56fa9e0191fbcdfe942b9be18d74c6388)
---
dlls/opengl32/wgl.c | 53 ++++++++++++++++++++++++++++-----------------------
1 file changed, 29 insertions(+), 24 deletions(-)
diff --git a/dlls/opengl32/wgl.c b/dlls/opengl32/wgl.c
index 1317ff5..6735915 100644
--- a/dlls/opengl32/wgl.c
+++ b/dlls/opengl32/wgl.c
@@ -665,10 +665,8 @@ int WINAPI wglGetLayerPaletteEntries(HDC hdc,
}
/* check if the extension is present in the list */
-static BOOL has_extension( const char *list, const char *ext )
+static BOOL has_extension( const char *list, const char *ext, size_t len )
{
- size_t len = strlen( ext );
-
while (list)
{
while (*list == ' ') list++;
@@ -688,6 +686,7 @@ static BOOL is_extension_supported(const char* extension)
{
const struct opengl_funcs *funcs = NtCurrentTeb()->glTable;
const char *gl_ext_string = (const char*)glGetString(GL_EXTENSIONS);
+ size_t len;
TRACE("Checking for extension '%s'\n", extension);
@@ -702,30 +701,36 @@ static BOOL is_extension_supported(const char* extension)
* require the function to return NULL when an extension isn't found. For this reason we check
* if the OpenGL extension required for the function we are looking up is supported. */
- /* Check if the extension is part of the GL extension string to see if it is supported. */
- if (has_extension(gl_ext_string, extension))
- return TRUE;
-
- /* In general an OpenGL function starts as an ARB/EXT extension and at some stage
- * it becomes part of the core OpenGL library and can be reached without the ARB/EXT
- * suffix as well. In the extension table, these functions contain GL_VERSION_major_minor.
- * Check if we are searching for a core GL function */
- if(strncmp(extension, "GL_VERSION_", 11) == 0)
+ while ((len = strcspn(extension, " ")) != 0)
{
- const GLubyte *gl_version = funcs->gl.p_glGetString(GL_VERSION);
- const char *version = extension + 11; /* Move past 'GL_VERSION_' */
+ /* Check if the extension is part of the GL extension string to see if it is supported. */
+ if (has_extension(gl_ext_string, extension, len))
+ return TRUE;
- if(!gl_version) {
- ERR("No OpenGL version found!\n");
- return FALSE;
- }
+ /* In general an OpenGL function starts as an ARB/EXT extension and at some stage
+ * it becomes part of the core OpenGL library and can be reached without the ARB/EXT
+ * suffix as well. In the extension table, these functions contain GL_VERSION_major_minor.
+ * Check if we are searching for a core GL function */
+ if(strncmp(extension, "GL_VERSION_", 11) == 0)
+ {
+ const GLubyte *gl_version = funcs->gl.p_glGetString(GL_VERSION);
+ const char *version = extension + 11; /* Move past 'GL_VERSION_' */
- /* Compare the major/minor version numbers of the native OpenGL library and what is required by the function.
- * The gl_version string is guaranteed to have at least a major/minor and sometimes it has a release number as well. */
- if( (gl_version[0] >= version[0]) || ((gl_version[0] == version[0]) && (gl_version[2] >= version[2])) ) {
- return TRUE;
+ if(!gl_version) {
+ ERR("No OpenGL version found!\n");
+ return FALSE;
+ }
+
+ /* Compare the major/minor version numbers of the native OpenGL library and what is required by the function.
+ * The gl_version string is guaranteed to have at least a major/minor and sometimes it has a release number as well. */
+ if( (gl_version[0] >= version[0]) || ((gl_version[0] == version[0]) && (gl_version[2] >= version[2])) ) {
+ return TRUE;
+ }
+ WARN("The function requires OpenGL version '%c.%c' while your drivers only provide '%c.%c'\n", version[0], version[2], gl_version[0], gl_version[2]);
}
- WARN("The function requires OpenGL version '%c.%c' while your drivers only provide '%c.%c'\n", version[0], version[2], gl_version[0], gl_version[2]);
+
+ if (extension[len] == ' ') len++;
+ extension += len;
}
return FALSE;
@@ -1677,7 +1682,7 @@ static GLubyte *filter_extensions( const char *extensions )
if (!(end = strchr( extensions, ' ' ))) end = extensions + strlen( extensions );
memcpy( p, extensions, end - extensions );
p[end - extensions] = 0;
- if (!has_extension( disabled, p ))
+ if (!has_extension( disabled, p , strlen( p )))
{
TRACE("++ %s\n", p );
p += end - extensions;
Module: wine
Branch: stable
Commit: 23a717b298f8035e5afd511301bb5d2a074b19be
URL: http://source.winehq.org/git/wine.git/?a=commit;h=23a717b298f8035e5afd51130…
Author: Ken Thomases <ken(a)codeweavers.com>
Date: Wed Nov 6 06:58:42 2013 -0600
winemac: Fix search for clipboard format matching a pasteboard type so it can fail when it should.
It had been acting as though the last registered clipboard format always
matched any pasteboard type.
(cherry picked from commit 7c0c30b4d650d663770e0bbf683946005506bb8d)
---
dlls/winemac.drv/clipboard.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/dlls/winemac.drv/clipboard.c b/dlls/winemac.drv/clipboard.c
index ee63c10..5d765f4 100644
--- a/dlls/winemac.drv/clipboard.c
+++ b/dlls/winemac.drv/clipboard.c
@@ -367,6 +367,7 @@ static WINE_CLIPFORMAT* format_for_type(WINE_CLIPFORMAT *current, CFStringRef ty
}
}
+ format = NULL;
if (!current)
{
LPWSTR name;