summaryrefslogtreecommitdiff
path: root/src/modules/evas/engines/software_generic/evas_engine.c
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2020-08-25 09:34:09 +0100
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2020-08-25 13:21:25 +0100
commit880973ebcf8f5afe847d18f186c9bfa670766939 (patch)
tree4027a3109e01dd0a26eb64cba1cbc92a4daa93ce /src/modules/evas/engines/software_generic/evas_engine.c
parented12d482d560fc03dd8e1e9abff11d3ded483a8f (diff)
evas - sw generic - fix enum passing with casts or correct types fix wrn
Diffstat (limited to '')
-rw-r--r--src/modules/evas/engines/software_generic/evas_engine.c42
1 files changed, 28 insertions, 14 deletions
diff --git a/src/modules/evas/engines/software_generic/evas_engine.c b/src/modules/evas/engines/software_generic/evas_engine.c
index 3d6a7f19b3..78d8172b93 100644
--- a/src/modules/evas/engines/software_generic/evas_engine.c
+++ b/src/modules/evas/engines/software_generic/evas_engine.c
@@ -1518,11 +1518,15 @@ eng_image_data_map(void *engdata EINA_UNUSED, void **image, Eina_Rw_Slice *slice
1518 void *src_data; 1518 void *src_data;
1519 int dst_stride, dst_len, dst_offset = 0; 1519 int dst_stride, dst_len, dst_offset = 0;
1520 1520
1521 cs_func = efl_draw_convert_func_get(ie->space, cspace, &can_region); 1521 cs_func = efl_draw_convert_func_get((Efl_Gfx_Colorspace)ie->space,
1522 (Efl_Gfx_Colorspace)cspace,
1523 &can_region);
1522 if (!cs_func) return EINA_FALSE; 1524 if (!cs_func) return EINA_FALSE;
1523 1525
1524 // make sure we can convert back, if map for writing 1526 // make sure we can convert back, if map for writing
1525 if (to_write && !efl_draw_convert_func_get(cspace, ie->space, NULL)) 1527 if (to_write && !efl_draw_convert_func_get((Efl_Gfx_Colorspace)cspace,
1528 (Efl_Gfx_Colorspace)ie->space,
1529 NULL))
1526 return EINA_FALSE; 1530 return EINA_FALSE;
1527 1531
1528 if (can_region) 1532 if (can_region)
@@ -1554,7 +1558,10 @@ eng_image_data_map(void *engdata EINA_UNUSED, void **image, Eina_Rw_Slice *slice
1554 data = malloc(dst_len); 1558 data = malloc(dst_len);
1555 if (!data) return EINA_FALSE; 1559 if (!data) return EINA_FALSE;
1556 1560
1557 if (!cs_func(data, src_data, rw, rh, src_stride, dst_stride, ie->flags.alpha, ie->space, cspace)) 1561 if (!cs_func(data, src_data, rw, rh, src_stride, dst_stride,
1562 ie->flags.alpha,
1563 (Efl_Gfx_Colorspace)ie->space,
1564 (Efl_Gfx_Colorspace)cspace))
1558 { 1565 {
1559 ERR("color conversion failed"); 1566 ERR("color conversion failed");
1560 free(data); 1567 free(data);
@@ -1656,19 +1663,25 @@ _image_data_commit(RGBA_Image *im, RGBA_Image_Data_Map *map)
1656 Cspace_Convert_Func cs_func; 1663 Cspace_Convert_Func cs_func;
1657 Eina_Bool can_region; 1664 Eina_Bool can_region;
1658 1665
1659 cs_func = efl_draw_convert_func_get(map->cspace, ie->space, &can_region); 1666 cs_func = efl_draw_convert_func_get((Efl_Gfx_Colorspace)map->cspace,
1667 (Efl_Gfx_Colorspace)ie->space,
1668 &can_region);
1660 EINA_SAFETY_ON_NULL_RETURN(cs_func); 1669 EINA_SAFETY_ON_NULL_RETURN(cs_func);
1661 1670
1662 DBG("unmap commit: convert func (%p)", cs_func); 1671 DBG("unmap commit: convert func (%p)", cs_func);
1663 if (can_region) 1672 if (can_region)
1664 { 1673 {
1665 cs_func(dst, map->slice.mem, map->rw, map->rh, map->stride, dst_stride, 1674 cs_func(dst, map->slice.mem, map->rw, map->rh, map->stride, dst_stride,
1666 ie->flags.alpha, map->cspace, ie->space); 1675 ie->flags.alpha,
1676 (Efl_Gfx_Colorspace)map->cspace,
1677 (Efl_Gfx_Colorspace)ie->space);
1667 } 1678 }
1668 else 1679 else
1669 { 1680 {
1670 cs_func(dst, map->baseptr, ie->w, ie->h, map->stride, dst_stride, 1681 cs_func(dst, map->baseptr, ie->w, ie->h, map->stride, dst_stride,
1671 ie->flags.alpha, map->cspace, ie->space); 1682 ie->flags.alpha,
1683 (Efl_Gfx_Colorspace)map->cspace,
1684 (Efl_Gfx_Colorspace)ie->space);
1672 } 1685 }
1673 } 1686 }
1674} 1687}
@@ -1722,15 +1735,15 @@ eng_image_data_maps_get(void *engdata EINA_UNUSED, const void *image, const Eina
1722} 1735}
1723 1736
1724static inline Eina_Bool 1737static inline Eina_Bool
1725_is_yuv(Efl_Gfx_Colorspace cspace) 1738_is_yuv(Evas_Colorspace cspace)
1726{ 1739{
1727 switch (cspace) 1740 switch (cspace)
1728 { 1741 {
1729 case EFL_GFX_COLORSPACE_YCBCR422P601_PL: 1742 case EVAS_COLORSPACE_YCBCR422P601_PL:
1730 case EFL_GFX_COLORSPACE_YCBCR422P709_PL: 1743 case EVAS_COLORSPACE_YCBCR422P709_PL:
1731 case EFL_GFX_COLORSPACE_YCBCR422601_PL: 1744 case EVAS_COLORSPACE_YCBCR422601_PL:
1732 case EFL_GFX_COLORSPACE_YCBCR420NV12601_PL: 1745 case EVAS_COLORSPACE_YCBCR420NV12601_PL:
1733 case EFL_GFX_COLORSPACE_YCBCR420TM12601_PL: 1746 case EVAS_COLORSPACE_YCBCR420TM12601_PL:
1734 return EINA_TRUE; 1747 return EINA_TRUE;
1735 1748
1736 default: 1749 default:
@@ -4391,8 +4404,9 @@ eng_ector_buffer_new(void *data, Evas *evas, int width, int height,
4391 } 4404 }
4392 4405
4393 // alloc buffer 4406 // alloc buffer
4394 ie = evas_cache_image_copied_data(evas_common_image_cache_get(), width, height, 4407 ie = evas_cache_image_copied_data(evas_common_image_cache_get(),
4395 NULL, EINA_TRUE, cspace); 4408 width, height, NULL, EINA_TRUE,
4409 (Evas_Colorspace)cspace);
4396 if (!ie) return NULL; 4410 if (!ie) return NULL;
4397 pixels = ((RGBA_Image *) ie)->image.data; 4411 pixels = ((RGBA_Image *) ie)->image.data;
4398 memset(pixels, 0, width * height * pxs); 4412 memset(pixels, 0, width * height * pxs);