From 04df29dbd44d31c697371ff44006b9c9d69a3e61 Mon Sep 17 00:00:00 2001 From: Iain Holmes Date: Wed, 11 Jun 2008 16:29:20 +0000 Subject: [PATCH] 2008-06-11 Iain Holmes * configure.ac: Detect the GL headers in flavour=fruity * clutter/fruity/clutter-stage-fruity.c: Update the Fruity backend to use the new size negotiation API. --- ChangeLog | 7 ++++++ clutter/fruity/clutter-stage-fruity.c | 35 +++++++++++++++------------ configure.ac | 9 +++++++ 3 files changed, 35 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2fa7be7f8..e0b96125f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-06-11 Iain Holmes + + * configure.ac: Detect the GL headers in flavour=fruity + + * clutter/fruity/clutter-stage-fruity.c: Update the Fruity backend to + use the new size negotiation API. + 2008-06-11 Emmanuele Bassi * clutter/clutter-label.c (clutter_label_allocate): Keep the diff --git a/clutter/fruity/clutter-stage-fruity.c b/clutter/fruity/clutter-stage-fruity.c index 1ffe8f954..ed603a375 100644 --- a/clutter/fruity/clutter-stage-fruity.c +++ b/clutter/fruity/clutter-stage-fruity.c @@ -188,30 +188,33 @@ clutter_stage_egl_realize (ClutterActor *actor) } static void -clutter_stage_egl_query_coords (ClutterActor *self, - ClutterActorBox *box) +clutter_stage_egl_get_preferred_width (ClutterActor *self, + ClutterUnit for_height, + ClutterUnit *min_width_p, + ClutterUnit *natural_width_p) { ClutterStageEGL *stage_egl = CLUTTER_STAGE_EGL (self); - box->x1 = box->y1 = 0; - box->x2 = box->x1 + CLUTTER_UNITS_FROM_INT (stage_egl->surface_width); - box->y2 = box->y1 + CLUTTER_UNITS_FROM_INT (stage_egl->surface_height); + if (min_width_p) + *min_width_p = CLUTTER_UNITS_FROM_DEVICE (stage_egl->surface_width); + + if (natural_width_p) + *natural_width_p = CLUTTER_UNITS_FROM_DEVICE (stage_egl->surface_width); } static void -clutter_stage_egl_request_coords (ClutterActor *self, - ClutterActorBox *box) +clutter_stage_egl_get_preferred_height (ClutterActor *self, + ClutterUnit for_width, + ClutterUnit *min_height_p, + ClutterUnit *natural_height_p) { ClutterStageEGL *stage_egl = CLUTTER_STAGE_EGL (self); - /* framebuffer no resize */ - box->x1 = 0; - box->y1 = 0; - box->x2 = CLUTTER_UNITS_FROM_INT (stage_egl->surface_width); - box->y2 = CLUTTER_UNITS_FROM_INT (stage_egl->surface_height); + if (min_height_p) + *min_height_p = CLUTTER_UNITS_FROM_DEVICE (stage_egl->surface_height); - CLUTTER_ACTOR_CLASS (clutter_stage_egl_parent_class)->request_coords (self, - box); + if (natural_height_p) + *natural_height_p = CLUTTER_UNITS_FROM_DEVICE (stage_egl->surface_height); } static void @@ -236,8 +239,8 @@ clutter_stage_egl_class_init (ClutterStageEGLClass *klass) actor_class->hide = clutter_stage_egl_hide; actor_class->realize = clutter_stage_egl_realize; actor_class->unrealize = clutter_stage_egl_unrealize; - actor_class->request_coords = clutter_stage_egl_request_coords; - actor_class->query_coords = clutter_stage_egl_query_coords; + actor_class->get_preferred_width = clutter_stage_egl_get_preferred_width; + actor_class->get_preferred_height = clutter_stage_egl_get_preferred_height; } static void diff --git a/configure.ac b/configure.ac index f640591a7..31a88b9de 100644 --- a/configure.ac +++ b/configure.ac @@ -283,6 +283,15 @@ case $glesversion in fruity) CLUTTER_COGL="gles" AC_DEFINE([HAVE_COGL_GLES], 1, [Have GL/ES for rendering]) + + clutter_gl_header="GLES/gl.h" + CLUTTER_COGL="gles" + AC_DEFINE([HAVE_COGL_GLES], 1, [Have GL/ES for rendering]) + + AC_CHECK_HEADERS([GLES/egl.h],, + [AC_MSG_ERROR([Unable to locate required GLES headers])]) + AC_CHECK_HEADERS([$clutter_gl_header],, + [AC_MSG_ERROR([Unable to locate required GLES headers])]) ;; *) AC_MSG_ERROR([Invalid GL ES Version '$glesversion' specified])