clutter/pick-context: Get CoglContext from actor context
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3977>
This commit is contained in:
parent
617a3aa58b
commit
b3da64c20e
@ -22,6 +22,7 @@
|
|||||||
|
|
||||||
ClutterPickContext *
|
ClutterPickContext *
|
||||||
clutter_pick_context_new_for_view (ClutterStageView *view,
|
clutter_pick_context_new_for_view (ClutterStageView *view,
|
||||||
|
CoglContext *cogl_context,
|
||||||
ClutterPickMode mode,
|
ClutterPickMode mode,
|
||||||
const graphene_point3d_t *point,
|
const graphene_point3d_t *point,
|
||||||
const graphene_ray_t *ray);
|
const graphene_ray_t *ray);
|
||||||
|
@ -37,12 +37,12 @@ G_DEFINE_BOXED_TYPE (ClutterPickContext, clutter_pick_context,
|
|||||||
|
|
||||||
ClutterPickContext *
|
ClutterPickContext *
|
||||||
clutter_pick_context_new_for_view (ClutterStageView *view,
|
clutter_pick_context_new_for_view (ClutterStageView *view,
|
||||||
|
CoglContext *cogl_context,
|
||||||
ClutterPickMode mode,
|
ClutterPickMode mode,
|
||||||
const graphene_point3d_t *point,
|
const graphene_point3d_t *point,
|
||||||
const graphene_ray_t *ray)
|
const graphene_ray_t *ray)
|
||||||
{
|
{
|
||||||
ClutterPickContext *pick_context;
|
ClutterPickContext *pick_context;
|
||||||
CoglContext *context;
|
|
||||||
|
|
||||||
pick_context = g_new0 (ClutterPickContext, 1);
|
pick_context = g_new0 (ClutterPickContext, 1);
|
||||||
g_ref_count_init (&pick_context->ref_count);
|
g_ref_count_init (&pick_context->ref_count);
|
||||||
@ -50,8 +50,7 @@ clutter_pick_context_new_for_view (ClutterStageView *view,
|
|||||||
graphene_ray_init_from_ray (&pick_context->ray, ray);
|
graphene_ray_init_from_ray (&pick_context->ray, ray);
|
||||||
graphene_point3d_init_from_point (&pick_context->point, point);
|
graphene_point3d_init_from_point (&pick_context->point, point);
|
||||||
|
|
||||||
context = clutter_backend_get_cogl_context (clutter_get_default_backend ());
|
pick_context->pick_stack = clutter_pick_stack_new (cogl_context);
|
||||||
pick_context->pick_stack = clutter_pick_stack_new (context);
|
|
||||||
|
|
||||||
return pick_context;
|
return pick_context;
|
||||||
}
|
}
|
||||||
|
@ -1051,7 +1051,10 @@ _clutter_stage_do_pick_on_view (ClutterStage *stage,
|
|||||||
MtkRegion **clear_area)
|
MtkRegion **clear_area)
|
||||||
{
|
{
|
||||||
g_autoptr (ClutterPickStack) pick_stack = NULL;
|
g_autoptr (ClutterPickStack) pick_stack = NULL;
|
||||||
|
ClutterContext *context;
|
||||||
|
ClutterBackend *backend;
|
||||||
ClutterPickContext *pick_context;
|
ClutterPickContext *pick_context;
|
||||||
|
CoglContext *cogl_context;
|
||||||
graphene_point3d_t p;
|
graphene_point3d_t p;
|
||||||
graphene_ray_t ray;
|
graphene_ray_t ray;
|
||||||
ClutterActor *actor;
|
ClutterActor *actor;
|
||||||
@ -1060,7 +1063,10 @@ _clutter_stage_do_pick_on_view (ClutterStage *stage,
|
|||||||
|
|
||||||
setup_ray_for_coordinates (stage, x, y, &p, &ray);
|
setup_ray_for_coordinates (stage, x, y, &p, &ray);
|
||||||
|
|
||||||
pick_context = clutter_pick_context_new_for_view (view, mode, &p, &ray);
|
context = clutter_actor_get_context (CLUTTER_ACTOR (stage));
|
||||||
|
backend = clutter_context_get_backend (context);
|
||||||
|
cogl_context = clutter_backend_get_cogl_context (backend);
|
||||||
|
pick_context = clutter_pick_context_new_for_view (view, cogl_context, mode, &p, &ray);
|
||||||
|
|
||||||
clutter_actor_pick (CLUTTER_ACTOR (stage), pick_context);
|
clutter_actor_pick (CLUTTER_ACTOR (stage), pick_context);
|
||||||
pick_stack = clutter_pick_context_steal_stack (pick_context);
|
pick_stack = clutter_pick_context_steal_stack (pick_context);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user