GNOME Bugzilla – Bug 681953
MetaWindowGroup: Handle painting inside a ClutterClone
Last modified: 2012-08-16 00:48:17 UTC
Look at the current COGL model-view matrix and use that to find out any offset we are painting at as a result of being inside a ClutterClone.
Created attachment 221331 [details] [review] MetaWindowGroup: Handle painting inside a ClutterClone
Review of attachment 221331 [details] [review]: I'm curious if we can skip the whole origin calculation in the case that we know we're not in a clone paint. Math seems correct, but I didn't investigate too much. Mostly cosmetic fixes. Welcome to land as-is. ::: src/compositor/meta-window-group.c @@ +126,3 @@ +#define MTX_GL_SCALE_X(x,w,v1,v2) ((((((x) / (w)) + 1.0f) / 2.0f) * (v1)) + (v2)) +#define MTX_GL_SCALE_Y(y,w,v1,v2) ((v1) - (((((y) / (w)) + 1.0f) / 2.0f) * (v1)) + (v2)) + Z is unused. @@ +151,3 @@ + meta_screen_get_size (window_group->screen, &width, &height); + + If you don't care about ANSI C, this is probably a lot cleaner with an initializer. @@ +164,3 @@ + vertices[3].z = 0; + +painting_untransformed (MetaWindowGroup *window_group, Not ANSI C. @@ +169,3 @@ + for (i = 0; i < 4; i++) + { +{ Why the initializing?
Thanks for the review - I decided to not go the C99 route because I'm not sure if we're doing it anywhere else - and adding it here felt like pulling on a string (do we need to add AC_PROG_CC_C99 to get the right compiler options? if we do that, do we need to change autogen.sh so that autoconf-2.60 is required? what is the GNOME minimum version?) It would conceptually be fine though, and does make that code block more readable The initialization of w is there because clutter_matrix_transform_point is in-out. Attachment 221331 [details] pushed as c27b4b7 - MetaWindowGroup: Handle painting inside a ClutterClone
We use C99-style initializers in meta-window-actor.c, which you OKed a little while ago.