summaryrefslogtreecommitdiff
path: root/cogl/cogl-framebuffer.c
diff options
context:
space:
mode:
authorNeil Roberts <neil@linux.intel.com>2012-01-24 16:24:26 +0000
committerNeil Roberts <neil@linux.intel.com>2012-01-27 17:18:32 +0000
commit139421de19171492fa5477961d291c98f21077bd (patch)
tree731feaac24c564da3e11ba12d1183be3d464c8c8 /cogl/cogl-framebuffer.c
parentc39333a2c6c007689c0f9a986dd060c2ff370c13 (diff)
downloadcogl-139421de19171492fa5477961d291c98f21077bd.tar.gz
object: Remove the type member of CoglObjectClass
Unlike in GObject the type number for a CoglObject is entirely an internal implementation detail so there is no need to make a GQuark to make it safe to export out of the library. Instead we can just directly use a fixed pointer address as the identifier for the type. This patch makes it use the address of the class struct of the identifier. This should make it faster to do type checks because it does not need to call a function every time it wants to get the type number. Reviewed-by: Robert Bragg <robert@linux.intel.com>
Diffstat (limited to 'cogl/cogl-framebuffer.c')
-rw-r--r--cogl/cogl-framebuffer.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/cogl/cogl-framebuffer.c b/cogl/cogl-framebuffer.c
index 829b5c2a..2e63681a 100644
--- a/cogl/cogl-framebuffer.c
+++ b/cogl/cogl-framebuffer.c
@@ -109,7 +109,7 @@ typedef struct _CoglFramebufferStackEntry
CoglFramebuffer *read_buffer;
} CoglFramebufferStackEntry;
-extern GQuark _cogl_object_onscreen_get_type (void);
+extern CoglObjectClass _cogl_onscreen_class;
static void _cogl_offscreen_free (CoglOffscreen *offscreen);
@@ -136,8 +136,8 @@ _cogl_is_framebuffer (void *object)
if (obj == NULL)
return FALSE;
- return obj->klass->type == _cogl_object_onscreen_get_type ()
- || obj->klass->type == _cogl_object_offscreen_get_type ();
+ return (obj->klass == &_cogl_onscreen_class ||
+ obj->klass == &_cogl_offscreen_class);
}
void