[EvasGL] Fix the bug as EvasGL can not find the config. 36/117436/2
authorWonsik, Jung <sidein@samsung.com>
Mon, 6 Mar 2017 05:56:06 +0000 (14:56 +0900)
committerGerrit Code Review <gerrit@review.vlan103.tizen.org>
Mon, 6 Mar 2017 07:03:22 +0000 (23:03 -0800)
If the EvasGL's capability values are as the below, evas gl can not find the cfg.
Because depth, stencil and msaa values are reset by window's cfg unlimited.
So, this patch is that the reset work runs only once.

[Index] [Color Format]  [------Depth Bits------]      [----Stencil Bits---]     [---Depth_Stencil---]  [Samples]
  0      GL_RGB                            0                          0                          0      0
  1      GL_RGB                            0          GL_STENCIL_INDEX8                          0      0
  2      GL_RGB                            0                          0       GL_DEPTH_STENCIL_OES      0
  3      GL_RGB         GL_DEPTH_COMPONENT16                          0                          0      0
  4      GL_RGB     GL_DEPTH_COMPONENT24_OES                          0                          0      0
  5     GL_RGBA                            0                          0                          0      0
  6     GL_RGBA                            0          GL_STENCIL_INDEX8                          0      0
  7     GL_RGBA                            0                          0       GL_DEPTH_STENCIL_OES      0
  8     GL_RGBA         GL_DEPTH_COMPONENT16                          0                          0      0
  9     GL_RGBA     GL_DEPTH_COMPONENT24_OES                          0                          0      0
 10      GL_RGB                            0                          0                          0      2
 11     GL_RGBA                            0                          0                          0      2
 12      GL_RGB                            0                          0                          0      4
 13     GL_RGBA                            0                          0                          0      4
 14      GL_RGB                            0                          0                          0      8
 15     GL_RGBA                            0                          0                          0      8

Change-Id: I0cbbc6d7b5167884246f88eeef0958f163552c08

src/modules/evas/engines/gl_common/evas_gl_core.c

index e9c2eea..73912fe 100644 (file)
@@ -1439,6 +1439,7 @@ _internal_config_set(void *eng_data, EVGL_Surface *sfc, Evas_GL_Config *cfg)
    int depth_size = 0;
    int native_win_depth = 0, native_win_stencil = 0, native_win_msaa = 0;
    Eina_Bool support_win_cfg = 1;
+   int updated_by_wincfg = 0;
 
    // Check if engine is valid
    if (!evgl_engine)
@@ -1532,7 +1533,7 @@ try_again:
              // When direct rendering is enabled, FBO configuration should match
              // window surface configuration as FBO will be used in fallback cases.
              // So we search again for the formats that match window surface's.
-             if (sfc->direct_fb_opt &&
+             if (sfc->direct_fb_opt && !updated_by_wincfg &&
                  ((native_win_depth != depth_size) ||
                   (native_win_stencil != stencil_bit) ||
                   (native_win_msaa != msaa_samples)))
@@ -1542,6 +1543,7 @@ try_again:
                   depth_size = native_win_depth;
                   stencil_bit = native_win_stencil;
                   msaa_samples = native_win_msaa;
+                  updated_by_wincfg = 1;
                   goto try_again;
                }