From fda8a1d9483f088bcbe94e9d3dee2ef3817bfcdc Mon Sep 17 00:00:00 2001 From: Matthew Allum Date: Fri, 29 Jun 2007 11:54:31 +0000 Subject: [PATCH] 2007-06-29 Matthew Allum * clutter/clutter-texture.c: (texture_upload_data): Fix a SEGV for GL ES textures. * clutter/cogl/gles/cogl.c: (cogl_setup_viewport): Tweak default z_camera for 60 degrees like GL. * clutter/egl/clutter-backend-egl.c:: * clutter/egl/clutter-stage-egl.c: Fix edpy usage (thanks to Kaj Gronholm). --- ChangeLog | 12 ++++++++++++ clutter/clutter-texture.c | 10 +++++----- clutter/cogl/gles/cogl.c | 2 +- clutter/egl/clutter-backend-egl.c | 17 +++++++++++++---- clutter/egl/clutter-stage-egl.c | 4 ++-- 5 files changed, 33 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1b1aff15b..c1a38b6cf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2007-06-29 Matthew Allum + + * clutter/clutter-texture.c: (texture_upload_data): + Fix a SEGV for GL ES textures. + + * clutter/cogl/gles/cogl.c: (cogl_setup_viewport): + Tweak default z_camera for 60 degrees like GL. + + * clutter/egl/clutter-backend-egl.c:: + * clutter/egl/clutter-stage-egl.c: + Fix edpy usage (thanks to Kaj Gronholm). + 2007-06-29 Tomas Frydrych * clutter/clutter-group.c: diff --git a/clutter/clutter-texture.c b/clutter/clutter-texture.c index e9abb077e..15f1adf71 100644 --- a/clutter/clutter-texture.c +++ b/clutter/clutter-texture.c @@ -518,6 +518,11 @@ texture_upload_data (ClutterTexture *texture, src_w = priv->x_tiles[x].size; src_h = priv->y_tiles[y].size; + pixtmp = gdk_pixbuf_new (GDK_COLORSPACE_RGB, + has_alpha, + 8, + src_w, src_h); + /* clip */ if (priv->x_tiles[x].pos + src_w > priv->width) src_w = priv->width - priv->x_tiles[x].pos; @@ -525,11 +530,6 @@ texture_upload_data (ClutterTexture *texture, if (priv->y_tiles[y].pos + src_h > priv->height) src_h = priv->height - priv->y_tiles[y].pos; - pixtmp = gdk_pixbuf_new (GDK_COLORSPACE_RGB, - has_alpha, - 8, - src_w, src_h); - gdk_pixbuf_copy_area (master_pixbuf, priv->x_tiles[x].pos, priv->y_tiles[y].pos, diff --git a/clutter/cogl/gles/cogl.c b/clutter/cogl/gles/cogl.c index 3fb1631aa..123fcdcc5 100644 --- a/clutter/cogl/gles/cogl.c +++ b/clutter/cogl/gles/cogl.c @@ -521,7 +521,7 @@ cogl_setup_viewport (guint w, * * See comments in ../gl/cogl.c */ -#define DEFAULT_Z_CAMERA 0.8699f +#define DEFAULT_Z_CAMERA 0.869f z_camera = CLUTTER_FLOAT_TO_FIXED (DEFAULT_Z_CAMERA); if (fovy != CFX_60) diff --git a/clutter/egl/clutter-backend-egl.c b/clutter/egl/clutter-backend-egl.c index b72c1f898..8cb070364 100644 --- a/clutter/egl/clutter-backend-egl.c +++ b/clutter/egl/clutter-backend-egl.c @@ -182,7 +182,7 @@ clutter_backend_egl_redraw (ClutterBackend *backend) if (stage_egl->xwin) { /* clutter_feature_wait_for_vblank (); */ - eglSwapBuffers ((EGLDisplay)stage_egl->xdpy, stage_egl->egl_surface); + eglSwapBuffers (backend_egl->edpy, stage_egl->egl_surface); } else { @@ -338,9 +338,9 @@ clutter_egl_untrap_x_errors (void) /** * clutter_egl_get_default_display: * - * FIXME + * Returns the default X Display * - * Return value: FIXME + * Return value: A Display pointer * * Since: 0.4 */ @@ -398,8 +398,17 @@ clutter_egl_get_default_root_window (void) return backend_singleton->xwin_root; } +/** + * clutter_egl_display + * + * Gets the current EGLDisplay. + * + * Return value: an EGLDisplay + * + * Since: 0.4 + */ EGLDisplay clutter_egl_display (void) { - return (EGLDisplay)clutter_egl_get_default_display (); + return backend_singleton->edpy; } diff --git a/clutter/egl/clutter-stage-egl.c b/clutter/egl/clutter-stage-egl.c index 42aec444c..b80061f8d 100644 --- a/clutter/egl/clutter-stage-egl.c +++ b/clutter/egl/clutter-stage-egl.c @@ -105,7 +105,7 @@ clutter_stage_egl_realize (ClutterActor *actor) EGL_BLUE_SIZE, 5, EGL_NONE }; - status = eglGetConfigs (clutter_egl_get_default_display(), + status = eglGetConfigs (clutter_egl_display(), configs, 2, &config_count); @@ -113,7 +113,7 @@ clutter_stage_egl_realize (ClutterActor *actor) if (status != EGL_TRUE) g_warning ("eglGetConfigs"); - status = eglChooseConfig (clutter_egl_get_default_display(), + status = eglChooseConfig (clutter_egl_display(), cfg_attribs, configs, sizeof configs / sizeof configs[0],