From dc621e23161d80f7f1a5b16b5dc4f5a666af53f0 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Andre Date: Thu, 3 Dec 2015 16:19:27 +0900 Subject: [PATCH] Ector: Kill compilation warnings Remove unimplemented function (no test case yet). Convert #warning into comments. --- src/lib/ector/software/ector_software_gradient.c | 2 +- src/lib/ector/software/ector_software_rasterizer.c | 26 +++++----------------- src/static_libs/draw/draw.h | 8 +++++-- src/static_libs/draw/draw_main.c | 7 +++--- src/static_libs/draw/draw_main_sse2.c | 4 ++-- 5 files changed, 19 insertions(+), 28 deletions(-) diff --git a/src/lib/ector/software/ector_software_gradient.c b/src/lib/ector/software/ector_software_gradient.c index bbe675e..f840f73 100644 --- a/src/lib/ector/software/ector_software_gradient.c +++ b/src/lib/ector/software/ector_software_gradient.c @@ -329,7 +329,7 @@ _generate_gradient_color_table(Efl_Gfx_Gradient_Stop *gradient_stops, int stop_c t = func((fpos - curr->offset) * delta); dist = (int)(256 * t); idist = 256 - dist; - color_table[pos] = INTERPOLATE_PIXEL_256(current_color, idist, next_color, dist); + color_table[pos] = draw_interpolate_256(current_color, idist, next_color, dist); ++pos; fpos += incr; } diff --git a/src/lib/ector/software/ector_software_rasterizer.c b/src/lib/ector/software/ector_software_rasterizer.c index 8224c6c..7282144 100644 --- a/src/lib/ector/software/ector_software_rasterizer.c +++ b/src/lib/ector/software/ector_software_rasterizer.c @@ -77,19 +77,6 @@ _blend_gradient(int count, const SW_FT_Span *spans, void *user_data) } static void -_blend_image_gry8(int count, const SW_FT_Span *spans, void *user_data) -{ - Span_Data *data = user_data; - -#warning Need drawhelper here (no alpha support yet) - - while (count--) - { - spans++; - } -} - -static void _blend_image_argb(int count, const SW_FT_Span *spans, void *user_data) { Span_Data *data = user_data; @@ -99,11 +86,13 @@ _blend_image_argb(int count, const SW_FT_Span *spans, void *user_data) unsigned int l, length, sy = 0; const int pix_stride = data->raster_buffer->stride / 4; -#warning FIXME: Image scaling, anyone? -#warning FIXME: Optimize eo call with early call resolution + /* FIXME: + * optimize eo call + * implement image scaling + * tile and repeat image properly + */ comp_func = efl_draw_func_span_get(data->op, data->mul_col, EINA_TRUE); - buffer = data->raster_buffer->pixels.u32 + ((pix_stride * data->offy) + data->offx); while (count--) @@ -330,10 +319,7 @@ _adjust_span_fill_methods(Span_Data *spdata) spdata->unclipped_blend = &_blend_gradient; break; case Image: - if (spdata->buffer->generic->cspace == EFL_GFX_COLORSPACE_GRY8) - spdata->unclipped_blend = &_blend_image_gry8; - else - spdata->unclipped_blend = &_blend_image_argb; + spdata->unclipped_blend = &_blend_image_argb; break; } diff --git a/src/static_libs/draw/draw.h b/src/static_libs/draw/draw.h index c2f2370..ae00cc2 100644 --- a/src/static_libs/draw/draw.h +++ b/src/static_libs/draw/draw.h @@ -13,8 +13,8 @@ typedef void (*Alpha_Gfx_Func) (uint8_t *src, uint8_t *dst, int len); int efl_draw_init(void); -RGBA_Comp_Func_Solid efl_draw_func_solid_span_get(Efl_Gfx_Render_Op op, uint color); RGBA_Comp_Func efl_draw_func_span_get(Efl_Gfx_Render_Op op, uint color, Eina_Bool src_alpha); +RGBA_Comp_Func_Solid efl_draw_func_solid_span_get(Efl_Gfx_Render_Op op, uint color); Alpha_Gfx_Func efl_draw_alpha_func_get(Efl_Gfx_Render_Op op, Eina_Bool has_mask); @@ -57,8 +57,12 @@ Alpha_Gfx_Func efl_draw_alpha_func_get(Efl_Gfx_Render_Op op, Eina_Bool has_mask) ((((((x) & 0xff00) * ((y) & 0xff00)) + 0xff0000) >> 16) & 0xff00) + \ (((((x) & 0xff) * ((y) & 0xff)) + 0xff) >> 8) ) +#define DRAW_MUL_256(a, c) \ + ( (((((c) >> 8) & 0x00ff00ff) * (a)) & 0xff00ff00) + \ + (((((c) & 0x00ff00ff) * (a)) >> 8) & 0x00ff00ff) ) + static inline uint -INTERPOLATE_PIXEL_256(uint x, uint a, uint y, uint b) +draw_interpolate_256(uint x, uint a, uint y, uint b) { uint t = (x & 0xff00ff) * a + (y & 0xff00ff) * b; t >>= 8; diff --git a/src/static_libs/draw/draw_main.c b/src/static_libs/draw/draw_main.c index 5d67602..8db3d20 100644 --- a/src/static_libs/draw/draw_main.c +++ b/src/static_libs/draw/draw_main.c @@ -106,7 +106,7 @@ _comp_func_source(uint *dest, const uint *src, int length, uint color, uint cons { ialpha = 255 - const_alpha; for (i = 0; i < length; ++i) - dest[i] = INTERPOLATE_PIXEL_256(src[i], const_alpha, dest[i], ialpha); + dest[i] = draw_interpolate_256(src[i], const_alpha, dest[i], ialpha); } } else @@ -122,7 +122,7 @@ _comp_func_source(uint *dest, const uint *src, int length, uint color, uint cons for (i = 0; i < length; ++i) { src_color = DRAW_MUL4_SYM(src[i], color); - dest[i] = INTERPOLATE_PIXEL_256(src_color, const_alpha, dest[i], ialpha); + dest[i] = draw_interpolate_256(src_color, const_alpha, dest[i], ialpha); } } } @@ -149,7 +149,8 @@ efl_draw_func_solid_span_get(Efl_Gfx_Render_Op op, uint color) return func_for_mode_solid[op]; } -RGBA_Comp_Func efl_draw_func_span_get(Efl_Gfx_Render_Op op, uint color, Eina_Bool src_alpha) +RGBA_Comp_Func +efl_draw_func_span_get(Efl_Gfx_Render_Op op, uint color, Eina_Bool src_alpha) { if (((color & 0xff000000) == 0xff000000) && !src_alpha) { diff --git a/src/static_libs/draw/draw_main_sse2.c b/src/static_libs/draw/draw_main_sse2.c index 1d8b1cb..c07234a 100644 --- a/src/static_libs/draw/draw_main_sse2.c +++ b/src/static_libs/draw/draw_main_sse2.c @@ -220,7 +220,7 @@ comp_func_source_sse2(uint *dest, const uint *src, int length, uint color, uint LOOP_ALIGNED_U1_A4(dest, length, { /* UOP */ - *dest = INTERPOLATE_PIXEL_256(*src, const_alpha, *dest, ialpha); + *dest = draw_interpolate_256(*src, const_alpha, *dest, ialpha); dest++; src++; length--; }, { /* A4OP */ @@ -257,7 +257,7 @@ comp_func_source_sse2(uint *dest, const uint *src, int length, uint color, uint LOOP_ALIGNED_U1_A4(dest, length, { /* UOP */ src_color = DRAW_MUL4_SYM(*src, color); - *dest = INTERPOLATE_PIXEL_256(src_color, const_alpha, *dest, ialpha); + *dest = draw_interpolate_256(src_color, const_alpha, *dest, ialpha); dest++; src++; length--; }, { /* A4OP */ -- 2.7.4