summaryrefslogtreecommitdiff
path: root/src/modules/ecore_evas/engines/sdl
diff options
context:
space:
mode:
authorCedric Bail <cedric@osg.samsung.com>2018-04-02 14:55:57 -0700
committerCedric Bail <cedric@osg.samsung.com>2018-04-02 15:12:31 -0700
commita44697c37a304c0d4d574b6772775c6936869e24 (patch)
treef70f6c1e2056d44bf5c0240e3b850c4c6f948a1b /src/modules/ecore_evas/engines/sdl
parent94433af83a0a0560df32d47d7f48a136b16e0d80 (diff)
ecore_evas: refactor logic for creating Ecore_Evas.
Diffstat (limited to 'src/modules/ecore_evas/engines/sdl')
-rw-r--r--src/modules/ecore_evas/engines/sdl/ecore_evas_sdl.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/src/modules/ecore_evas/engines/sdl/ecore_evas_sdl.c b/src/modules/ecore_evas/engines/sdl/ecore_evas_sdl.c
index a6ddee93d2..8abc7401b6 100644
--- a/src/modules/ecore_evas/engines/sdl/ecore_evas_sdl.c
+++ b/src/modules/ecore_evas/engines/sdl/ecore_evas_sdl.c
@@ -510,12 +510,13 @@ _ecore_evas_internal_sdl_new(int rmethod, const char* name, int w, int h, int fu
510 ee->prop.hwsurface = hwsurface; 510 ee->prop.hwsurface = hwsurface;
511 511
512 /* init evas here */ 512 /* init evas here */
513 ee->evas = evas_new(); 513 if (!ecore_evas_evas_new(ee, w, h))
514 evas_data_attach_set(ee->evas, ee); 514 {
515 evas_output_method_set(ee->evas, rmethod); 515 ERR("Can not create Canvas.");
516 goto on_error;
517 }
516 518
517 evas_output_size_set(ee->evas, w, h); 519 evas_output_method_set(ee->evas, rmethod);
518 evas_output_viewport_set(ee->evas, 0, 0, w, h);
519 520
520 gl = !(rmethod == evas_render_method_lookup("buffer")); 521 gl = !(rmethod == evas_render_method_lookup("buffer"));
521 ee->can_async_render = gl ? EINA_FALSE : EINA_TRUE; 522 ee->can_async_render = gl ? EINA_FALSE : EINA_TRUE;
@@ -611,19 +612,13 @@ _ecore_evas_internal_sdl_new(int rmethod, const char* name, int w, int h, int fu
611 } 612 }
612 613
613 _ecore_evas_sdl_init(w, h); 614 _ecore_evas_sdl_init(w, h);
615 ee->prop.window = SDL_GetWindowID(swd->w);
614 616
615 ecore_event_window_register(SDL_GetWindowID(swd->w), ee, ee->evas, 617 ecore_evas_done(ee, EINA_FALSE);
616 (Ecore_Event_Mouse_Move_Cb)_ecore_evas_mouse_move_process,
617 (Ecore_Event_Multi_Move_Cb)_ecore_evas_mouse_multi_move_process,
618 (Ecore_Event_Multi_Down_Cb)_ecore_evas_mouse_multi_down_process,
619 (Ecore_Event_Multi_Up_Cb)_ecore_evas_mouse_multi_up_process);
620 _ecore_event_window_direct_cb_set(SDL_GetWindowID(swd->w), _ecore_evas_input_direct_cb);
621 SDL_SetWindowData(swd->w, "_Ecore_Evas", ee);
622 618
619 SDL_SetWindowData(swd->w, "_Ecore_Evas", ee);
623 SDL_ShowCursor(SDL_ENABLE); 620 SDL_ShowCursor(SDL_ENABLE);
624 621
625 _ecore_evas_register(ee);
626
627 _ecore_evas_focus_device_set(ee, NULL, EINA_TRUE); 622 _ecore_evas_focus_device_set(ee, NULL, EINA_TRUE);
628 ecore_evas_sdl_count++; 623 ecore_evas_sdl_count++;
629 return ee; 624 return ee;