3 #include <Elementary.h>
11 /************************************************************************/
12 /* Common Infrastructure Code */
13 /************************************************************************/
15 void tvgSwTest(uint32_t* buffer);
16 void drawSwView(void* data, Eo* obj);
18 void win_del(void *data, Evas_Object *o, void *ev)
23 static Eo* createSwView()
25 static uint32_t buffer[WIDTH * HEIGHT];
27 Eo* win = elm_win_util_standard_add(NULL, "ThorVG Test");
28 evas_object_smart_callback_add(win, "delete,request", win_del, 0);
30 Eo* view = evas_object_image_filled_add(evas_object_evas_get(win));
31 evas_object_image_size_set(view, WIDTH, HEIGHT);
32 evas_object_image_data_set(view, buffer);
33 evas_object_image_pixels_get_callback_set(view, drawSwView, nullptr);
34 evas_object_image_pixels_dirty_set(view, EINA_TRUE);
35 evas_object_image_data_update_add(view, 0, 0, WIDTH, HEIGHT);
36 evas_object_size_hint_weight_set(view, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
37 evas_object_show(view);
39 elm_win_resize_object_add(win, view);
40 evas_object_geometry_set(win, 0, 0, WIDTH, HEIGHT);
41 evas_object_show(win);
48 void initGLview(Evas_Object *obj);
49 void drawGLview(Evas_Object *obj);
51 static Eo* createGlView()
53 elm_config_accel_preference_set("gl");
55 Eo* win = elm_win_util_standard_add(NULL, "ThorVG Test");
56 evas_object_smart_callback_add(win, "delete,request", win_del, 0);
58 Eo* view = elm_glview_add(win);
59 evas_object_size_hint_weight_set(view, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
60 elm_glview_mode_set(view, ELM_GLVIEW_ALPHA);
61 elm_glview_resize_policy_set(view, ELM_GLVIEW_RESIZE_POLICY_RECREATE);
62 elm_glview_render_policy_set(view, ELM_GLVIEW_RENDER_POLICY_ON_DEMAND);
63 elm_glview_init_func_set(view, initGLview);
64 elm_glview_render_func_set(view, drawGLview);
65 evas_object_show(view);
67 elm_win_resize_object_add(win, view);
68 evas_object_geometry_set(win, 0, 0, WIDTH, HEIGHT);
69 evas_object_show(win);