st: Report correct paint volumes during transitions
StWidget reports a paint volume large enough to paint the current theme node. As CSS transitions also paint the previous theme node, the reported paint volume may be incorrect, resulting in screen artifacts when painting outside the reported volume. Add st_theme_node_transition_get_paint_box() to calculate an allocation large enough to paint both theme nodes, and use it to report the correct paint volume during transitions. https://bugzilla.gnome.org/show_bug.cgi?id=640085
This commit is contained in:
@ -182,6 +182,22 @@ st_theme_node_transition_update (StThemeNodeTransition *transition,
|
||||
static void
|
||||
calculate_offscreen_box (StThemeNodeTransition *transition,
|
||||
const ClutterActorBox *allocation)
|
||||
{
|
||||
ClutterActorBox paint_box;
|
||||
|
||||
st_theme_node_transition_get_paint_box (transition,
|
||||
allocation,
|
||||
&paint_box);
|
||||
transition->priv->offscreen_box.x1 = paint_box.x1 - allocation->x1;
|
||||
transition->priv->offscreen_box.y1 = paint_box.y1 - allocation->y1;
|
||||
transition->priv->offscreen_box.x2 = paint_box.x2 - allocation->x1;
|
||||
transition->priv->offscreen_box.y2 = paint_box.y2 - allocation->y1;
|
||||
}
|
||||
|
||||
void
|
||||
st_theme_node_transition_get_paint_box (StThemeNodeTransition *transition,
|
||||
const ClutterActorBox *allocation,
|
||||
ClutterActorBox *paint_box)
|
||||
{
|
||||
StThemeNodeTransitionPrivate *priv = transition->priv;
|
||||
ClutterActorBox old_node_box, new_node_box;
|
||||
@ -194,14 +210,10 @@ calculate_offscreen_box (StThemeNodeTransition *transition,
|
||||
allocation,
|
||||
&new_node_box);
|
||||
|
||||
priv->offscreen_box.x1 = MIN (old_node_box.x1, new_node_box.x1)
|
||||
- allocation->x1;
|
||||
priv->offscreen_box.y1 = MIN (old_node_box.y1, new_node_box.y1)
|
||||
- allocation->y1;
|
||||
priv->offscreen_box.x2 = MAX (old_node_box.x2, new_node_box.x2)
|
||||
- allocation->x1;
|
||||
priv->offscreen_box.y2 = MAX (old_node_box.y2, new_node_box.y2)
|
||||
- allocation->y1;
|
||||
paint_box->x1 = MIN (old_node_box.x1, new_node_box.x1);
|
||||
paint_box->y1 = MIN (old_node_box.y1, new_node_box.y1);
|
||||
paint_box->x2 = MAX (old_node_box.x2, new_node_box.x2);
|
||||
paint_box->y2 = MAX (old_node_box.y2, new_node_box.y2);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
Reference in New Issue
Block a user