[maemo-commits] [maemo-commits] r17098 - in projects/haf/trunk/clutter: clutter clutter/cogl clutter/cogl/common clutter/cogl/gl clutter/cogl/gles clutter/eglx clutter/x11 debian
From: subversion at stage.maemo.org subversion at stage.maemo.orgDate: Mon Jan 12 14:25:38 EET 2009
- Previous message: [maemo-commits] r17097 - projects/haf/trunk/libglade2
- Next message: [maemo-commits] r17099 - projects/haf/trunk/clutter/clutter/x11
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Author: gw Date: 2009-01-12 14:25:34 +0200 (Mon, 12 Jan 2009) New Revision: 17098 Modified: projects/haf/trunk/clutter/clutter/clutter-stage.c projects/haf/trunk/clutter/clutter/clutter-texture.c projects/haf/trunk/clutter/clutter/cogl/cogl.h.in projects/haf/trunk/clutter/clutter/cogl/common/cogl-util.c projects/haf/trunk/clutter/clutter/cogl/common/cogl-util.h projects/haf/trunk/clutter/clutter/cogl/gl/cogl.c projects/haf/trunk/clutter/clutter/cogl/gles/cogl.c projects/haf/trunk/clutter/clutter/eglx/clutter-eglx-texture-pixmap.c projects/haf/trunk/clutter/clutter/x11/clutter-event-x11.c projects/haf/trunk/clutter/clutter/x11/clutter-x11-texture-pixmap.c projects/haf/trunk/clutter/debian/changelog Log: * added cogl_modify_clip_viewport to allow rendering to a specific area (gw) * Modified redraw_damage code to allow redraw using viewport rather than glScissor (gw) * Stopped eglx-texture-pixmap from creating a new texture on ANY change event, and instead do it only when width/height/depth changes (gw) * Set up xevent handlers in clutter-x11-texture-pixmap.c only if XDAMAGE_HANDLING is defined. This avoids doing damage handling twice for application windows and should avoid some surprises in libmatchbox2 side. * Do not alter XComposite redirections in clutter-x11-texture-pixmap.c, that belongs to the window manager. * Removed some un-needed log messages for EGLX textures (gw) * Set damage to update the whole screen after a 'pick' event (as it will have destroyed the buffer) Modified: projects/haf/trunk/clutter/clutter/clutter-stage.c =================================================================== --- projects/haf/trunk/clutter/clutter/clutter-stage.c 2009-01-12 12:18:56 UTC (rev 17097) +++ projects/haf/trunk/clutter/clutter/clutter-stage.c 2009-01-12 12:25:34 UTC (rev 17098) @@ -69,6 +69,22 @@ #include "cogl/cogl.h" +/* ----------------------------------------------------------------------*/ +/* ----------------------------------------------------------------------*/ +/* ----------------------------------------------------------------------*/ +/* This is whether we do damage using glViewport or glScissor. glScissor clips + * what we render while updating the whole screen, but glViewport actually + * renders only the area given, so should be a lot faster on SGX if the + * drivers pay attention to it. */ +#define VIEWPORT_DAMAGE 1 + +/* If we're using double-buffering we want to update the area for this frame + * AND the area for the last frame. */ +//#define DOUBLE_BUFFER 1 +/* ----------------------------------------------------------------------*/ +/* ----------------------------------------------------------------------*/ +/* ----------------------------------------------------------------------*/ + G_DEFINE_TYPE (ClutterStage, clutter_stage, CLUTTER_TYPE_GROUP); #define CLUTTER_STAGE_GET_PRIVATE(obj) \ @@ -225,9 +241,11 @@ last_damage = priv->last_damaged_area; priv->last_damaged_area = priv->damaged_area; +#if DOUBLE_BUFFER /* Add the damaged area from last frame to this one, as we're double-buffered * so will have missed 2 frames worth of changes! */ clutter_stage_set_damaged_area(self, last_damage); +#endif /* If we only had a small area, redraw that */ update_area = priv->damaged_area.width>0 && priv->damaged_area.height>0; /* Or if it was the whole screen, just skip the small redraw overhead */ @@ -247,11 +265,23 @@ priv->damaged_area.x, priv->damaged_area.y, priv->damaged_area.width, priv->damaged_area.height );*/ +#if VIEWPORT_DAMAGE + CLUTTER_SET_PRIVATE_FLAGS (self, CLUTTER_ACTOR_SYNC_MATRICES); + _clutter_stage_maybe_setup_viewport(CLUTTER_STAGE(self)); + cogl_clip_set( + CLUTTER_INT_TO_FIXED( priv->damaged_area.x ), + CLUTTER_INT_TO_FIXED( priv->damaged_area.y ), + CLUTTER_INT_TO_FIXED( priv->damaged_area.width ), + CLUTTER_INT_TO_FIXED( priv->damaged_area.height )); + cogl_modify_clip_viewport(priv->damaged_area.x, + height - (priv->damaged_area.y+priv->damaged_area.height), + priv->damaged_area.width, + priv->damaged_area.height ); +#else cogl_push_matrix(); CLUTTER_SET_PRIVATE_FLAGS (self, CLUTTER_ACTOR_SYNC_MATRICES); _clutter_stage_maybe_setup_viewport(CLUTTER_STAGE(self)); - /* We hope that clutter_redraw has set up the matrices correctly */ cogl_clip_set( CLUTTER_INT_TO_FIXED( priv->damaged_area.x ), CLUTTER_INT_TO_FIXED( priv->damaged_area.y ), @@ -259,6 +289,7 @@ CLUTTER_INT_TO_FIXED( priv->damaged_area.height )); cogl_pop_matrix(); +#endif } /* don't clear the background if just updating the area */ @@ -282,7 +313,14 @@ if (update_area) { +#if VIEWPORT_DAMAGE cogl_clip_unset(); + /* return our normal viewport in case it is needed in the future */ + CLUTTER_SET_PRIVATE_FLAGS (self, CLUTTER_ACTOR_SYNC_MATRICES); + _clutter_stage_maybe_setup_viewport(CLUTTER_STAGE(self)); +#else + cogl_clip_unset(); +#endif // VIEWPORT_DAMAGE } priv->damaged_area.x = 0; priv->damaged_area.y = 0; @@ -294,12 +332,21 @@ clutter_stage_pick (ClutterActor *self, const ClutterColor *color) { + ClutterStagePrivate *priv = CLUTTER_STAGE (self)->priv; /* Paint nothing, cogl_paint_init() effectively paints the stage * silhouette for us - see _clutter_do_pick(). * Chain up to the groups paint howerer so our children get picked * - clutter_group_pick */ CLUTTER_ACTOR_CLASS (clutter_stage_parent_class)->paint (self); + /* Here we set the damaged area to the whole of the screen, as + * the 'pick' will have destroyed it and the next time we render + * we'll have to do everything */ + priv->damaged_area.x = 0; + priv->damaged_area.y = 0; + clutter_actor_get_size(self, + &priv->damaged_area.width, + &priv->damaged_area.height); } static void Modified: projects/haf/trunk/clutter/clutter/clutter-texture.c =================================================================== --- projects/haf/trunk/clutter/clutter/clutter-texture.c 2009-01-12 12:18:56 UTC (rev 17097) +++ projects/haf/trunk/clutter/clutter/clutter-texture.c 2009-01-12 12:25:34 UTC (rev 17098) @@ -274,8 +274,8 @@ if (priv->texture != COGL_INVALID_HANDLE) cogl_texture_unref (priv->texture); - priv->texture - = cogl_texture_new_with_size + priv->texture + = cogl_texture_new_with_size (priv->width, priv->height, priv->no_slice ? -1 : priv->max_tile_waste, @@ -398,12 +398,12 @@ { /* Set the natural height so as to preserve the aspect ratio */ ClutterFixed ratio, width; - + ratio = clutter_qdivx (CLUTTER_INT_TO_FIXED (priv->height), CLUTTER_INT_TO_FIXED (priv->width)); width = CLUTTER_UNITS_TO_FIXED (for_width); - + *natural_height_p = CLUTTER_UNITS_FROM_FIXED (clutter_qmulx (ratio, width)); } @@ -951,7 +951,7 @@ parent_scriptable_iface = g_type_interface_peek_parent (iface); if (!parent_scriptable_iface) - parent_scriptable_iface = g_type_default_interface_peek + parent_scriptable_iface = g_type_default_interface_peek (CLUTTER_TYPE_SCRIPTABLE); iface->set_custom_property = clutter_texture_set_custom_property; @@ -1041,7 +1041,7 @@ priv->local_data_rowstride, priv->local_data_has_alpha ? 4: 3, 0, NULL); - + g_free (priv->local_data); priv->local_data = NULL; } @@ -1149,7 +1149,7 @@ priv = texture->priv; - if ((new_texture = cogl_texture_new_from_data + if ((new_texture = cogl_texture_new_from_data (width, height, priv->no_slice ? -1 : priv->max_tile_waste, priv->filter_quality == CLUTTER_TEXTURE_QUALITY_HIGH, @@ -1184,7 +1184,7 @@ * @width: Width in pixels of image data. * @height: Height in pixels of image data * @rowstride: Distance in bytes between row starts. - * @bpp: bytes per pixel (Currently only 2, 3 and 4 supported, + * @bpp: bytes per pixel (Currently only 2, 3 and 4 supported, * depending on @has_alpha. If 2 and @has_alpha * RGBA_4444 assumed) * @flags: #ClutterTextureFlags @@ -1230,14 +1230,14 @@ else if (bpp == 1) { source_format = COGL_PIXEL_FORMAT_A_8; - } + } else { g_set_error (error, CLUTTER_TEXTURE_ERROR, CLUTTER_TEXTURE_ERROR_BAD_FORMAT, "Unsupported BPP"); return FALSE; - } + } } else { @@ -1252,7 +1252,7 @@ else if (bpp == 1) { source_format = COGL_PIXEL_FORMAT_G_8; - } + } else { g_set_error (error, CLUTTER_TEXTURE_ERROR, @@ -1374,14 +1374,14 @@ GError **error) { CoglHandle new_texture = 0; - ClutterTexturePrivate *priv; + ClutterTexturePrivate *priv; priv = texture->priv; g_return_val_if_fail (error == NULL || *error == NULL, FALSE); - + if (!new_texture && - (new_texture = cogl_texture_new_from_file + (new_texture = cogl_texture_new_from_file (filename, priv->no_slice ? -1 : priv->max_tile_waste, priv->filter_quality == CLUTTER_TEXTURE_QUALITY_HIGH, @@ -1399,7 +1399,7 @@ return FALSE; } - + clutter_actor_set_name(CLUTTER_ACTOR(texture), filename); /* set a default name */ cogl_texture_set_filters (new_texture, @@ -1457,7 +1457,7 @@ clutter_texture_unrealize (CLUTTER_ACTOR (texture)); clutter_texture_realize (CLUTTER_ACTOR (texture)); } - + g_object_notify (G_OBJECT (texture), "filter-quality"); if (CLUTTER_ACTOR_IS_VISIBLE (texture)) @@ -1576,7 +1576,7 @@ { return clutter_texture_new_from_file_f( filename, CLUTTER_DEFAULT_PIXEL_FORMAT, error); -} +} /** * clutter_texture_new_from_file: @@ -1585,7 +1585,7 @@ * * Creates a new ClutterTexture actor to display the image contained a * file. If the image failed to load then NULL is returned and @error - * is set. A pixel format can be supplied that determines how the texture is + * is set. A pixel format can be supplied that determines how the texture is * to be stored in OpenGL. * * Return value: A newly created #ClutterTexture object or NULL on @@ -1665,7 +1665,7 @@ * @width: Width in pixels of region to update. * @height: Height in pixels of region to update. * @rowstride: Distance in bytes between row starts on source buffer. - * @bpp: bytes per pixel (Currently only 3 and 4 supported, + * @bpp: bytes per pixel (Currently only 3 and 4 supported, * depending on @has_alpha) * @flags: #ClutterTextureFlags * @error: return location for a #GError, or %NULL @@ -1721,7 +1721,7 @@ CLUTTER_TEXTURE_ERROR_BAD_FORMAT, "Unsupported BPP"); return FALSE; - } + } } if ((flags & CLUTTER_TEXTURE_RGB_FLAG_BGR)) source_format |= COGL_BGR_BIT; @@ -1831,7 +1831,7 @@ * * Note this function is intented as a utility call for uniformly applying * shaders to groups and other potential visual effects. It requires that - * the %CLUTTER_FEATURE_OFFSCREEN feature is supported by the current backend + * the %CLUTTER_FEATURE_OFFSCREEN feature is supported by the current backend * and the target system. * * Some tips on usage: @@ -1924,7 +1924,7 @@ return NULL; /* Hopefully now were good.. */ - texture = g_object_new (CLUTTER_TYPE_TEXTURE, + texture = g_object_new (CLUTTER_TYPE_TEXTURE, "disable-slicing", TRUE, NULL); Modified: projects/haf/trunk/clutter/clutter/cogl/cogl.h.in =================================================================== --- projects/haf/trunk/clutter/clutter/cogl/cogl.h.in 2009-01-12 12:18:56 UTC (rev 17097) +++ projects/haf/trunk/clutter/clutter/cogl/cogl.h.in 2009-01-12 12:25:34 UTC (rev 17098) @@ -418,7 +418,25 @@ void cogl_viewport (guint width, guint height); + /** + * cogl_modify_clip_viewport: + * @x: X start position of viewport + * @y: Y start position of viewport + * @w: Width of the viewport + * @h: Height of the viewport + * + * Replace the current viewport with a viewport at the given location + * set up to render ONLY to that area. + * + * Since: 0.8.2-maemo + */ +void cogl_modify_clip_viewport( guint x, + guint y, + guint w, + guint h); + +/** * cogl_push_matrix: * * Store the current model-view matrix on the matrix stack. The matrix Modified: projects/haf/trunk/clutter/clutter/cogl/common/cogl-util.c =================================================================== --- projects/haf/trunk/clutter/clutter/cogl/common/cogl-util.c 2009-01-12 12:18:56 UTC (rev 17097) +++ projects/haf/trunk/clutter/clutter/cogl/common/cogl-util.c 2009-01-12 12:25:34 UTC (rev 17098) @@ -44,7 +44,7 @@ { int rval=1; - while(rval < a) + while(rval < a) rval <<= 1; return rval; @@ -61,7 +61,7 @@ gboolean cogl_util_is_power_2(int a) { - return !(a & (a - 1)) && a; + return !(a & (a - 1)) && a; } /** @@ -83,7 +83,7 @@ shift = (v > 0xF ) << 2; v >>= shift; r |= shift; shift = (v > 0x3 ) << 1; v >>= shift; r |= shift; r |= (v >> 1); - return r; + return r; } /* @@ -125,24 +125,24 @@ #undef M -ClutterVertex cogl_util_unproject( ClutterFixed mtx[16], - ClutterFixed mtx_p[16], +ClutterVertex cogl_util_unproject( ClutterFixed mtx[16], + ClutterFixed mtx_p[16], ClutterFixed viewport[4], ClutterVertex obj_coord) -{ +{ ClutterFixed _w; ClutterVertex res; - + res = obj_coord; - _w = CFX_ONE; - cogl_util_mtx_transform (mtx, &res.x, &res.y, &res.z, &_w); + _w = CFX_ONE; + cogl_util_mtx_transform (mtx, &res.x, &res.y, &res.z, &_w); cogl_util_mtx_transform (mtx_p, &res.x, &res.y, &res.z, - &_w); + &_w); res.x = MTX_GL_SCALE_X (res.x, _w, viewport[2], viewport[0]); - res.y = viewport[3] - MTX_GL_SCALE_Y (res.y, _w, viewport[3], viewport[1]); + res.y = MTX_GL_SCALE_Y2 (res.y, _w, viewport[3], viewport[1]); res.z = MTX_GL_SCALE_Z (res.z, _w, viewport[2], viewport[0]); return res; } Modified: projects/haf/trunk/clutter/clutter/cogl/common/cogl-util.h =================================================================== --- projects/haf/trunk/clutter/clutter/cogl/common/cogl-util.h 2009-01-12 12:18:56 UTC (rev 17097) +++ projects/haf/trunk/clutter/clutter/cogl/common/cogl-util.h 2009-01-12 12:25:34 UTC (rev 17098) @@ -31,9 +31,10 @@ */ #define MTX_GL_SCALE_X(x,w,v1,v2) (CFX_QMUL (((CFX_QDIV ((x), (w)) + CFX_ONE) >> 1), (v1)) + (v2)) #define MTX_GL_SCALE_Y(y,w,v1,v2) ((v1) - CFX_QMUL (((CFX_QDIV ((y), (w)) + CFX_ONE) >> 1), (v1)) + (v2)) +#define MTX_GL_SCALE_Y2(y,w,v1,v2) (CFX_QMUL (((CFX_QDIV ((y), (w)) + CFX_ONE) >> 1), (v1)) + (v2)) #define MTX_GL_SCALE_Z(z,w,v1,v2) (MTX_GL_SCALE_X ((z), (w), (v1), (v2))) -int +int cogl_util_next_p2 (int a); gboolean @@ -48,8 +49,8 @@ ClutterFixed *x, ClutterFixed *y, ClutterFixed *z, ClutterFixed *w); -ClutterVertex cogl_util_unproject( ClutterFixed mtx[16], - ClutterFixed mtx_p[16], +ClutterVertex cogl_util_unproject( ClutterFixed mtx[16], + ClutterFixed mtx_p[16], ClutterFixed viewport[4], ClutterVertex obj_coord); Modified: projects/haf/trunk/clutter/clutter/cogl/gl/cogl.c =================================================================== --- projects/haf/trunk/clutter/clutter/cogl/gl/cogl.c 2009-01-12 12:18:56 UTC (rev 17097) +++ projects/haf/trunk/clutter/clutter/cogl/gl/cogl.c 2009-01-12 12:25:34 UTC (rev 17098) @@ -848,6 +848,21 @@ GE( glViewport (0, 0, width, height) ); } +void cogl_modify_clip_viewport(guint x, + guint y, + guint w, + guint h) +{ + guint viewport[4]; + + GE( glGetIntegerv(GL_VIEWPORT, viewport) ); + GE( glViewport (x, y, w, h) ); + GE( glScalef ( viewport[2] / (float)w, + viewport[3] / (float)h, + 1.0f)); + GE( glTranslatef (-x, -(viewport[3]-(y+h)), 0) ); +} + void cogl_setup_viewport (guint width, guint height, Modified: projects/haf/trunk/clutter/clutter/cogl/gles/cogl.c =================================================================== --- projects/haf/trunk/clutter/clutter/cogl/gles/cogl.c 2009-01-12 12:18:56 UTC (rev 17097) +++ projects/haf/trunk/clutter/clutter/cogl/gles/cogl.c 2009-01-12 12:25:34 UTC (rev 17098) @@ -753,11 +753,28 @@ void cogl_viewport (guint width, - guint height) + guint height) { GE( glViewport (0, 0, width, height) ); } +void cogl_modify_clip_viewport(guint x, + guint y, + guint w, + guint h) +{ + gint viewport[4]; + + GE( glGetIntegerv(GL_VIEWPORT, viewport) ); + GE( glViewport (x, y, w, h) ); + GE( cogl_wrap_glScalef ( (float)viewport[2] / (float)w, + (float)viewport[3] / (float)h, + 1.0f )); + GE( cogl_wrap_glTranslatex (CLUTTER_INT_TO_FIXED(-x), + CLUTTER_INT_TO_FIXED(-(viewport[3]-(y+h))), + 0) ); +} + void cogl_setup_viewport (guint w, guint h, Modified: projects/haf/trunk/clutter/clutter/eglx/clutter-eglx-texture-pixmap.c =================================================================== --- projects/haf/trunk/clutter/clutter/eglx/clutter-eglx-texture-pixmap.c 2009-01-12 12:18:56 UTC (rev 17097) +++ projects/haf/trunk/clutter/clutter/eglx/clutter-eglx-texture-pixmap.c 2009-01-12 12:25:34 UTC (rev 17098) @@ -221,7 +221,7 @@ if (handle) { - g_debug ("%s: created cogl handle %x", __FUNCTION__, (int)handle); + /*g_debug ("%s: created cogl handle %x", __FUNCTION__, (int)handle);*/ clutter_texture_set_cogl_texture (texture, handle); return TRUE; } @@ -280,7 +280,7 @@ g_warning ("%s: Pixmap AND Window defined, using pixmap", __FUNCTION__); } - g_debug("%s: Pixmap depth %d", __FUNCTION__, pixmap_depth); + /*g_debug("%s: Pixmap depth %d", __FUNCTION__, pixmap_depth);*/ if (pixmap) { @@ -374,8 +374,8 @@ return; } - g_debug ("%s: GL texture %u corresponds to surface %p", __FUNCTION__, - priv->texture_id, priv->egl_surface); + /*g_debug ("%s: GL texture %u corresponds to surface %p", __FUNCTION__, + priv->texture_id, priv->egl_surface);*/ if (!create_cogl_texture (CLUTTER_TEXTURE (actor), priv->texture_id, width, height, format)) @@ -386,7 +386,7 @@ return; } - g_debug ("%s: texture pixmap created", __FUNCTION__); + /*g_debug ("%s: texture pixmap created", __FUNCTION__);*/ } static void @@ -471,10 +471,10 @@ g_debug ("%s: eglChooseConfig failed: %x", __FUNCTION__, eglGetError()); return NULL; } - else + /*else { g_debug ("%s: got %d matching configs", __FUNCTION__, nconfigs); - } + }*/ for (i = 0; i < nconfigs; ++i) { Modified: projects/haf/trunk/clutter/clutter/x11/clutter-event-x11.c =================================================================== --- projects/haf/trunk/clutter/clutter/x11/clutter-event-x11.c 2009-01-12 12:18:56 UTC (rev 17097) +++ projects/haf/trunk/clutter/clutter/x11/clutter-event-x11.c 2009-01-12 12:25:34 UTC (rev 17098) @@ -246,7 +246,7 @@ { char buffer[256+1]; int n; - + CLUTTER_NOTE (EVENT, "Translating key %s event", xevent->xany.type == KeyPress ? "press" : "release"); @@ -270,7 +270,7 @@ (event->key.unicode_value != -2)) return; } - + event->key.unicode_value = (gunichar)'\0'; } @@ -575,7 +575,7 @@ set_user_time (backend_x11, &xwindow, xevent->xkey.time); break; - + case KeyRelease: event->key.type = event->type = CLUTTER_KEY_RELEASE; translate_key_event (backend, event, xevent); @@ -606,7 +606,7 @@ case 6: /* left */ case 7: /* right */ event->scroll.type = event->type = CLUTTER_SCROLL; - + if (xevent->xbutton.button == 4) event->scroll.direction = CLUTTER_SCROLL_UP; else if (xevent->xbutton.button == 5) @@ -615,12 +615,12 @@ event->scroll.direction = CLUTTER_SCROLL_LEFT; else event->scroll.direction = CLUTTER_SCROLL_RIGHT; - + event->scroll.time = xevent->xbutton.time; event->scroll.x = xevent->xbutton.x; event->scroll.y = xevent->xbutton.y; event->scroll.modifier_state = xevent->xbutton.state; - + break; default: event->button.type = event->type = CLUTTER_BUTTON_PRESS; @@ -629,13 +629,13 @@ event->button.y = xevent->xbutton.y; event->button.modifier_state = xevent->xbutton.state; event->button.button = xevent->xbutton.button; - + break; } - + set_user_time (backend_x11, &xwindow, event->button.time); break; - + case ButtonRelease: /* scroll events don't have a corresponding release */ if (xevent->xbutton.button == 4 || @@ -646,7 +646,7 @@ res = FALSE; break; } - + event->button.type = event->type = CLUTTER_BUTTON_RELEASE; event->button.time = xevent->xbutton.time; event->button.x = xevent->xbutton.x; @@ -654,7 +654,7 @@ event->button.modifier_state = xevent->xbutton.state; event->button.button = xevent->xbutton.button; break; - + case MotionNotify: event->motion.type = event->type = CLUTTER_MOTION; event->motion.time = xevent->xmotion.time; @@ -686,7 +686,7 @@ case 6: case 7: event->scroll.type = event->type = CLUTTER_SCROLL; - + if (xbev->button == 4) event->scroll.direction = CLUTTER_SCROLL_UP; else if (xbev->button == 5) @@ -695,12 +695,12 @@ event->scroll.direction = CLUTTER_SCROLL_LEFT; else event->scroll.direction = CLUTTER_SCROLL_RIGHT; - + event->scroll.time = xbev->time; event->scroll.x = xbev->x; event->scroll.y = xbev->y; event->scroll.modifier_state = xbev->state; - event->scroll.device + event->scroll.device = (ClutterInputDevice *)_clutter_x11_get_device_for_xid (xbev->deviceid); break; default: @@ -710,17 +710,17 @@ event->button.y = xbev->y; event->button.modifier_state = xbev->state; event->button.button = xbev->button; - event->button.device + event->button.device = (ClutterInputDevice *)_clutter_x11_get_device_for_xid (xbev->deviceid); break; } set_user_time (backend_x11, &xwindow, xbev->time); - CLUTTER_NOTE(EVENT, "XINPUT Button press event for %li %d %d", + CLUTTER_NOTE(EVENT, "XINPUT Button press event for %li %d %d", xbev->deviceid, xbev->x, xbev->y); - } - else if (xevent->type + } + else if (xevent->type == ev_types[CLUTTER_X11_XINPUT_BUTTON_RELEASE_EVENT]) { XDeviceButtonEvent *xbev = (XDeviceButtonEvent *)xevent; @@ -741,13 +741,13 @@ event->button.y = xbev->y; event->button.modifier_state = xbev->state; event->button.button = xbev->button; - event->button.device + event->button.device = (ClutterInputDevice *)_clutter_x11_get_device_for_xid (xbev->deviceid); - CLUTTER_NOTE(EVENT, "XINPUT Button release event for %li %d %d", + CLUTTER_NOTE(EVENT, "XINPUT Button release event for %li %d %d", xbev->deviceid, xbev->x, xbev->y); - } - else if (xevent->type - == ev_types [CLUTTER_X11_XINPUT_MOTION_NOTIFY_EVENT]) + } + else if (xevent->type + == ev_types [CLUTTER_X11_XINPUT_MOTION_NOTIFY_EVENT]) { XDeviceMotionEvent *xmev = (XDeviceMotionEvent *)xevent; @@ -756,45 +756,45 @@ event->motion.x = xmev->x; event->motion.y = xmev->y; event->motion.modifier_state = xmev->state; - event->motion.device + event->motion.device = (ClutterInputDevice *) _clutter_x11_get_device_for_xid (xmev->deviceid); - CLUTTER_NOTE(EVENT, "XINPUT Motion event for %li %d %d", - xmev->deviceid, - xmev->x, + CLUTTER_NOTE(EVENT, "XINPUT Motion event for %li %d %d", + xmev->deviceid, + xmev->x, xmev->y); - } + } #if 0 /* the Xinput handling of key presses/releases disabled for now since * it makes keyrepeat, and key presses and releases outside the window * not generate events even when the window has focus */ - else if (xevent->type - == ev_types [CLUTTER_X11_XINPUT_KEY_PRESS_EVENT]) + else if (xevent->type + == ev_types [CLUTTER_X11_XINPUT_KEY_PRESS_EVENT]) { XEvent xevent_converted; XDeviceKeyEvent *xkev = (XDeviceKeyEvent *)xevent; - + convert_xdevicekey_to_xkey (xkev, &xevent_converted); event->key.type = event->type = CLUTTER_KEY_PRESS; translate_key_event (backend, event, &xevent_converted); set_user_time (backend_x11, &xwindow, xkev->time); - } - else if (xevent->type - == ev_types [CLUTTER_X11_XINPUT_KEY_RELEASE_EVENT]) + } + else if (xevent->type + == ev_types [CLUTTER_X11_XINPUT_KEY_RELEASE_EVENT]) { XEvent xevent_converted; XDeviceKeyEvent *xkev = (XDeviceKeyEvent *)xevent; - + convert_xdevicekey_to_xkey (xkev, &xevent_converted); event->key.type = event->type = CLUTTER_KEY_RELEASE; translate_key_event (backend, event, &xevent_converted); } #endif - else + else #endif { CLUTTER_NOTE (EVENT, "Uknown Event"); @@ -803,7 +803,7 @@ } } - out: + out: return res; } Modified: projects/haf/trunk/clutter/clutter/x11/clutter-x11-texture-pixmap.c =================================================================== --- projects/haf/trunk/clutter/clutter/x11/clutter-x11-texture-pixmap.c 2009-01-12 12:18:56 UTC (rev 17097) +++ projects/haf/trunk/clutter/clutter/x11/clutter-x11-texture-pixmap.c 2009-01-12 12:25:34 UTC (rev 17098) @@ -312,6 +312,7 @@ r_damage[i].y, r_damage[i].width, r_damage[i].height); + g_debug("XDAMAGE END"); XFree (r_damage); } @@ -340,8 +341,13 @@ switch (xev->type) { case MapNotify: case ConfigureNotify: - clutter_x11_texture_pixmap_sync_window (texture); - break; + { + /* Only sync the window pixmap if the size has changed */ + if (xev->xconfigure.width != priv->pixmap_width || + xev->xconfigure.height != priv->pixmap_height) + clutter_x11_texture_pixmap_sync_window (texture); + break; + } case UnmapNotify: clutter_x11_texture_pixmap_set_mapped (texture, FALSE); break; @@ -740,7 +746,7 @@ gboolean data_allocated = FALSE; int err_code; char pixel_bpp; - gboolean pixel_has_alpha; + gboolean pixel_has_alpha; #if 0 clock_t start_t = clock(); @@ -816,7 +822,7 @@ clutter_x11_texture_pixmap_set_pixmap (texture, None); return; } - + if (priv->depth == 24) { bytes_per_line = image->bytes_per_line; @@ -825,7 +831,7 @@ pixel_has_alpha = FALSE; } else if (priv->depth == 16) - { + { bytes_per_line = image->bytes_per_line; data = first_pixel; pixel_bpp = 2; @@ -899,15 +905,15 @@ if (data_allocated) g_free (data); - + if (priv->have_shm) XFree (image); -#if 0 - clock_t end_t = clock(); +#if 0 + clock_t end_t = clock(); int time = (int)((double)(end_t - start_t) * (1000.0 / CLOCKS_PER_SEC)); g_print("clutter-x11-update-area-real(%d,%d,%d,%d) %d bits - %d ms\n",x,y,width,height,priv->depth,time); -#endif +#endif } /** Modified: projects/haf/trunk/clutter/debian/changelog =================================================================== --- projects/haf/trunk/clutter/debian/changelog 2009-01-12 12:18:56 UTC (rev 17097) +++ projects/haf/trunk/clutter/debian/changelog 2009-01-12 12:25:34 UTC (rev 17098) @@ -1,12 +1,20 @@ clutter (0.8.2-0maemo13~unreleased) unstable; urgency=low + * added cogl_modify_clip_viewport to allow rendering to a specific area (gw) + * Modified redraw_damage code to allow redraw using viewport rather than + glScissor (gw) + * Stopped eglx-texture-pixmap from creating a new texture on ANY change event, + and instead do it only when width/height/depth changes (gw) * Set up xevent handlers in clutter-x11-texture-pixmap.c only if XDAMAGE_HANDLING is defined. This avoids doing damage handling twice for application windows and should avoid some surprises in libmatchbox2 side. * Do not alter XComposite redirections in clutter-x11-texture-pixmap.c, that belongs to the window manager. + * Removed some un-needed log messages for EGLX textures (gw) + * Set damage to update the whole screen after a 'pick' event (as it will have + destroyed the buffer) - -- Gordon Williams <gordon.williams at collabora.co.uk> Mon, 29 Dec 2008 15:25:59 +0200 + -- Gordon Williams <gordon.williams at collabora.co.uk> Wed, 12 Jan 2009 12:17:52 +0000 clutter (0.8.2-0maemo12) unstable; urgency=low
- Previous message: [maemo-commits] r17097 - projects/haf/trunk/libglade2
- Next message: [maemo-commits] r17099 - projects/haf/trunk/clutter/clutter/x11
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]