diff options
author | Jean-Philippe Andre <jp.andre@samsung.com> | 2015-06-11 08:39:43 +0900 |
---|---|---|
committer | Jean-Philippe Andre <jp.andre@samsung.com> | 2015-06-11 08:39:43 +0900 |
commit | cb11a67595815dc09fa615b3c81ee67e45b08e57 (patch) | |
tree | d7746a0534bae9d3c7239d0077b2759efcbc3b7e /src | |
parent | cf2e94e11b9d74aadad880bce51c242897b1e5bb (diff) |
Evas GL: Fix coverity CID 1304559, 1304560
Summary:
<CID 1304559: Logically dead code>
The dead code is only valid for GLES backend, so move if statement
to be used for GLES backend only.
<CID 1304560: Bad bit shift operation>
When calculating depth bit, bit shifting could be done with negative values.
@fix
Test Plan: Local tests
Reviewers: jpeg
Reviewed By: jpeg
Subscribers: wonsik, cedric
Differential Revision: https://phab.enlightenment.org/D2654
Diffstat (limited to 'src')
-rw-r--r-- | src/modules/evas/engines/gl_common/evas_gl_core.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/modules/evas/engines/gl_common/evas_gl_core.c b/src/modules/evas/engines/gl_common/evas_gl_core.c index f3743019f9..5c1ecf5cbd 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_core.c +++ b/src/modules/evas/engines/gl_common/evas_gl_core.c | |||
@@ -887,11 +887,6 @@ _context_ext_check(EVGL_Context *ctx) | |||
887 | egl_image_supported = 1; | 887 | egl_image_supported = 1; |
888 | if (EXTENSION_SUPPORT_EGL(EGL_KHR_gl_texture_2D_image)) | 888 | if (EXTENSION_SUPPORT_EGL(EGL_KHR_gl_texture_2D_image)) |
889 | texture_image_supported = 1; | 889 | texture_image_supported = 1; |
890 | #else | ||
891 | fbo_supported = 1; | ||
892 | egl_image_supported = 0; | ||
893 | texture_image_supported = 0; | ||
894 | #endif | ||
895 | 890 | ||
896 | if (egl_image_supported) | 891 | if (egl_image_supported) |
897 | { | 892 | { |
@@ -900,6 +895,11 @@ _context_ext_check(EVGL_Context *ctx) | |||
900 | else | 895 | else |
901 | ctx->pixmap_image_supported = 1; | 896 | ctx->pixmap_image_supported = 1; |
902 | } | 897 | } |
898 | #else | ||
899 | fbo_supported = 1; | ||
900 | egl_image_supported = 0; | ||
901 | texture_image_supported = 0; | ||
902 | #endif | ||
903 | 903 | ||
904 | ctx->extension_checked = 1; | 904 | ctx->extension_checked = 1; |
905 | 905 | ||
@@ -1355,7 +1355,8 @@ try_again: | |||
1355 | (native_win_stencil != stencil_bit) || | 1355 | (native_win_stencil != stencil_bit) || |
1356 | (native_win_msaa != msaa_samples))) | 1356 | (native_win_msaa != msaa_samples))) |
1357 | { | 1357 | { |
1358 | depth_bit = (1 << ((native_win_depth / 8) - 1)); | 1358 | if (native_win_depth < 8) depth_bit = 0; |
1359 | else depth_bit = (1 << ((native_win_depth / 8) - 1)); | ||
1359 | depth_size = native_win_depth; | 1360 | depth_size = native_win_depth; |
1360 | stencil_bit = native_win_stencil; | 1361 | stencil_bit = native_win_stencil; |
1361 | msaa_samples = native_win_msaa; | 1362 | msaa_samples = native_win_msaa; |