clutter/actor: Get Backend from associated actor context
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3977>
This commit is contained in:
parent
f49a2a3370
commit
617a3aa58b
1 changed files with 12 additions and 8 deletions
|
@ -3072,11 +3072,12 @@ _clutter_actor_draw_paint_volume_full (ClutterActor *self,
|
||||||
CoglPrimitive *prim;
|
CoglPrimitive *prim;
|
||||||
graphene_point3d_t line_ends[12 * 2];
|
graphene_point3d_t line_ends[12 * 2];
|
||||||
int n_vertices;
|
int n_vertices;
|
||||||
CoglContext *ctx =
|
ClutterContext *context = clutter_actor_get_context (self);
|
||||||
clutter_backend_get_cogl_context (clutter_get_default_backend ());
|
ClutterBackend *backend = clutter_context_get_backend (context);
|
||||||
|
CoglContext *cogl_context = clutter_backend_get_cogl_context (backend);
|
||||||
|
|
||||||
if (outline == NULL)
|
if (outline == NULL)
|
||||||
outline = cogl_pipeline_new (ctx);
|
outline = cogl_pipeline_new (cogl_context);
|
||||||
|
|
||||||
_clutter_paint_volume_complete (pv);
|
_clutter_paint_volume_complete (pv);
|
||||||
|
|
||||||
|
@ -3103,7 +3104,7 @@ _clutter_actor_draw_paint_volume_full (ClutterActor *self,
|
||||||
line_ends[22] = pv->vertices[3]; line_ends[23] = pv->vertices[7];
|
line_ends[22] = pv->vertices[3]; line_ends[23] = pv->vertices[7];
|
||||||
}
|
}
|
||||||
|
|
||||||
prim = cogl_primitive_new_p3 (ctx, COGL_VERTICES_MODE_LINES,
|
prim = cogl_primitive_new_p3 (cogl_context, COGL_VERTICES_MODE_LINES,
|
||||||
n_vertices,
|
n_vertices,
|
||||||
(CoglVertexP3 *)line_ends);
|
(CoglVertexP3 *)line_ends);
|
||||||
|
|
||||||
|
@ -5333,7 +5334,8 @@ clutter_actor_dispose (GObject *object)
|
||||||
{
|
{
|
||||||
ClutterActor *self = CLUTTER_ACTOR (object);
|
ClutterActor *self = CLUTTER_ACTOR (object);
|
||||||
ClutterActorPrivate *priv = self->priv;
|
ClutterActorPrivate *priv = self->priv;
|
||||||
ClutterBackend *backend = clutter_get_default_backend ();
|
ClutterContext *context = clutter_actor_get_context (self);
|
||||||
|
ClutterBackend *backend = clutter_context_get_backend (context);
|
||||||
|
|
||||||
CLUTTER_NOTE (MISC, "Dispose actor (name='%s', ref_count:%d) of type '%s'",
|
CLUTTER_NOTE (MISC, "Dispose actor (name='%s', ref_count:%d) of type '%s'",
|
||||||
_clutter_actor_get_debug_name (self),
|
_clutter_actor_get_debug_name (self),
|
||||||
|
@ -13085,7 +13087,8 @@ PangoContext *
|
||||||
clutter_actor_get_pango_context (ClutterActor *self)
|
clutter_actor_get_pango_context (ClutterActor *self)
|
||||||
{
|
{
|
||||||
ClutterActorPrivate *priv;
|
ClutterActorPrivate *priv;
|
||||||
ClutterBackend *backend = clutter_get_default_backend ();
|
ClutterContext *context = clutter_actor_get_context (self);
|
||||||
|
ClutterBackend *backend = clutter_context_get_backend (context);
|
||||||
|
|
||||||
g_return_val_if_fail (CLUTTER_IS_ACTOR (self), NULL);
|
g_return_val_if_fail (CLUTTER_IS_ACTOR (self), NULL);
|
||||||
|
|
||||||
|
@ -13132,7 +13135,7 @@ clutter_actor_create_pango_context (ClutterActor *self)
|
||||||
font_map = clutter_context_get_pango_fontmap (context);
|
font_map = clutter_context_get_pango_fontmap (context);
|
||||||
|
|
||||||
pango_context = cogl_pango_font_map_create_context (font_map);
|
pango_context = cogl_pango_font_map_create_context (font_map);
|
||||||
update_pango_context (clutter_get_default_backend (), pango_context);
|
update_pango_context (clutter_context_get_backend (context), pango_context);
|
||||||
pango_context_set_language (pango_context, pango_language_get_default ());
|
pango_context_set_language (pango_context, pango_language_get_default ());
|
||||||
|
|
||||||
return pango_context;
|
return pango_context;
|
||||||
|
@ -14679,7 +14682,8 @@ clutter_actor_get_real_resource_scale (ClutterActor *self)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ClutterBackend *backend = clutter_get_default_backend ();
|
ClutterContext *context = clutter_actor_get_context (self);
|
||||||
|
ClutterBackend *backend = clutter_context_get_backend (context);
|
||||||
|
|
||||||
guessed_scale = clutter_backend_get_fallback_resource_scale (backend);
|
guessed_scale = clutter_backend_get_fallback_resource_scale (backend);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue