summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Bragg <robert@linux.intel.com>2011-03-01 23:12:18 +0000
committerRobert Bragg <robert@linux.intel.com>2011-04-11 15:32:32 +0100
commitc77bf6637cf8416c1f8bddefb3053b889f1ee68e (patch)
tree9364bfcb3167fa8914ebb5b2a7cf2ab9a6c9a7bb
parent45db9eb924bf502e6e80cd0649c0a528678ae0a5 (diff)
downloadclutter-c77bf6637cf8416c1f8bddefb3053b889f1ee68e.tar.gz
Make cogl_framebuffer_get_width/height experimental public API
It's generally useful to be able to query the width and height of a framebuffer and we expect to need this in Clutter when we move the eglnative backend code into Cogl since Clutter will need to read back the fixed size of the framebuffer when realizing the stage.
-rw-r--r--clutter/cogl/cogl/cogl-clip-stack.c2
-rw-r--r--clutter/cogl/cogl/cogl-framebuffer-private.h6
-rw-r--r--clutter/cogl/cogl/cogl-framebuffer.c4
-rw-r--r--clutter/cogl/cogl/cogl-framebuffer.h8
-rw-r--r--clutter/cogl/cogl/cogl.c2
-rw-r--r--clutter/cogl/cogl/winsys/cogl-winsys-glx.c4
6 files changed, 14 insertions, 12 deletions
diff --git a/clutter/cogl/cogl/cogl-clip-stack.c b/clutter/cogl/cogl/cogl-clip-stack.c
index 1456262c6..5f21810e0 100644
--- a/clutter/cogl/cogl/cogl-clip-stack.c
+++ b/clutter/cogl/cogl/cogl-clip-stack.c
@@ -644,7 +644,7 @@ _cogl_clip_stack_flush (CoglClipStack *stack)
else
{
int framebuffer_height =
- _cogl_framebuffer_get_height (framebuffer);
+ cogl_framebuffer_get_height (framebuffer);
scissor_y_start = framebuffer_height - scissor_y1;
}
diff --git a/clutter/cogl/cogl/cogl-framebuffer-private.h b/clutter/cogl/cogl/cogl-framebuffer-private.h
index ee6f3fff6..278cd1564 100644
--- a/clutter/cogl/cogl/cogl-framebuffer-private.h
+++ b/clutter/cogl/cogl/cogl-framebuffer-private.h
@@ -155,12 +155,6 @@ _cogl_framebuffer_clear4f (CoglFramebuffer *framebuffer,
void
_cogl_framebuffer_dirty (CoglFramebuffer *framebuffer);
-int
-_cogl_framebuffer_get_width (CoglFramebuffer *framebuffer);
-
-int
-_cogl_framebuffer_get_height (CoglFramebuffer *framebuffer);
-
CoglClipState *
_cogl_framebuffer_get_clip_state (CoglFramebuffer *framebuffer);
diff --git a/clutter/cogl/cogl/cogl-framebuffer.c b/clutter/cogl/cogl/cogl-framebuffer.c
index e67e27bf0..8f0769dff 100644
--- a/clutter/cogl/cogl/cogl-framebuffer.c
+++ b/clutter/cogl/cogl/cogl-framebuffer.c
@@ -464,13 +464,13 @@ _cogl_framebuffer_clear (CoglFramebuffer *framebuffer,
}
int
-_cogl_framebuffer_get_width (CoglFramebuffer *framebuffer)
+cogl_framebuffer_get_width (CoglFramebuffer *framebuffer)
{
return framebuffer->width;
}
int
-_cogl_framebuffer_get_height (CoglFramebuffer *framebuffer)
+cogl_framebuffer_get_height (CoglFramebuffer *framebuffer)
{
return framebuffer->height;
}
diff --git a/clutter/cogl/cogl/cogl-framebuffer.h b/clutter/cogl/cogl/cogl-framebuffer.h
index 1e0a300d2..80424287d 100644
--- a/clutter/cogl/cogl/cogl-framebuffer.h
+++ b/clutter/cogl/cogl/cogl-framebuffer.h
@@ -43,6 +43,14 @@ gboolean
cogl_framebuffer_allocate (CoglFramebuffer *framebuffer,
GError **error);
+#define cogl_framebuffer_get_width cogl_framebuffer_get_width_EXP
+int
+cogl_framebuffer_get_width (CoglFramebuffer *framebuffer);
+
+#define cogl_framebuffer_get_height cogl_framebuffer_get_height_EXP
+int
+cogl_framebuffer_get_height (CoglFramebuffer *framebuffer);
+
#define cogl_framebuffer_swap_buffers cogl_framebuffer_swap_buffers_EXP
void
cogl_framebuffer_swap_buffers (CoglFramebuffer *framebuffer);
diff --git a/clutter/cogl/cogl/cogl.c b/clutter/cogl/cogl/cogl.c
index 49882d9ca..4dbe4aebe 100644
--- a/clutter/cogl/cogl/cogl.c
+++ b/clutter/cogl/cogl/cogl.c
@@ -528,7 +528,7 @@ _cogl_read_pixels_with_rowstride (int x,
framebuffer,
0);
- framebuffer_height = _cogl_framebuffer_get_height (framebuffer);
+ framebuffer_height = cogl_framebuffer_get_height (framebuffer);
/* The y co-ordinate should be given in OpenGL's coordinate system
* so 0 is the bottom row
diff --git a/clutter/cogl/cogl/winsys/cogl-winsys-glx.c b/clutter/cogl/cogl/winsys/cogl-winsys-glx.c
index 2a81d3ac9..6bd6850ba 100644
--- a/clutter/cogl/cogl/winsys/cogl-winsys-glx.c
+++ b/clutter/cogl/cogl/winsys/cogl-winsys-glx.c
@@ -743,8 +743,8 @@ _cogl_winsys_onscreen_init (CoglOnscreen *onscreen,
unsigned long mask;
int xerror;
- width = _cogl_framebuffer_get_width (framebuffer);
- height = _cogl_framebuffer_get_height (framebuffer);
+ width = cogl_framebuffer_get_width (framebuffer);
+ height = cogl_framebuffer_get_height (framebuffer);
_cogl_renderer_xlib_trap_errors (display->renderer, &state);