[Cogl] [PATCH 2/2] cogl: Don't expose longs in the API (2/2)

Damien Lespiau damien.lespiau at gmail.com
Sat Sep 29 18:39:57 PDT 2012


From: Damien Lespiau <damien.lespiau at intel.com>

This time, it's the clear and discard methods on framebuffers that
wanted an unsigned long to describe the list of buffers to act on.

Let's replace the unsigned long by the dedicated enum, CoglBufferBit.
---
 cogl/cogl-framebuffer-private.h |    2 +-
 cogl/cogl-framebuffer.c         |    8 ++++----
 cogl/cogl-framebuffer.h         |    6 +++---
 cogl/cogl-types.h               |    6 +++---
 4 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/cogl/cogl-framebuffer-private.h b/cogl/cogl-framebuffer-private.h
index d2c2c36..429ed38 100644
--- a/cogl/cogl-framebuffer-private.h
+++ b/cogl/cogl-framebuffer-private.h
@@ -217,7 +217,7 @@ _cogl_framebuffer_get_winsys (CoglFramebuffer *framebuffer);
 
 void
 _cogl_framebuffer_clear_without_flush4f (CoglFramebuffer *framebuffer,
-                                         unsigned long buffers,
+                                         CoglBufferBit buffers,
                                          float red,
                                          float green,
                                          float blue,
diff --git a/cogl/cogl-framebuffer.c b/cogl/cogl-framebuffer.c
index 41f5d18..b9c92a9 100644
--- a/cogl/cogl-framebuffer.c
+++ b/cogl/cogl-framebuffer.c
@@ -198,7 +198,7 @@ _cogl_framebuffer_get_winsys (CoglFramebuffer *framebuffer)
  * the journal */
 void
 _cogl_framebuffer_clear_without_flush4f (CoglFramebuffer *framebuffer,
-                                         unsigned long buffers,
+                                         CoglBufferBit buffers,
                                          float red,
                                          float green,
                                          float blue,
@@ -232,7 +232,7 @@ _cogl_framebuffer_dirty (CoglFramebuffer *framebuffer)
 
 void
 cogl_framebuffer_clear4f (CoglFramebuffer *framebuffer,
-                          unsigned long buffers,
+                          CoglBufferBit buffers,
                           float red,
                           float green,
                           float blue,
@@ -391,7 +391,7 @@ cleared:
  */
 void
 cogl_framebuffer_clear (CoglFramebuffer *framebuffer,
-                        unsigned long buffers,
+                        CoglBufferBit buffers,
                         const CoglColor *color)
 {
   cogl_framebuffer_clear4f (framebuffer, buffers,
@@ -1782,7 +1782,7 @@ _cogl_blit_framebuffer (unsigned int src_x,
 
 void
 cogl_framebuffer_discard_buffers (CoglFramebuffer *framebuffer,
-                                  unsigned long buffers)
+                                  CoglBufferBit buffers)
 {
   CoglContext *ctx = framebuffer->context;
 
diff --git a/cogl/cogl-framebuffer.h b/cogl/cogl-framebuffer.h
index a38a2a3..62a02ca 100644
--- a/cogl/cogl-framebuffer.h
+++ b/cogl/cogl-framebuffer.h
@@ -1030,7 +1030,7 @@ cogl_framebuffer_get_context (CoglFramebuffer *framebuffer);
  */
 void
 cogl_framebuffer_clear (CoglFramebuffer *framebuffer,
-                        unsigned long buffers,
+                        CoglBufferBit buffers,
                         const CoglColor *color);
 
 /**
@@ -1055,7 +1055,7 @@ cogl_framebuffer_clear (CoglFramebuffer *framebuffer,
  */
 void
 cogl_framebuffer_clear4f (CoglFramebuffer *framebuffer,
-                          unsigned long buffers,
+                          CoglBufferBit buffers,
                           float red,
                           float green,
                           float blue,
@@ -1629,7 +1629,7 @@ cogl_framebuffer_stroke_path (CoglFramebuffer *framebuffer,
  */
 void
 cogl_framebuffer_discard_buffers (CoglFramebuffer *framebuffer,
-                                  unsigned long buffers);
+                                  CoglBufferBit buffers);
 
 /**
  * cogl_framebuffer_finish:
diff --git a/cogl/cogl-types.h b/cogl/cogl-types.h
index 3d096cd..15464f1 100644
--- a/cogl/cogl-types.h
+++ b/cogl/cogl-types.h
@@ -670,9 +670,9 @@ typedef enum
  * Since: 1.0
  */
 typedef enum {
-  COGL_BUFFER_BIT_COLOR   = 1L<<0,
-  COGL_BUFFER_BIT_DEPTH   = 1L<<1,
-  COGL_BUFFER_BIT_STENCIL = 1L<<2
+  COGL_BUFFER_BIT_COLOR   = 1<<0,
+  COGL_BUFFER_BIT_DEPTH   = 1<<1,
+  COGL_BUFFER_BIT_STENCIL = 1<<2
 } CoglBufferBit;
 
 /**
-- 
1.7.7.5



More information about the Cogl mailing list