sw_engine: code refactoring.

clean code for compaction.
This commit is contained in:
Hermet Park 2020-10-07 10:36:59 +09:00
parent 3314df89ae
commit 740c59debd
2 changed files with 4 additions and 11 deletions

View file

@ -211,8 +211,6 @@ static inline uint32_t _pixel(const SwFill* fill, float pos)
void fillFetchRadial(const SwFill* fill, uint32_t* dst, uint32_t y, uint32_t x, uint32_t len)
{
if (fill->radial.a < FLT_EPSILON) return;
//Rotation
auto rx = (x + 0.5f - fill->radial.cx) * fill->sy;
auto ry = (y + 0.5f - fill->radial.cy) * fill->sx;
@ -234,7 +232,6 @@ void fillFetchRadial(const SwFill* fill, uint32_t* dst, uint32_t y, uint32_t x,
void fillFetchLinear(const SwFill* fill, uint32_t* dst, uint32_t y, uint32_t x, uint32_t offset, uint32_t len)
{
if (fill->linear.len < FLT_EPSILON) return;
//Rotation
float rx = x + 0.5f;
float ry = y + 0.5f;

View file

@ -133,8 +133,7 @@ static bool _rasterSolidRle(SwSurface* surface, SwRleData* rle, uint32_t color)
static bool _rasterLinearGradientRect(SwSurface* surface, const SwBBox& region, const SwFill* fill)
{
if (!fill) return false;
if (fill->linear.len < FLT_EPSILON) return false;
if (!fill || fill->linear.len < FLT_EPSILON) return false;
auto buffer = surface->buffer + (region.min.y * surface->stride) + region.min.x;
auto h = static_cast<uint32_t>(region.max.y - region.min.y);
@ -165,8 +164,7 @@ static bool _rasterLinearGradientRect(SwSurface* surface, const SwBBox& region,
static bool _rasterRadialGradientRect(SwSurface* surface, const SwBBox& region, const SwFill* fill)
{
if (!fill) return false;
if (fill->radial.a < FLT_EPSILON) return false;
if (!fill || fill->radial.a < FLT_EPSILON) return false;
auto buffer = surface->buffer + (region.min.y * surface->stride) + region.min.x;
auto h = static_cast<uint32_t>(region.max.y - region.min.y);
@ -198,8 +196,7 @@ static bool _rasterRadialGradientRect(SwSurface* surface, const SwBBox& region,
static bool _rasterLinearGradientRle(SwSurface* surface, SwRleData* rle, const SwFill* fill)
{
if (!rle || !fill) return false;
if (fill->linear.len < FLT_EPSILON) return false;
if (!rle || !fill || fill->linear.len < FLT_EPSILON) return false;
auto buf = static_cast<uint32_t*>(alloca(surface->w * sizeof(uint32_t)));
if (!buf) return false;
@ -245,8 +242,7 @@ static bool _rasterLinearGradientRle(SwSurface* surface, SwRleData* rle, const S
static bool _rasterRadialGradientRle(SwSurface* surface, SwRleData* rle, const SwFill* fill)
{
if (!rle || !fill) return false;
if (fill->radial.a < FLT_EPSILON) return false;
if (!rle || !fill || fill->radial.a < FLT_EPSILON) return false;
auto buf = static_cast<uint32_t*>(alloca(surface->w * sizeof(uint32_t)));
if (!buf) return false;