summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib/ector/software/ector_software_rasterizer.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/lib/ector/software/ector_software_rasterizer.c b/src/lib/ector/software/ector_software_rasterizer.c
index 2c55565089..d98a8dc54a 100644
--- a/src/lib/ector/software/ector_software_rasterizer.c
+++ b/src/lib/ector/software/ector_software_rasterizer.c
@@ -55,7 +55,7 @@ _blend_color_argb(int count, const SW_FT_Span *spans, void *user_data)
55 } 55 }
56} 56}
57 57
58int buffer_size = 2048; 58#define BLEND_GRADIENT_BUFFER_SIZE 2048
59 59
60typedef void (*src_fetch) (unsigned int *buffer, Span_Data *data, int y, int x, int length); 60typedef void (*src_fetch) (unsigned int *buffer, Span_Data *data, int y, int x, int length);
61 61
@@ -68,7 +68,7 @@ _blend_gradient(int count, const SW_FT_Span *spans, void *user_data)
68 if(data->type == LinearGradient) fetchfunc = &fetch_linear_gradient; 68 if(data->type == LinearGradient) fetchfunc = &fetch_linear_gradient;
69 if(data->type == RadialGradient) fetchfunc = &fetch_radial_gradient; 69 if(data->type == RadialGradient) fetchfunc = &fetch_radial_gradient;
70 70
71 unsigned int buffer[buffer_size]; 71 unsigned int buffer[BLEND_GRADIENT_BUFFER_SIZE];
72 72
73 // move to the offset location 73 // move to the offset location
74 unsigned int *destbuffer = data->raster_buffer.buffer + (data->raster_buffer.width * data->offy + data->offx); 74 unsigned int *destbuffer = data->raster_buffer.buffer + (data->raster_buffer.width * data->offy + data->offx);
@@ -79,9 +79,11 @@ _blend_gradient(int count, const SW_FT_Span *spans, void *user_data)
79 int length = spans->len; 79 int length = spans->len;
80 while (length) 80 while (length)
81 { 81 {
82 int l = MIN(length, buffer_size); 82 int l = MIN(length, BLEND_GRADIENT_BUFFER_SIZE);
83 if (fetchfunc) 83 if (fetchfunc)
84 fetchfunc(buffer, data, spans->y, spans->x, l); 84 fetchfunc(buffer, data, spans->y, spans->x, l);
85 else
86 memset(buffer, 0, sizeof(buffer));
85 if (data->mul_col == 0xffffffff) 87 if (data->mul_col == 0xffffffff)
86 _ector_comp_func_source_over(target, buffer, l, spans->coverage); // TODO use proper composition func 88 _ector_comp_func_source_over(target, buffer, l, spans->coverage); // TODO use proper composition func
87 else 89 else