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.
This commit is contained in:
parent
1928f7ec0e
commit
2bbb0d895b
@ -644,7 +644,7 @@ _cogl_clip_stack_flush (CoglClipStack *stack)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
int framebuffer_height =
|
int framebuffer_height =
|
||||||
_cogl_framebuffer_get_height (framebuffer);
|
cogl_framebuffer_get_height (framebuffer);
|
||||||
|
|
||||||
scissor_y_start = framebuffer_height - scissor_y1;
|
scissor_y_start = framebuffer_height - scissor_y1;
|
||||||
}
|
}
|
||||||
|
@ -155,12 +155,6 @@ _cogl_framebuffer_clear4f (CoglFramebuffer *framebuffer,
|
|||||||
void
|
void
|
||||||
_cogl_framebuffer_dirty (CoglFramebuffer *framebuffer);
|
_cogl_framebuffer_dirty (CoglFramebuffer *framebuffer);
|
||||||
|
|
||||||
int
|
|
||||||
_cogl_framebuffer_get_width (CoglFramebuffer *framebuffer);
|
|
||||||
|
|
||||||
int
|
|
||||||
_cogl_framebuffer_get_height (CoglFramebuffer *framebuffer);
|
|
||||||
|
|
||||||
CoglClipState *
|
CoglClipState *
|
||||||
_cogl_framebuffer_get_clip_state (CoglFramebuffer *framebuffer);
|
_cogl_framebuffer_get_clip_state (CoglFramebuffer *framebuffer);
|
||||||
|
|
||||||
|
@ -464,13 +464,13 @@ _cogl_framebuffer_clear (CoglFramebuffer *framebuffer,
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
_cogl_framebuffer_get_width (CoglFramebuffer *framebuffer)
|
cogl_framebuffer_get_width (CoglFramebuffer *framebuffer)
|
||||||
{
|
{
|
||||||
return framebuffer->width;
|
return framebuffer->width;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
_cogl_framebuffer_get_height (CoglFramebuffer *framebuffer)
|
cogl_framebuffer_get_height (CoglFramebuffer *framebuffer)
|
||||||
{
|
{
|
||||||
return framebuffer->height;
|
return framebuffer->height;
|
||||||
}
|
}
|
||||||
|
@ -43,6 +43,14 @@ gboolean
|
|||||||
cogl_framebuffer_allocate (CoglFramebuffer *framebuffer,
|
cogl_framebuffer_allocate (CoglFramebuffer *framebuffer,
|
||||||
GError **error);
|
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
|
#define cogl_framebuffer_swap_buffers cogl_framebuffer_swap_buffers_EXP
|
||||||
void
|
void
|
||||||
cogl_framebuffer_swap_buffers (CoglFramebuffer *framebuffer);
|
cogl_framebuffer_swap_buffers (CoglFramebuffer *framebuffer);
|
||||||
|
@ -528,7 +528,7 @@ _cogl_read_pixels_with_rowstride (int x,
|
|||||||
framebuffer,
|
framebuffer,
|
||||||
0);
|
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
|
/* The y co-ordinate should be given in OpenGL's coordinate system
|
||||||
* so 0 is the bottom row
|
* so 0 is the bottom row
|
||||||
|
@ -743,8 +743,8 @@ _cogl_winsys_onscreen_init (CoglOnscreen *onscreen,
|
|||||||
unsigned long mask;
|
unsigned long mask;
|
||||||
int xerror;
|
int xerror;
|
||||||
|
|
||||||
width = _cogl_framebuffer_get_width (framebuffer);
|
width = cogl_framebuffer_get_width (framebuffer);
|
||||||
height = _cogl_framebuffer_get_height (framebuffer);
|
height = cogl_framebuffer_get_height (framebuffer);
|
||||||
|
|
||||||
_cogl_renderer_xlib_trap_errors (display->renderer, &state);
|
_cogl_renderer_xlib_trap_errors (display->renderer, &state);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user