ector: code refactoring.
just renamed internal variables, no logical changes.
This commit is contained in:
parent
5370c2e795
commit
17320a1318
|
@ -260,22 +260,22 @@ static void
|
||||||
_blend_gradient(int count, const SW_FT_Span *spans, void *user_data)
|
_blend_gradient(int count, const SW_FT_Span *spans, void *user_data)
|
||||||
{
|
{
|
||||||
RGBA_Comp_Func comp_func;
|
RGBA_Comp_Func comp_func;
|
||||||
Span_Data *data = (Span_Data *)(user_data);
|
Span_Data *sd = (Span_Data *)(user_data);
|
||||||
src_fetch fetchfunc = NULL;
|
src_fetch fetchfunc = NULL;
|
||||||
unsigned int buffer[BLEND_GRADIENT_BUFFER_SIZE], *target, *destbuffer;
|
unsigned int buffer[BLEND_GRADIENT_BUFFER_SIZE], *target, *destbuffer;
|
||||||
int length, l;
|
int length, l;
|
||||||
const int pix_stride = data->raster_buffer->stride / 4;
|
const int pix_stride = sd->raster_buffer->stride / 4;
|
||||||
|
|
||||||
// FIXME: Get the proper composition function using ,color, ECTOR_OP etc.
|
// FIXME: Get the proper composition function using ,color, ECTOR_OP etc.
|
||||||
if (data->type == LinearGradient) fetchfunc = &fetch_linear_gradient;
|
if (sd->type == LinearGradient) fetchfunc = &fetch_linear_gradient;
|
||||||
if (data->type == RadialGradient) fetchfunc = &fetch_radial_gradient;
|
if (sd->type == RadialGradient) fetchfunc = &fetch_radial_gradient;
|
||||||
|
|
||||||
if (!fetchfunc || !data->raster_buffer->pixels.u32) return;
|
if (!fetchfunc || !sd->raster_buffer->pixels.u32) return;
|
||||||
|
|
||||||
comp_func = efl_draw_func_span_get(data->op, data->mul_col, data->gradient->alpha);
|
comp_func = efl_draw_func_span_get(sd->op, sd->mul_col, sd->gradient->alpha);
|
||||||
|
|
||||||
// move to the offset location
|
// move to the offset location
|
||||||
destbuffer = data->raster_buffer->pixels.u32 + ((pix_stride * data->offy) + data->offx);
|
destbuffer = sd->raster_buffer->pixels.u32 + ((pix_stride * sd->offy) + sd->offx);
|
||||||
|
|
||||||
while (count--)
|
while (count--)
|
||||||
{
|
{
|
||||||
|
@ -284,8 +284,8 @@ _blend_gradient(int count, const SW_FT_Span *spans, void *user_data)
|
||||||
while (length)
|
while (length)
|
||||||
{
|
{
|
||||||
l = MIN(length, BLEND_GRADIENT_BUFFER_SIZE);
|
l = MIN(length, BLEND_GRADIENT_BUFFER_SIZE);
|
||||||
fetchfunc(buffer, data, spans->y, spans->x, l);
|
fetchfunc(buffer, sd, spans->y, spans->x, l);
|
||||||
comp_func(target, buffer, l, data->mul_col, spans->coverage);
|
comp_func(target, buffer, l, sd->mul_col, spans->coverage);
|
||||||
target += l;
|
target += l;
|
||||||
length -= l;
|
length -= l;
|
||||||
}
|
}
|
||||||
|
@ -297,33 +297,32 @@ static void
|
||||||
_blend_gradient_alpha(int count, const SW_FT_Span *spans, void *user_data)
|
_blend_gradient_alpha(int count, const SW_FT_Span *spans, void *user_data)
|
||||||
{
|
{
|
||||||
RGBA_Comp_Func comp_func;
|
RGBA_Comp_Func comp_func;
|
||||||
Span_Data *data = (Span_Data *)(user_data);
|
Span_Data *sd = (Span_Data *)(user_data);
|
||||||
src_fetch fetchfunc = NULL;
|
src_fetch fetchfunc = NULL;
|
||||||
uint32_t *buffer;
|
uint32_t *buffer;
|
||||||
const int pix_stride = data->raster_buffer->stride / 4;
|
const int pix_stride = sd->raster_buffer->stride / 4;
|
||||||
uint32_t gradientbuffer[BLEND_GRADIENT_BUFFER_SIZE];
|
uint32_t gradientbuffer[BLEND_GRADIENT_BUFFER_SIZE];
|
||||||
|
|
||||||
// FIXME: Get the proper composition function using ,color, ECTOR_OP etc.
|
// FIXME: Get the proper composition function using ,color, ECTOR_OP etc.
|
||||||
if (data->type == LinearGradient) fetchfunc = &fetch_linear_gradient;
|
if (sd->type == LinearGradient) fetchfunc = &fetch_linear_gradient;
|
||||||
if (data->type == RadialGradient) fetchfunc = &fetch_radial_gradient;
|
if (sd->type == RadialGradient) fetchfunc = &fetch_radial_gradient;
|
||||||
|
|
||||||
if (!fetchfunc)
|
if (!fetchfunc) return;
|
||||||
return;
|
|
||||||
|
|
||||||
Ector_Software_Buffer_Base_Data *mask = data->mask;
|
Ector_Software_Buffer_Base_Data *mask = sd->mask;
|
||||||
uint32_t *mbuffer = mask->pixels.u32;
|
uint32_t *mbuffer = mask->pixels.u32;
|
||||||
|
|
||||||
//Temp buffer for intermediate processing
|
//Temp buffer for intermediate processing
|
||||||
uint32_t *tbuffer = malloc(sizeof(uint32_t) * data->raster_buffer->generic->w);
|
uint32_t *tbuffer = malloc(sizeof(uint32_t) * sd->raster_buffer->generic->w);
|
||||||
|
|
||||||
comp_func = efl_draw_func_span_get(data->op, data->mul_col, data->gradient->alpha);
|
comp_func = efl_draw_func_span_get(sd->op, sd->mul_col, sd->gradient->alpha);
|
||||||
|
|
||||||
// move to the offset location
|
// move to the offset location
|
||||||
buffer = data->raster_buffer->pixels.u32 + ((pix_stride * data->offy) + data->offx);
|
buffer = sd->raster_buffer->pixels.u32 + ((pix_stride * sd->offy) + sd->offx);
|
||||||
|
|
||||||
while (count--)
|
while (count--)
|
||||||
{
|
{
|
||||||
uint32_t *target = buffer + ((data->raster_buffer->generic->w * spans->y) + spans->x);
|
uint32_t *target = buffer + ((sd->raster_buffer->generic->w * spans->y) + spans->x);
|
||||||
uint32_t *mtarget = mbuffer + ((mask->generic->w * spans->y) + spans->x);
|
uint32_t *mtarget = mbuffer + ((mask->generic->w * spans->y) + spans->x);
|
||||||
uint32_t *temp = tbuffer;
|
uint32_t *temp = tbuffer;
|
||||||
int length = spans->len;
|
int length = spans->len;
|
||||||
|
@ -331,8 +330,8 @@ _blend_gradient_alpha(int count, const SW_FT_Span *spans, void *user_data)
|
||||||
while (length)
|
while (length)
|
||||||
{
|
{
|
||||||
int l = MIN(length, BLEND_GRADIENT_BUFFER_SIZE);
|
int l = MIN(length, BLEND_GRADIENT_BUFFER_SIZE);
|
||||||
fetchfunc(gradientbuffer, data, spans->y, spans->x, l);
|
fetchfunc(gradientbuffer, sd, spans->y, spans->x, l);
|
||||||
comp_func(temp, gradientbuffer, l, data->mul_col, spans->coverage);
|
comp_func(temp, gradientbuffer, l, sd->mul_col, spans->coverage);
|
||||||
|
|
||||||
for (int i = 0; i < l; i++)
|
for (int i = 0; i < l; i++)
|
||||||
{
|
{
|
||||||
|
@ -354,33 +353,32 @@ static void
|
||||||
_blend_gradient_alpha_inv(int count, const SW_FT_Span *spans, void *user_data)
|
_blend_gradient_alpha_inv(int count, const SW_FT_Span *spans, void *user_data)
|
||||||
{
|
{
|
||||||
RGBA_Comp_Func comp_func;
|
RGBA_Comp_Func comp_func;
|
||||||
Span_Data *data = (Span_Data *)(user_data);
|
Span_Data *sd = (Span_Data *)(user_data);
|
||||||
src_fetch fetchfunc = NULL;
|
src_fetch fetchfunc = NULL;
|
||||||
uint32_t *buffer;
|
uint32_t *buffer;
|
||||||
const int pix_stride = data->raster_buffer->stride / 4;
|
const int pix_stride = sd->raster_buffer->stride / 4;
|
||||||
uint32_t gradientbuffer[BLEND_GRADIENT_BUFFER_SIZE];
|
uint32_t gradientbuffer[BLEND_GRADIENT_BUFFER_SIZE];
|
||||||
|
|
||||||
// FIXME: Get the proper composition function using ,color, ECTOR_OP etc.
|
// FIXME: Get the proper composition function using ,color, ECTOR_OP etc.
|
||||||
if (data->type == LinearGradient) fetchfunc = &fetch_linear_gradient;
|
if (sd->type == LinearGradient) fetchfunc = &fetch_linear_gradient;
|
||||||
if (data->type == RadialGradient) fetchfunc = &fetch_radial_gradient;
|
if (sd->type == RadialGradient) fetchfunc = &fetch_radial_gradient;
|
||||||
|
|
||||||
if (!fetchfunc)
|
if (!fetchfunc) return;
|
||||||
return;
|
|
||||||
|
|
||||||
Ector_Software_Buffer_Base_Data *mask = data->mask;
|
Ector_Software_Buffer_Base_Data *mask = sd->mask;
|
||||||
uint32_t *mbuffer = mask->pixels.u32;
|
uint32_t *mbuffer = mask->pixels.u32;
|
||||||
|
|
||||||
//Temp buffer for intermediate processing
|
//Temp buffer for intermediate processing
|
||||||
uint32_t *tbuffer = malloc(sizeof(uint32_t) * data->raster_buffer->generic->w);
|
uint32_t *tbuffer = malloc(sizeof(uint32_t) * sd->raster_buffer->generic->w);
|
||||||
|
|
||||||
comp_func = efl_draw_func_span_get(data->op, data->mul_col, data->gradient->alpha);
|
comp_func = efl_draw_func_span_get(sd->op, sd->mul_col, sd->gradient->alpha);
|
||||||
|
|
||||||
// move to the offset location
|
// move to the offset location
|
||||||
buffer = data->raster_buffer->pixels.u32 + ((pix_stride * data->offy) + data->offx);
|
buffer = sd->raster_buffer->pixels.u32 + ((pix_stride * sd->offy) + sd->offx);
|
||||||
|
|
||||||
while (count--)
|
while (count--)
|
||||||
{
|
{
|
||||||
uint32_t *target = buffer + ((data->raster_buffer->generic->w * spans->y) + spans->x);
|
uint32_t *target = buffer + ((sd->raster_buffer->generic->w * spans->y) + spans->x);
|
||||||
uint32_t *mtarget = mbuffer + ((mask->generic->w * spans->y) + spans->x);
|
uint32_t *mtarget = mbuffer + ((mask->generic->w * spans->y) + spans->x);
|
||||||
uint32_t *temp = tbuffer;
|
uint32_t *temp = tbuffer;
|
||||||
int length = spans->len;
|
int length = spans->len;
|
||||||
|
@ -388,8 +386,8 @@ _blend_gradient_alpha_inv(int count, const SW_FT_Span *spans, void *user_data)
|
||||||
while (length)
|
while (length)
|
||||||
{
|
{
|
||||||
int l = MIN(length, BLEND_GRADIENT_BUFFER_SIZE);
|
int l = MIN(length, BLEND_GRADIENT_BUFFER_SIZE);
|
||||||
fetchfunc(gradientbuffer, data, spans->y, spans->x, l);
|
fetchfunc(gradientbuffer, sd, spans->y, spans->x, l);
|
||||||
comp_func(temp, gradientbuffer, l, data->mul_col, spans->coverage);
|
comp_func(temp, gradientbuffer, l, sd->mul_col, spans->coverage);
|
||||||
|
|
||||||
for (int i = 0; i < l; i++)
|
for (int i = 0; i < l; i++)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue