sw_engine: code clean up

removed unnecesary parameters
This commit is contained in:
Hermet Park 2025-05-12 17:37:23 +09:00
parent 97817bedfe
commit 5ed719dcec

View file

@ -245,26 +245,26 @@ struct SwImageTask : SwTask
}; };
static void _renderFill(SwShapeTask* task, SwSurface* surface, uint8_t opacity) static void _renderFill(SwShapeTask* task, SwSurface* surface)
{ {
if (auto fill = task->rshape->fill) { if (auto fill = task->rshape->fill) {
rasterGradientShape(surface, &task->shape, fill, opacity); rasterGradientShape(surface, &task->shape, fill, task->opacity);
} else { } else {
RenderColor c; RenderColor c;
task->rshape->fillColor(&c.r, &c.g, &c.b, &c.a); task->rshape->fillColor(&c.r, &c.g, &c.b, &c.a);
c.a = MULTIPLY(opacity, c.a); c.a = MULTIPLY(task->opacity, c.a);
if (c.a > 0) rasterShape(surface, &task->shape, c); if (c.a > 0) rasterShape(surface, &task->shape, c);
} }
} }
static void _renderStroke(SwShapeTask* task, SwSurface* surface, uint8_t opacity) static void _renderStroke(SwShapeTask* task, SwSurface* surface)
{ {
if (auto strokeFill = task->rshape->strokeFill()) { if (auto strokeFill = task->rshape->strokeFill()) {
rasterGradientStroke(surface, &task->shape, strokeFill, opacity); rasterGradientStroke(surface, &task->shape, strokeFill, task->opacity);
} else { } else {
RenderColor c; RenderColor c;
if (task->rshape->strokeFill(&c.r, &c.g, &c.b, &c.a)) { if (task->rshape->strokeFill(&c.r, &c.g, &c.b, &c.a)) {
c.a = MULTIPLY(opacity, c.a); c.a = MULTIPLY(task->opacity, c.a);
if (c.a > 0) rasterStroke(surface, &task->shape, c); if (c.a > 0) rasterStroke(surface, &task->shape, c);
} }
} }
@ -426,11 +426,11 @@ bool SwRenderer::renderShape(RenderData data)
//Main raster stage //Main raster stage
if (task->rshape->strokeFirst()) { if (task->rshape->strokeFirst()) {
_renderStroke(task, surface, task->opacity); _renderStroke(task, surface);
_renderFill(task, surface, task->opacity); _renderFill(task, surface);
} else { } else {
_renderFill(task, surface, task->opacity); _renderFill(task, surface);
_renderStroke(task, surface, task->opacity); _renderStroke(task, surface);
} }
return true; return true;