summaryrefslogtreecommitdiff
path: root/src/lib/ector
diff options
context:
space:
mode:
authorHermet Park <hermetpark@gmail.com>2019-08-30 17:13:31 +0900
committerHermet Park <hermetpark@gmail.com>2019-08-30 17:15:06 +0900
commit9a4b6728d5ee0cc8716f6358c508f044fac259d2 (patch)
treeb2f293a9524501894d623c435eb936e5644c267a /src/lib/ector
parent7291c684fbb401e71544a294952cc4fc3864457d (diff)
ector gradient: ++ optmization.
we know what size will be used for every span, this graident buffer will be overwritten with new one, So it doesn't need to clear every spans.
Diffstat (limited to 'src/lib/ector')
-rw-r--r--src/lib/ector/software/ector_software_rasterizer.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/lib/ector/software/ector_software_rasterizer.c b/src/lib/ector/software/ector_software_rasterizer.c
index 447598c..62c3eac 100644
--- a/src/lib/ector/software/ector_software_rasterizer.c
+++ b/src/lib/ector/software/ector_software_rasterizer.c
@@ -318,13 +318,13 @@ _blend_gradient_alpha(int count, const SW_FT_Span *spans, void *user_data)
318 { 318 {
319 uint32_t *target = buffer + ((sd->raster_buffer->generic->w * spans->y) + spans->x); 319 uint32_t *target = buffer + ((sd->raster_buffer->generic->w * spans->y) + spans->x);
320 uint32_t *mtarget = mbuffer + ((mask->generic->w * spans->y) + spans->x); 320 uint32_t *mtarget = mbuffer + ((mask->generic->w * spans->y) + spans->x);
321 uint32_t *temp = gbuffer;
322 int length = spans->len; 321 int length = spans->len;
323 memset(temp, 0x00, sizeof(uint32_t) * spans->len); 322
324 while (length) 323 while (length)
325 { 324 {
326 int l = MIN(length, BLEND_GRADIENT_BUFFER_SIZE); 325 int l = MIN(length, BLEND_GRADIENT_BUFFER_SIZE);
327 fetchfunc(temp, sd, spans->y, spans->x, l); 326 fetchfunc(gbuffer, sd, spans->y, spans->x, l);
327 uint32_t *temp = gbuffer;
328 328
329 for (int i = 0; i < l; i++) 329 for (int i = 0; i < l; i++)
330 { 330 {
@@ -366,13 +366,13 @@ _blend_gradient_alpha_inv(int count, const SW_FT_Span *spans, void *user_data)
366 { 366 {
367 uint32_t *target = buffer + ((sd->raster_buffer->generic->w * spans->y) + spans->x); 367 uint32_t *target = buffer + ((sd->raster_buffer->generic->w * spans->y) + spans->x);
368 uint32_t *mtarget = mbuffer + ((mask->generic->w * spans->y) + spans->x); 368 uint32_t *mtarget = mbuffer + ((mask->generic->w * spans->y) + spans->x);
369 uint32_t *temp = gbuffer;
370 int length = spans->len; 369 int length = spans->len;
371 memset(temp, 0x00, sizeof(uint32_t) * spans->len); 370
372 while (length) 371 while (length)
373 { 372 {
374 int l = MIN(length, BLEND_GRADIENT_BUFFER_SIZE); 373 int l = MIN(length, BLEND_GRADIENT_BUFFER_SIZE);
375 fetchfunc(temp, sd, spans->y, spans->x, l); 374 fetchfunc(gbuffer, sd, spans->y, spans->x, l);
375 uint32_t *temp = gbuffer;
376 376
377 for (int i = 0; i < l; i++) 377 for (int i = 0; i < l; i++)
378 { 378 {