diff options
author | Jasper St. Pierre <jstpierre@mecheye.net> | 2013-02-12 17:55:45 -0500 |
---|---|---|
committer | Neil Roberts <neil@linux.intel.com> | 2013-02-13 18:41:25 +0000 |
commit | 567f049d20554bb8ea4e40fa5e72a9fd0bbd409e (patch) | |
tree | 9b83b1da160c7ab4bc14b155ad6cc2ded2e11c9a | |
parent | 37c390a5b33d4f65ff6c834e9be2f8de716635ee (diff) | |
download | cogl-567f049d20554bb8ea4e40fa5e72a9fd0bbd409e.tar.gz |
cogl-texture: Make the list of registered types global, not per-context
If we make this per-context and create two Cogl contexts, some types
won't re-register, and we'll be in a broken state where some types will
be considered not to be texture types.
https://bugzilla.gnome.org/show_bug.cgi?id=693696
Reviewed-by: Neil Roberts <neil@linux.intel.com>
-rw-r--r-- | cogl/cogl-context-private.h | 4 | ||||
-rw-r--r-- | cogl/cogl-context.c | 4 | ||||
-rw-r--r-- | cogl/cogl-texture.c | 10 |
3 files changed, 4 insertions, 14 deletions
diff --git a/cogl/cogl-context-private.h b/cogl/cogl-context-private.h index fc528e7d..5d7aacdc 100644 --- a/cogl/cogl-context-private.h +++ b/cogl/cogl-context-private.h @@ -214,10 +214,6 @@ struct _CoglContext CoglBool current_gl_dither_enabled; CoglColorMask current_gl_color_mask; - /* List of types that will be considered a subclass of CoglTexture in - cogl_is_texture */ - GSList *texture_types; - /* Clipping */ /* TRUE if we have a valid clipping stack flushed. In that case current_clip_stack will describe what the current state is. If diff --git a/cogl/cogl-context.c b/cogl/cogl-context.c index 11779f99..003940a6 100644 --- a/cogl/cogl-context.c +++ b/cogl/cogl-context.c @@ -167,8 +167,6 @@ cogl_context_new (CoglDisplay *display, memset (context->features, 0, sizeof (context->features)); context->private_feature_flags = 0; - context->texture_types = NULL; - context->rectangle_state = COGL_WINSYS_RECTANGLE_STATE_UNKNOWN; memset (context->winsys_features, 0, sizeof (context->winsys_features)); @@ -492,8 +490,6 @@ _cogl_context_free (CoglContext *context) _cogl_bitmask_destroy (&context->enable_custom_attributes_tmp); _cogl_bitmask_destroy (&context->changed_bits_tmp); - g_slist_free (context->texture_types); - if (context->current_modelview_entry) cogl_matrix_entry_unref (context->current_modelview_entry); if (context->current_projection_entry) diff --git a/cogl/cogl-texture.c b/cogl/cogl-texture.c index 4c8e718a..2c7dc5e1 100644 --- a/cogl/cogl-texture.c +++ b/cogl/cogl-texture.c @@ -76,12 +76,12 @@ cogl_texture_error_domain (void) * abstract class manually. */ +static GSList *_cogl_texture_types; + void _cogl_texture_register_texture_type (const CoglObjectClass *klass) { - _COGL_GET_CONTEXT (ctxt, NO_RETVAL); - - ctxt->texture_types = g_slist_prepend (ctxt->texture_types, (void *) klass); + _cogl_texture_types = g_slist_prepend (_cogl_texture_types, (void *) klass); } CoglBool @@ -90,12 +90,10 @@ cogl_is_texture (void *object) CoglObject *obj = (CoglObject *)object; GSList *l; - _COGL_GET_CONTEXT (ctxt, FALSE); - if (object == NULL) return FALSE; - for (l = ctxt->texture_types; l; l = l->next) + for (l = _cogl_texture_types; l; l = l->next) if (l->data == obj->klass) return TRUE; |