Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions cogl/cogl/cogl-feature-private.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ _cogl_feature_check (CoglRenderer *renderer,
const char *suffix = NULL;
int func_num;
CoglExtGlesAvailability gles_availability = 0;
gboolean in_core;

switch (driver)
{
Expand All @@ -79,7 +78,6 @@ _cogl_feature_check (CoglRenderer *renderer,
(data->gles_availability & gles_availability))
{
suffix = "";
in_core = TRUE;
}
else
{
Expand Down Expand Up @@ -132,8 +130,6 @@ _cogl_feature_check (CoglRenderer *renderer,
break;
}
}

in_core = FALSE;
}

/* If we couldn't find anything that provides the functions then
Expand All @@ -150,8 +146,7 @@ _cogl_feature_check (CoglRenderer *renderer,
full_function_name = g_strconcat (data->functions[func_num].name,
suffix, NULL);
func = _cogl_renderer_get_proc_address (renderer,
full_function_name,
in_core);
full_function_name);
g_free (full_function_name);

if (func == NULL)
Expand Down
3 changes: 1 addition & 2 deletions cogl/cogl/cogl-renderer-private.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ _cogl_renderer_remove_native_filter (CoglRenderer *renderer,

void *
_cogl_renderer_get_proc_address (CoglRenderer *renderer,
const char *name,
gboolean in_core);
const char *name);

#endif /* __COGL_RENDERER_PRIVATE_H */
5 changes: 2 additions & 3 deletions cogl/cogl/cogl-renderer.c
Original file line number Diff line number Diff line change
Expand Up @@ -701,12 +701,11 @@ cogl_renderer_get_winsys_id (CoglRenderer *renderer)

void *
_cogl_renderer_get_proc_address (CoglRenderer *renderer,
const char *name,
gboolean in_core)
const char *name)
{
const CoglWinsysVtable *winsys = _cogl_renderer_get_winsys (renderer);

return winsys->renderer_get_proc_address (renderer, name, in_core);
return winsys->renderer_get_proc_address (renderer, name);
}

void
Expand Down
2 changes: 1 addition & 1 deletion cogl/cogl/cogl.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ cogl_get_proc_address (const char* name)
{
_COGL_GET_CONTEXT (ctx, NULL);

return _cogl_renderer_get_proc_address (ctx->display->renderer, name, FALSE);
return _cogl_renderer_get_proc_address (ctx->display->renderer, name);
}

gboolean
Expand Down
9 changes: 3 additions & 6 deletions cogl/cogl/driver/gl/gl/cogl-driver-gl.c
Original file line number Diff line number Diff line change
Expand Up @@ -383,16 +383,13 @@ _cogl_driver_update_features (CoglContext *ctx,
we can expect */
ctx->glGetString =
(void *) _cogl_renderer_get_proc_address (ctx->display->renderer,
"glGetString",
TRUE);
"glGetString");
ctx->glGetStringi =
(void *) _cogl_renderer_get_proc_address (ctx->display->renderer,
"glGetStringi",
TRUE);
"glGetStringi");
ctx->glGetIntegerv =
(void *) _cogl_renderer_get_proc_address (ctx->display->renderer,
"glGetIntegerv",
TRUE);
"glGetIntegerv");

gl_extensions = _cogl_context_get_gl_extensions (ctx);

Expand Down
6 changes: 2 additions & 4 deletions cogl/cogl/driver/gl/gles/cogl-driver-gles.c
Original file line number Diff line number Diff line change
Expand Up @@ -251,12 +251,10 @@ _cogl_driver_update_features (CoglContext *context,
can expect */
context->glGetString =
(void *) _cogl_renderer_get_proc_address (context->display->renderer,
"glGetString",
TRUE);
"glGetString");
context->glGetStringi =
(void *) _cogl_renderer_get_proc_address (context->display->renderer,
"glGetStringi",
TRUE);
"glGetStringi");

gl_extensions = _cogl_context_get_gl_extensions (context);

Expand Down
16 changes: 5 additions & 11 deletions cogl/cogl/winsys/cogl-winsys-egl.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,20 +112,14 @@ static const CoglFeatureData winsys_feature_data[] =

static GCallback
_cogl_winsys_renderer_get_proc_address (CoglRenderer *renderer,
const char *name,
gboolean in_core)
const char *name)
{
void *ptr = NULL;
GCallback result = eglGetProcAddress (name);

if (!in_core)
ptr = eglGetProcAddress (name);
if (result == NULL)
g_module_symbol (renderer->libgl_module, name, (gpointer *)&result);

/* eglGetProcAddress doesn't support fetching core API so we need to
get that separately with GModule */
if (ptr == NULL)
g_module_symbol (renderer->libgl_module, name, &ptr);

return ptr;
return result;
}

static void
Expand Down
7 changes: 1 addition & 6 deletions cogl/cogl/winsys/cogl-winsys-glx.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,15 +156,10 @@ static const CoglFeatureData winsys_feature_data[] =

static GCallback
_cogl_winsys_renderer_get_proc_address (CoglRenderer *renderer,
const char *name,
gboolean in_core)
const char *name)
{
CoglGLXRenderer *glx_renderer = renderer->winsys;

/* The GLX_ARB_get_proc_address extension documents that this should
* work for core functions too so we don't need to do anything
* special with in_core */

return glx_renderer->glXGetProcAddress ((const GLubyte *) name);
}

Expand Down
3 changes: 1 addition & 2 deletions cogl/cogl/winsys/cogl-winsys-private.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@ typedef struct _CoglWinsysVtable

GCallback
(*renderer_get_proc_address) (CoglRenderer *renderer,
const char *name,
gboolean in_core);
const char *name);

gboolean
(*renderer_connect) (CoglRenderer *renderer, GError **error);
Expand Down
Loading