ector_software_rasterizer : Move duplicate alloca

Summary: Move the alloca() outside of the loop.

Test Plan: N/A

Reviewers: Hermet, kimcinoo

Reviewed By: Hermet

Subscribers: cedric, #reviewers, smohanty, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8869
This commit is contained in:
junsu choi 2019-05-09 19:30:37 +09:00 committed by Hermet Park
parent 0e8f289d7d
commit c10dfc3bca
1 changed files with 6 additions and 2 deletions

View File

@ -145,9 +145,11 @@ _blend_mask_add(int count, const SW_FT_Span *spans, void *user_data)
RGBA_Comp_Func_Solid comp_func = efl_draw_func_solid_span_get(sd->op, color);
uint32_t *mbuffer = mask->pixels.u32;
int tsize = sd->raster_buffer->generic->w;
uint32_t *ttarget = alloca(sizeof(uint32_t) * tsize);
while (count--)
{
uint32_t *ttarget = alloca(sizeof(uint32_t) * spans->len);
memset(ttarget, 0x00, sizeof(uint32_t) * spans->len);
uint32_t *mtarget = mbuffer + ((mask->generic->w * spans->y) + spans->x);
comp_func(ttarget, spans->len, color, spans->coverage);
@ -234,9 +236,11 @@ _blend_mask_diff(int count, const SW_FT_Span *spans, void *user_data)
RGBA_Comp_Func_Solid comp_func = efl_draw_func_solid_span_get(sd->op, color);
uint32_t *mbuffer = mask->pixels.u32;
int tsize = sd->raster_buffer->generic->w;
uint32_t *ttarget = alloca(sizeof(uint32_t) * tsize);
while (count--)
{
uint32_t *ttarget = alloca(sizeof(uint32_t) * spans->len);
memset(ttarget, 0x00, sizeof(uint32_t) * spans->len);
uint32_t *mtarget = mbuffer + ((mask->generic->w * spans->y) + spans->x);
comp_func(ttarget, spans->len, color, spans->coverage);