mirror of
https://github.com/brl/mutter.git
synced 2024-12-27 05:12:15 +00:00
tests/kms/render: Get backend from context
Avoids a couple of singleton accesses. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2417>
This commit is contained in:
parent
a8c2df6fb5
commit
f76258b840
@ -29,6 +29,8 @@ typedef struct
|
|||||||
GMainLoop *loop;
|
GMainLoop *loop;
|
||||||
} KmsRenderingTest;
|
} KmsRenderingTest;
|
||||||
|
|
||||||
|
static MetaContext *test_context;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
on_after_update (ClutterStage *stage,
|
on_after_update (ClutterStage *stage,
|
||||||
ClutterStageView *stage_view,
|
ClutterStageView *stage_view,
|
||||||
@ -44,7 +46,7 @@ on_after_update (ClutterStage *stage,
|
|||||||
static void
|
static void
|
||||||
meta_test_kms_render_basic (void)
|
meta_test_kms_render_basic (void)
|
||||||
{
|
{
|
||||||
MetaBackend *backend = meta_get_backend ();
|
MetaBackend *backend = meta_context_get_backend (test_context);
|
||||||
ClutterActor *stage = meta_backend_get_stage (backend);
|
ClutterActor *stage = meta_backend_get_stage (backend);
|
||||||
KmsRenderingTest test;
|
KmsRenderingTest test;
|
||||||
|
|
||||||
@ -79,6 +81,8 @@ main (int argc,
|
|||||||
META_CONTEXT_TEST_FLAG_NO_X11);
|
META_CONTEXT_TEST_FLAG_NO_X11);
|
||||||
g_assert (meta_context_configure (context, &argc, &argv, NULL));
|
g_assert (meta_context_configure (context, &argc, &argv, NULL));
|
||||||
|
|
||||||
|
test_context = context;
|
||||||
|
|
||||||
init_tests ();
|
init_tests ();
|
||||||
|
|
||||||
return meta_context_test_run_tests (META_CONTEXT_TEST (context),
|
return meta_context_test_run_tests (META_CONTEXT_TEST (context),
|
||||||
|
Loading…
Reference in New Issue
Block a user