summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorHermet Park <hermetpark@gmail.com>2020-01-09 15:00:22 +0900
committerHermet Park <hermetpark@gmail.com>2020-01-09 15:01:47 +0900
commitf6f67d60f3c2171a7e96cff2a205d4895c13117c (patch)
tree27db65443d9d9b743e0b163f8aef2c2cedcdc761 /src/modules
parentb03f06ca8d9ff95a11b2d9be7b522c2d591adf66 (diff)
evas ector: ++safety.
add return value by ector_begin() for vector safety.
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/evas/engines/gl_generic/evas_engine.c6
-rw-r--r--src/modules/evas/engines/software_generic/evas_engine.c7
2 files changed, 9 insertions, 4 deletions
diff --git a/src/modules/evas/engines/gl_generic/evas_engine.c b/src/modules/evas/engines/gl_generic/evas_engine.c
index 045323b680..ec14e2bacc 100644
--- a/src/modules/evas/engines/gl_generic/evas_engine.c
+++ b/src/modules/evas/engines/gl_generic/evas_engine.c
@@ -2712,7 +2712,7 @@ eng_ector_surface_cache_drop(void *engine, void *key)
2712 generic_cache_data_drop(e->software.surface_cache, key); 2712 generic_cache_data_drop(e->software.surface_cache, key);
2713} 2713}
2714 2714
2715static void 2715static Eina_Bool
2716eng_ector_begin(void *engine, void *surface, 2716eng_ector_begin(void *engine, void *surface,
2717 void *context EINA_UNUSED, Ector_Surface *ector, 2717 void *context EINA_UNUSED, Ector_Surface *ector,
2718 int x, int y, Eina_Bool do_async EINA_UNUSED) 2718 int x, int y, Eina_Bool do_async EINA_UNUSED)
@@ -2720,6 +2720,7 @@ eng_ector_begin(void *engine, void *surface,
2720 if (use_gl) 2720 if (use_gl)
2721 { 2721 {
2722 //FIXME: No implementation yet 2722 //FIXME: No implementation yet
2723 return EINA_FALSE;
2723 } 2724 }
2724 else 2725 else
2725 { 2726 {
@@ -2729,6 +2730,7 @@ eng_ector_begin(void *engine, void *surface,
2729 int load_err; 2730 int load_err;
2730 2731
2731 glim = eng_image_data_get(engine, glim, EINA_TRUE, &pixels, &load_err,NULL); 2732 glim = eng_image_data_get(engine, glim, EINA_TRUE, &pixels, &load_err,NULL);
2733 if (!glim || !pixels) return EINA_FALSE;
2732 eng_image_stride_get(engine, glim, &stride); 2734 eng_image_stride_get(engine, glim, &stride);
2733 eng_image_size_get(engine, glim, &w, &h); 2735 eng_image_size_get(engine, glim, &w, &h);
2734 2736
@@ -2737,8 +2739,8 @@ eng_ector_begin(void *engine, void *surface,
2737 // it just uses the software backend to draw for now 2739 // it just uses the software backend to draw for now
2738 ector_buffer_pixels_set(ector, pixels, w, h, stride, EFL_GFX_COLORSPACE_ARGB8888, EINA_TRUE); 2740 ector_buffer_pixels_set(ector, pixels, w, h, stride, EFL_GFX_COLORSPACE_ARGB8888, EINA_TRUE);
2739 ector_surface_reference_point_set(ector, x, y); 2741 ector_surface_reference_point_set(ector, x, y);
2740
2741 } 2742 }
2743 return EINA_TRUE;
2742} 2744}
2743 2745
2744static void 2746static void
diff --git a/src/modules/evas/engines/software_generic/evas_engine.c b/src/modules/evas/engines/software_generic/evas_engine.c
index 33c56b1238..b548322539 100644
--- a/src/modules/evas/engines/software_generic/evas_engine.c
+++ b/src/modules/evas/engines/software_generic/evas_engine.c
@@ -4463,7 +4463,7 @@ _draw_thread_ector_surface_set(void *data)
4463 eina_mempool_free(_mp_command_ector_surface, ector_surface); 4463 eina_mempool_free(_mp_command_ector_surface, ector_surface);
4464} 4464}
4465 4465
4466static void 4466static Eina_Bool
4467eng_ector_begin(void *engine EINA_UNUSED, void *surface, 4467eng_ector_begin(void *engine EINA_UNUSED, void *surface,
4468 void *context EINA_UNUSED, Ector_Surface *ector, 4468 void *context EINA_UNUSED, Ector_Surface *ector,
4469 int x, int y, Eina_Bool do_async) 4469 int x, int y, Eina_Bool do_async)
@@ -4473,7 +4473,7 @@ eng_ector_begin(void *engine EINA_UNUSED, void *surface,
4473 Evas_Thread_Command_Ector_Surface *nes; 4473 Evas_Thread_Command_Ector_Surface *nes;
4474 4474
4475 nes = eina_mempool_malloc(_mp_command_ector_surface, sizeof (Evas_Thread_Command_Ector_Surface)); 4475 nes = eina_mempool_malloc(_mp_command_ector_surface, sizeof (Evas_Thread_Command_Ector_Surface));
4476 if (!nes) return; 4476 if (!nes) return EINA_FALSE;
4477 4477
4478 nes->ector = ector; 4478 nes->ector = ector;
4479 nes->pixels = surface; 4479 nes->pixels = surface;
@@ -4490,6 +4490,8 @@ eng_ector_begin(void *engine EINA_UNUSED, void *surface,
4490 unsigned int h = 0; 4490 unsigned int h = 0;
4491 4491
4492 pixels = evas_cache_image_pixels(&sf->cache_entry); 4492 pixels = evas_cache_image_pixels(&sf->cache_entry);
4493 if (!pixels) return EINA_FALSE;
4494
4493 w = sf->cache_entry.w; 4495 w = sf->cache_entry.w;
4494 h = sf->cache_entry.h; 4496 h = sf->cache_entry.h;
4495 // clear the surface before giving to ector 4497 // clear the surface before giving to ector
@@ -4498,6 +4500,7 @@ eng_ector_begin(void *engine EINA_UNUSED, void *surface,
4498 ector_buffer_pixels_set(ector, pixels, w, h, 0, EFL_GFX_COLORSPACE_ARGB8888, EINA_TRUE); 4500 ector_buffer_pixels_set(ector, pixels, w, h, 0, EFL_GFX_COLORSPACE_ARGB8888, EINA_TRUE);
4499 ector_surface_reference_point_set(ector, x, y); 4501 ector_surface_reference_point_set(ector, x, y);
4500 } 4502 }
4503 return EINA_TRUE;
4501} 4504}
4502 4505
4503static void 4506static void