diff --git a/src/compositor/clutter-utils.c b/src/compositor/clutter-utils.c index 86d788562..95839c2df 100644 --- a/src/compositor/clutter-utils.c +++ b/src/compositor/clutter-utils.c @@ -69,8 +69,7 @@ gboolean meta_actor_vertices_are_untransformed (graphene_point3d_t *verts, float widthf, float heightf, - int *x_origin, - int *y_origin) + MetaTransforms *out_transforms) { int width, height; int v0x, v0y, v1x, v1y, v2x, v2y, v3x, v3y; @@ -90,6 +89,14 @@ meta_actor_vertices_are_untransformed (graphene_point3d_t *verts, x = v0x >> 8; y = v0y >> 8; + if (out_transforms) + { + out_transforms->x_origin = x; + out_transforms->y_origin = y; + out_transforms->x_scale = (v1x - v0x) / (float) width; + out_transforms->y_scale = (v2y - v0y) / (float) height; + } + /* At integral coordinates? */ if (x * 256 != v0x || y * 256 != v0y) return FALSE; @@ -103,11 +110,6 @@ meta_actor_vertices_are_untransformed (graphene_point3d_t *verts, v3x != v1x || v3y != v2y) return FALSE; - if (x_origin) - *x_origin = x; - if (y_origin) - *y_origin = y; - return TRUE; } @@ -137,8 +139,7 @@ meta_actor_painting_untransformed (CoglFramebuffer *fb, int paint_height, int sample_width, int sample_height, - int *x_origin, - int *y_origin) + MetaTransforms *out_transforms) { graphene_matrix_t modelview, projection, modelview_projection; graphene_point3d_t vertices[4]; @@ -183,6 +184,6 @@ meta_actor_painting_untransformed (CoglFramebuffer *fb, return meta_actor_vertices_are_untransformed (vertices, sample_width, sample_height, - x_origin, y_origin); + out_transforms); } diff --git a/src/compositor/clutter-utils.h b/src/compositor/clutter-utils.h index 8ed0e2a4d..921551aaf 100644 --- a/src/compositor/clutter-utils.h +++ b/src/compositor/clutter-utils.h @@ -23,18 +23,21 @@ #include "clutter/clutter.h" +typedef struct { + int x_origin, y_origin; + float x_scale, y_scale; +} MetaTransforms; + gboolean meta_actor_vertices_are_untransformed (graphene_point3d_t *verts, float widthf, float heightf, - int *x_origin, - int *y_origin); + MetaTransforms *out_transforms); gboolean meta_actor_painting_untransformed (CoglFramebuffer *fb, int paint_width, int paint_height, int sample_widthf, int sample_heightf, - int *x_origin, - int *y_origin); + MetaTransforms *out_transforms); #endif /* __META_CLUTTER_UTILS_H__ */ diff --git a/src/compositor/meta-background-content.c b/src/compositor/meta-background-content.c index 2e8c923b4..e472c3c5d 100644 --- a/src/compositor/meta-background-content.c +++ b/src/compositor/meta-background-content.c @@ -548,7 +548,7 @@ setup_pipeline (MetaBackgroundContent *self, actor_pixel_rect->height, self->texture_width, self->texture_height, - NULL, NULL)) + NULL)) { min_filter = COGL_PIPELINE_FILTER_NEAREST; mag_filter = COGL_PIPELINE_FILTER_NEAREST; diff --git a/src/compositor/meta-cullable.c b/src/compositor/meta-cullable.c index 6f38c5e47..e306c56e2 100644 --- a/src/compositor/meta-cullable.c +++ b/src/compositor/meta-cullable.c @@ -175,7 +175,7 @@ meta_cullable_default_is_untransformed (MetaCullable *cullable) clutter_actor_get_abs_allocation_vertices (CLUTTER_ACTOR (cullable), verts); return meta_actor_vertices_are_untransformed (verts, width, height, - NULL, NULL); + NULL); } static void diff --git a/src/compositor/meta-shaped-texture.c b/src/compositor/meta-shaped-texture.c index d7cba799e..29a6b1c90 100644 --- a/src/compositor/meta-shaped-texture.c +++ b/src/compositor/meta-shaped-texture.c @@ -712,7 +712,7 @@ do_paint_content (MetaShapedTexture *stex, if (meta_actor_painting_untransformed (framebuffer, dst_width, dst_height, sample_width, sample_height, - NULL, NULL)) + NULL)) filter = COGL_PIPELINE_FILTER_NEAREST; else filter = COGL_PIPELINE_FILTER_LINEAR; diff --git a/src/compositor/meta-surface-actor.c b/src/compositor/meta-surface-actor.c index c2bf6696a..fcd94b86d 100644 --- a/src/compositor/meta-surface-actor.c +++ b/src/compositor/meta-surface-actor.c @@ -331,7 +331,7 @@ meta_surface_actor_is_untransformed (MetaCullable *cullable) return meta_actor_vertices_are_untransformed (verts, width * geometry_scale, height * geometry_scale, - NULL, NULL); + NULL); } static void diff --git a/src/compositor/meta-window-group.c b/src/compositor/meta-window-group.c index 16ff2db09..c6af609ae 100644 --- a/src/compositor/meta-window-group.c +++ b/src/compositor/meta-window-group.c @@ -92,6 +92,7 @@ meta_window_group_paint (ClutterActor *actor, { CoglFramebuffer *fb; ClutterStageView *view; + MetaTransforms trans; fb = clutter_paint_context_get_framebuffer (paint_context); view = clutter_paint_context_get_stage_view (paint_context); @@ -102,13 +103,15 @@ meta_window_group_paint (ClutterActor *actor, screen_height, screen_width, screen_height, - &paint_x_origin, - &paint_y_origin) || + &trans) || !meta_cullable_is_untransformed (META_CULLABLE (actor))) { parent_actor_class->paint (actor, paint_context); return; } + + paint_x_origin = trans.x_origin; + paint_y_origin = trans.y_origin; } else {