[cogl] Make sure Cogl always knows the current window geometry

Because Cogl defines the origin of viewport and window coordinates to be
top-left it always needs to know the size of the current window so that Cogl
window/viewport coordinates can be transformed into OpenGL coordinates.

This also fixes cogl_read_pixels to use the current draw buffer height
instead of the viewport height to determine the OpenGL y coordinate to use
for glReadPixels.
This commit is contained in:
Robert Bragg
2009-10-21 23:24:49 +01:00
parent e3391b0173
commit 12af275139
6 changed files with 62 additions and 8 deletions

View File

@ -192,6 +192,10 @@ clutter_stage_allocate (ClutterActor *self,
{
ClutterActorClass *klass;
/* XXX: Until Cogl becomes fully responsible for backend windows Clutter
* need to manually keep it informed of the current window size */
_cogl_onscreen_clutter_backend_set_size (width, height);
CLUTTER_NOTE (LAYOUT,
"Following allocation to %dx%d (origin %s)",
width, height,
@ -210,6 +214,10 @@ clutter_stage_allocate (ClutterActor *self,
_clutter_stage_window_get_geometry (priv->impl, &geom);
/* XXX: Until Cogl becomes fully responsible for backend windows Clutter
* need to manually keep it informed of the current window size */
_cogl_onscreen_clutter_backend_set_size (geom.width, geom.height);
override.x1 = 0;
override.y1 = 0;
override.x2 = geom.width;