summaryrefslogtreecommitdiff
path: root/src/lib/ector
diff options
context:
space:
mode:
authorJunsuChoi <jsuya.choi@samsung.com>2019-05-09 19:30:37 +0900
committerHermet Park <hermetpark@gmail.com>2019-05-09 19:30:37 +0900
commitc10dfc3bcad18d8c53375cea6b3e496e9da84ad7 (patch)
treec61e84f48ee79e4e9340ce22ecd5db71989de95c /src/lib/ector
parent0e8f289d7dfb4c5877559917a57a3ac08545fb86 (diff)
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
Diffstat (limited to 'src/lib/ector')
-rw-r--r--src/lib/ector/software/ector_software_rasterizer.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/lib/ector/software/ector_software_rasterizer.c b/src/lib/ector/software/ector_software_rasterizer.c
index 42a5e8e..428c067 100644
--- a/src/lib/ector/software/ector_software_rasterizer.c
+++ b/src/lib/ector/software/ector_software_rasterizer.c
@@ -145,9 +145,11 @@ _blend_mask_add(int count, const SW_FT_Span *spans, void *user_data)
145 RGBA_Comp_Func_Solid comp_func = efl_draw_func_solid_span_get(sd->op, color); 145 RGBA_Comp_Func_Solid comp_func = efl_draw_func_solid_span_get(sd->op, color);
146 uint32_t *mbuffer = mask->pixels.u32; 146 uint32_t *mbuffer = mask->pixels.u32;
147 147
148 int tsize = sd->raster_buffer->generic->w;
149 uint32_t *ttarget = alloca(sizeof(uint32_t) * tsize);
150
148 while (count--) 151 while (count--)
149 { 152 {
150 uint32_t *ttarget = alloca(sizeof(uint32_t) * spans->len);
151 memset(ttarget, 0x00, sizeof(uint32_t) * spans->len); 153 memset(ttarget, 0x00, sizeof(uint32_t) * spans->len);
152 uint32_t *mtarget = mbuffer + ((mask->generic->w * spans->y) + spans->x); 154 uint32_t *mtarget = mbuffer + ((mask->generic->w * spans->y) + spans->x);
153 comp_func(ttarget, spans->len, color, spans->coverage); 155 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)
234 RGBA_Comp_Func_Solid comp_func = efl_draw_func_solid_span_get(sd->op, color); 236 RGBA_Comp_Func_Solid comp_func = efl_draw_func_solid_span_get(sd->op, color);
235 uint32_t *mbuffer = mask->pixels.u32; 237 uint32_t *mbuffer = mask->pixels.u32;
236 238
239 int tsize = sd->raster_buffer->generic->w;
240 uint32_t *ttarget = alloca(sizeof(uint32_t) * tsize);
241
237 while (count--) 242 while (count--)
238 { 243 {
239 uint32_t *ttarget = alloca(sizeof(uint32_t) * spans->len);
240 memset(ttarget, 0x00, sizeof(uint32_t) * spans->len); 244 memset(ttarget, 0x00, sizeof(uint32_t) * spans->len);
241 uint32_t *mtarget = mbuffer + ((mask->generic->w * spans->y) + spans->x); 245 uint32_t *mtarget = mbuffer + ((mask->generic->w * spans->y) + spans->x);
242 comp_func(ttarget, spans->len, color, spans->coverage); 246 comp_func(ttarget, spans->len, color, spans->coverage);