After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 681953 - MetaWindowGroup: Handle painting inside a ClutterClone
MetaWindowGroup: Handle painting inside a ClutterClone
Status: RESOLVED FIXED
Product: mutter
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: mutter-maint
mutter-maint
Depends on:
Blocks:
 
 
Reported: 2012-08-15 23:09 UTC by Owen Taylor
Modified: 2012-08-16 00:48 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
MetaWindowGroup: Handle painting inside a ClutterClone (9.76 KB, patch)
2012-08-15 23:09 UTC, Owen Taylor
committed Details | Review

Description Owen Taylor 2012-08-15 23:09:45 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.
Comment 1 Owen Taylor 2012-08-15 23:09:47 UTC
Created attachment 221331 [details] [review]
MetaWindowGroup: Handle painting inside a ClutterClone
Comment 2 Jasper St. Pierre (not reading bugmail) 2012-08-15 23:50:53 UTC
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?
Comment 3 Owen Taylor 2012-08-16 00:46:33 UTC
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
Comment 4 Jasper St. Pierre (not reading bugmail) 2012-08-16 00:48:17 UTC
We use C99-style initializers in meta-window-actor.c, which you OKed a little while ago.