[cogl/wip/cogl-1.14: 41/50] fix: attribute: Split out GL specific code



commit f5c1da88697fbb59a7c491b52d8138c7149aece5
Author: Robert Bragg <robert linux intel com>
Date:   Fri Jan 4 20:08:13 2013 +0000

    fix: attribute: Split out GL specific code

 cogl/cogl.c                                |    3 ++-
 cogl/driver/gl/cogl-attribute-gl-private.h |    3 +++
 cogl/driver/gl/cogl-attribute-gl.c         |   13 +++++++++++++
 3 files changed, 18 insertions(+), 1 deletions(-)
---
diff --git a/cogl/cogl.c b/cogl/cogl.c
index 5ccfcfb..998a478 100644
--- a/cogl/cogl.c
+++ b/cogl/cogl.c
@@ -50,6 +50,7 @@
 #include "cogl-private.h"
 #include "cogl1-context.h"
 #include "cogl-offscreen.h"
+#include "cogl-attribute-gl-private.h"
 
 #ifdef COGL_GL_DEBUG
 /* GL error to string conversion */
@@ -446,7 +447,7 @@ cogl_begin_gl (void)
                                  cogl_pipeline_get_n_layers (pipeline));
 
   /* Disable any cached vertex arrays */
-  _cogl_attribute_disable_cached_arrays ();
+  _cogl_gl_disable_all_attributes (ctx);
 }
 
 void
diff --git a/cogl/driver/gl/cogl-attribute-gl-private.h b/cogl/driver/gl/cogl-attribute-gl-private.h
index 405e43d..752f603 100644
--- a/cogl/driver/gl/cogl-attribute-gl-private.h
+++ b/cogl/driver/gl/cogl-attribute-gl-private.h
@@ -41,4 +41,7 @@ _cogl_gl_flush_attributes_state (CoglFramebuffer *framebuffer,
                                  CoglAttribute **attributes,
                                  int n_attributes);
 
+void
+_cogl_gl_disable_all_attributes (CoglContext *ctx);
+
 #endif /* _COGL_ATTRIBUTE_GL_PRIVATE_H_ */
diff --git a/cogl/driver/gl/cogl-attribute-gl.c b/cogl/driver/gl/cogl-attribute-gl.c
index 5435adb..3b9a475 100644
--- a/cogl/driver/gl/cogl-attribute-gl.c
+++ b/cogl/driver/gl/cogl-attribute-gl.c
@@ -397,3 +397,16 @@ _cogl_gl_flush_attributes_state (CoglFramebuffer *framebuffer,
   if (copy)
     cogl_object_unref (copy);
 }
+
+void
+_cogl_gl_disable_all_attributes (CoglContext *ctx)
+{
+  _cogl_bitmask_clear_all (&ctx->enable_builtin_attributes_tmp);
+  _cogl_bitmask_clear_all (&ctx->enable_texcoord_attributes_tmp);
+  _cogl_bitmask_clear_all (&ctx->enable_custom_attributes_tmp);
+
+  /* XXX: we can pass a NULL source pipeline here because we know a
+   * source pipeline only needs to be referenced when enabling
+   * attributes. */
+  apply_attribute_enable_updates (ctx, NULL);
+}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]