clutter/stage: Rename update_resource_scales to clear_stage_views

When the stage views the stage is shown on are changed, ClutterStage
currently provides a clutter_stage_update_resource_scales() method
that allows invalidating the resource scales of all actors. With the new
stage-views API that's going to be added to ClutterActor, we also need a
method to invalidate the stage-views lists of actors in case the stage
views are rebuilt and fortunately we can re-use the infrastructure for
invalidating resource scales for that.

So since resource scales depend on the stage views an actor is on,
rename clutter_stage_update_resource_scales() and related methods to
clutter_stage_clear_stage_views(), which also covers resource scales.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1196
This commit is contained in:
Jonas Dreßler 2020-04-10 12:33:35 +02:00 committed by Carlos Garnacho
parent 670f4f22fe
commit 8127494e52
6 changed files with 11 additions and 11 deletions

View File

@ -313,7 +313,7 @@ void _clutter_actor_detach_clone
void _clutter_actor_queue_redraw_on_clones (ClutterActor *actor);
void _clutter_actor_queue_relayout_on_clones (ClutterActor *actor);
void _clutter_actor_queue_only_relayout (ClutterActor *actor);
void _clutter_actor_queue_update_resource_scale_recursive (ClutterActor *actor);
void clutter_actor_clear_stage_views_recursive (ClutterActor *actor);
gboolean _clutter_actor_get_real_resource_scale (ClutterActor *actor,
float *resource_scale);

View File

@ -17517,20 +17517,20 @@ _clutter_actor_compute_resource_scale (ClutterActor *self,
}
static ClutterActorTraverseVisitFlags
queue_update_resource_scale_cb (ClutterActor *actor,
int depth,
void *user_data)
clear_stage_views_cb (ClutterActor *actor,
int depth,
gpointer user_data)
{
actor->priv->needs_compute_resource_scale = TRUE;
return CLUTTER_ACTOR_TRAVERSE_VISIT_CONTINUE;
}
void
_clutter_actor_queue_update_resource_scale_recursive (ClutterActor *self)
clutter_actor_clear_stage_views_recursive (ClutterActor *self)
{
_clutter_actor_traverse (self,
CLUTTER_ACTOR_TRAVERSE_DEPTH_FIRST,
queue_update_resource_scale_cb,
clear_stage_views_cb,
NULL,
NULL);
}

View File

@ -75,7 +75,7 @@ CLUTTER_EXPORT
void clutter_stage_thaw_updates (ClutterStage *stage);
CLUTTER_EXPORT
void clutter_stage_update_resource_scales (ClutterStage *stage);
void clutter_stage_clear_stage_views (ClutterStage *stage);
CLUTTER_EXPORT
void clutter_stage_view_assign_next_scanout (ClutterStageView *stage_view,

View File

@ -4380,9 +4380,9 @@ clutter_stage_peek_stage_views (ClutterStage *stage)
}
void
clutter_stage_update_resource_scales (ClutterStage *stage)
clutter_stage_clear_stage_views (ClutterStage *stage)
{
_clutter_actor_queue_update_resource_scale_recursive (CLUTTER_ACTOR (stage));
clutter_actor_clear_stage_views_recursive (CLUTTER_ACTOR (stage));
}
GList *

View File

@ -140,7 +140,7 @@ meta_stage_native_rebuild_views (MetaStageNative *stage_native)
ClutterActor *stage = meta_backend_get_stage (backend);
meta_renderer_rebuild_views (renderer);
clutter_stage_update_resource_scales (CLUTTER_STAGE (stage));
clutter_stage_clear_stage_views (CLUTTER_STAGE (stage));
ensure_frame_callbacks (stage_native);
}

View File

@ -87,7 +87,7 @@ meta_backend_x11_nested_update_screen_size (MetaBackend *backend,
if (meta_is_stage_views_enabled ())
{
meta_renderer_rebuild_views (renderer);
clutter_stage_update_resource_scales (CLUTTER_STAGE (stage));
clutter_stage_clear_stage_views (CLUTTER_STAGE (stage));
}
clutter_actor_set_size (stage, width, height);
}