sw_engine: remove redundant code

The only scenarios where 'check valid region' and
'check boundary' occur are when mathUpdateOutlineBBox()
returns true. This, in turn, happens only if mathClipBBox()
returns true. If that is the case, it means that just
before this return, exactly the same checks were performed.
This commit is contained in:
Mira Grudzinska 2024-12-12 22:35:20 +01:00 committed by Hermet Park
parent b1b7a78dd7
commit e395961f3b
2 changed files with 0 additions and 11 deletions

View file

@ -279,9 +279,6 @@ bool mathClipBBox(const SwBBox& clipper, SwBBox& clippee)
clippee.min.x = (clippee.min.x > clipper.min.x) ? clippee.min.x : clipper.min.x;
clippee.min.y = (clippee.min.y > clipper.min.y) ? clippee.min.y : clipper.min.y;
//Check valid region
if (clippee.max.x - clippee.min.x < 1 && clippee.max.y - clippee.min.y < 1) return false;
//Check boundary
if (clippee.min.x >= clipper.max.x || clippee.min.y >= clipper.max.y ||
clippee.max.x <= clipper.min.x || clippee.max.y <= clipper.min.y) return false;

View file

@ -499,14 +499,6 @@ bool shapePrepare(SwShape* shape, const RenderShape* rshape, const Matrix& trans
if (!mathUpdateOutlineBBox(shape->outline, clipRegion, renderRegion, shape->fastTrack)) return false;
shape->bbox = renderRegion;
//Check valid region
if (renderRegion.max.x - renderRegion.min.x < 1 && renderRegion.max.y - renderRegion.min.y < 1) return false;
//Check boundary
if (renderRegion.min.x >= clipRegion.max.x || renderRegion.min.y >= clipRegion.max.y ||
renderRegion.max.x <= clipRegion.min.x || renderRegion.max.y <= clipRegion.min.y) return false;
return true;
}