From a27cc328485322cf22a5422d4ecb86c1d2e787d5 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Mon, 18 Mar 2019 14:03:17 -0400 Subject: [PATCH] elm_test: set accel for all glview tests these otherwise require the user to set ELM_ACCEL or manually change the config which is cumbersome Reviewed-by: Cedric BAIL Differential Revision: https://phab.enlightenment.org/D8392 --- src/bin/elementary/test_glview_manygears.c | 8 ++++++++ src/bin/elementary/test_glview_simple.c | 9 +++++++++ 2 files changed, 17 insertions(+) diff --git a/src/bin/elementary/test_glview_manygears.c b/src/bin/elementary/test_glview_manygears.c index 8ddac2a..31084b7 100644 --- a/src/bin/elementary/test_glview_manygears.c +++ b/src/bin/elementary/test_glview_manygears.c @@ -842,10 +842,18 @@ test_glview_manygears(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void if (!(gld = calloc(1, sizeof(GLData)))) return; gldata_init(gld); + // add a Z-depth buffer to the window and try to use GL + Eina_Stringshare *accel; + accel = eina_stringshare_add(elm_config_accel_preference_get()); + elm_config_accel_preference_set("gl:depth"); + // new window - do the usual and give it a name, title and delete handler win = elm_win_util_standard_add("glview_manygears", "GLView Many Gears"); elm_win_autodel_set(win, EINA_TRUE); + // restore previous accel preference + elm_config_accel_preference_set(accel); + eina_stringshare_del(accel); // add an image bg bg = elm_bg_add(win); diff --git a/src/bin/elementary/test_glview_simple.c b/src/bin/elementary/test_glview_simple.c index d621a98..9e34afe 100644 --- a/src/bin/elementary/test_glview_simple.c +++ b/src/bin/elementary/test_glview_simple.c @@ -233,10 +233,19 @@ test_glview_simple(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *e if (!(gld = calloc(1, sizeof(GL_Data)))) return; + // add a Z-depth buffer to the window and try to use GL + Eina_Stringshare *accel; + accel = eina_stringshare_add(elm_config_accel_preference_get()); + elm_config_accel_preference_set("gl:depth"); + win = elm_win_util_standard_add("glview-simple", "GLView Simple"); elm_win_autodel_set(win, EINA_TRUE); evas_object_event_callback_add(win, EVAS_CALLBACK_FREE, _win_free_cb, gld); + // restore previous accel preference + elm_config_accel_preference_set(accel); + eina_stringshare_del(accel); + bx = elm_box_add(win); evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_win_resize_object_add(win, bx); -- 2.7.4