e_comp_screen: set the fake output configuration
authorSooChan Lim <sc1.lim@samsung.com>
Tue, 4 Jul 2017 10:02:22 +0000 (19:02 +0900)
committerBoram Park <boram1288.park@samsung.com>
Wed, 5 Jul 2017 03:05:26 +0000 (12:05 +0900)
When there is no connected output, set the fake output
to initalize the ecore_evas engine.

Change-Id: I50f1b6c22fdd15be4a887a1302502b3f78cea232

src/bin/e_comp_screen.c
src/bin/e_output.c
src/bin/e_output.h

index e57a3f585344c26713429c310d46caf069ea958d..bd3b2580837af4aeada852f836b91db44b23096b 100644 (file)
@@ -629,6 +629,20 @@ _e_comp_screen_engine_init(void)
    /* get the size of the primary output */
    e_output_size_get(output, &scr_w, &scr_h);
 
+   /* if output is disconnected, set the default width, height */
+   if (scr_w == 0 || scr_h == 0)
+     {
+        scr_w = 1;
+        scr_h = 1;
+
+        if (!e_output_fake_config_set(output, w, h))
+          {
+             e_error_message_show(_("Fail to set the fake output config!\n"));
+             _e_comp_screen_engine_deinit();
+             return EINA_FALSE;
+          }
+     }
+
    INF("GL available:%d config engine:%d screen size:%dx%d",
        e_comp_gl_get(), e_comp_config_get()->engine, scr_w, scr_h);
 
index b145e624aa64be549356aac262c2958292e55a5d..6a77c9958044ce1db96629b60b8cf4e2852d61b9 100644 (file)
@@ -641,6 +641,25 @@ e_output_size_get(E_Output *output, int *w, int *h)
    *h = output->config.mode.h;
 }
 
+EINTERN Eina_Bool
+e_output_fake_config_set(E_Output *output, int w, int h)
+{
+   EINA_SAFETY_ON_NULL_RETURN_VAL(output, EINA_FALSE);
+
+   output->config.geom.x = 0;
+   output->config.geom.y = 0;
+   output->config.geom.w = w;
+   output->config.geom.h = h;
+
+   output->config.mode.w = w;
+   output->config.mode.h = h;
+   output->config.mode.refresh = 60;
+   output->config.enabled = 1;
+
+   return EINA_TRUE;
+}
+
+
 EINTERN Eina_Bool
 e_output_render(E_Output *output)
 {
index 08cae36c99a75bf78793eb64ed76654b8f1c81b7..ccab7452fe0491a7f4ce45607c0da2a23dff5517 100644 (file)
@@ -82,6 +82,7 @@ EINTERN Eina_Bool         e_output_connected(E_Output *output);
 EINTERN Eina_Bool         e_output_dpms_set(E_Output *output, E_OUTPUT_DPMS val);
 EINTERN void              e_output_size_get(E_Output *output, int *w, int *h);
 EINTERN E_Plane         * e_output_default_fb_target_get(E_Output *output);
+EINTERN Eina_Bool         e_output_fake_config_set(E_Output *output, int w, int h);
 E_API E_Output          * e_output_find(const char *id);
 E_API E_Output          * e_output_find_by_index(int index);
 E_API const Eina_List   * e_output_planes_get(E_Output *output);