GNOME Bugzilla – Bug 654551
meta-window-group: Use clutter_stage_get_redraw_clip_bounds
Last modified: 2011-07-13 15:42:48 UTC
Clutter now has some API to get the redraw clip bounds so Mutter should use it to avoid the layering violation of accessing GL directly. For reference see: https://bugzilla.gnome.org/show_bug.cgi?id=634779 http://bugzilla.clutter-project.org/show_bug.cgi?id=2421
Created attachment 191878 [details] [review] meta-window-group: Use clutter_stage_get_redraw_clip_bounds Clutter now has some API to get the bounds of the current redraw clip so Mutter no longer needs to make direct GL calls to get the scissor rect. This should make it more robust against Cogl or Clutter changing how it does the clipping.
Review of attachment 191878 [details] [review]: Cool, good to get rid of the scissor stuff! Would like to see the clutter version in configure.ac bumped ::: src/compositor/meta-window-group.c @@ +124,3 @@ + meta_screen_get_size (window_group->screen, + &visible_rect.width, + &visible_rect.height); Do we need this? We're assuming here (because we're assuming stage coordinates == screen coordinates) that the stage is coextensive with the screen, so it seems like get_redraw_clip_bounds() always gives us the rectangle that we want to start with. @@ +130,3 @@ + * that don't need to be painted in this frame */ + stage = clutter_actor_get_stage (actor); + if (stage) How could we be painting an actor not in a stage? Can't we just assume a stage inside paint?
(In reply to comment #1) > Created an attachment (id=191878) [details] [review] > meta-window-group: Use clutter_stage_get_redraw_clip_bounds On a side note, quick testing suggests that this patch fixes some redraw issues I was experiencing since our switch to clutter master.
Created attachment 191894 [details] [review] meta-window-group: Use clutter_stage_get_redraw_clip_bounds Here's an updated patch with the three changes that Owen suggested.
Review of attachment 191894 [details] [review]: ::: src/compositor/meta-window-group.c @@ +118,3 @@ + /* Get the clipped redraw bounds from Clutter so that we can avoid + * painting shadows on windows that don't need to be painted in this + * frame */ Looks good. If you wanted, before committing, maybe add the note about monitors back here: frame. In the case of a multihead setup with mismatched monitor sizes, we could intersect this with an accurate union of the monitors to avoid painting shadows that are visible only in the holes.
Ok, I've pushed it as 4167ef with the comment about monitors. Thanks.