common sw_engine: optimize single rectangle ClipPath.
authorHermet Park <chuneon.park@samsung.com>
Fri, 26 Mar 2021 07:59:52 +0000 (16:59 +0900)
committerHermet Park <chuneon.park@samsung.com>
Mon, 29 Mar 2021 02:25:31 +0000 (11:25 +0900)
commit1cffdbff65e893ee0d421441701fb39738dcc98a
tree29b7d67f0ba10afffb8f339127652c6204fd8d9e
parent91d93ac6a4057029a1dbba04004d544899cd9276
common sw_engine: optimize single rectangle ClipPath.

If ClipPath is a singular rectangle,
we don't need to apply this to all children nodes to adjust rle span regions.

Rather than its regular sequence,
we can adjust render region as merging viewport that is introduced internally,

All in all,
If a Paint has a single ClipPath that is Rectangle,
it sets viewport with Rectangle area that viewport is applied to
raster engine to cut off the rendering boundary.

In the normal case it brings trivial effects.
but when use SVGs which has a viewbox, it could increase the performance
up to 10% (profiled with 200 svgs rendering at the same time)

Note that, this won't be applied if the Paint has affine or rotation transform.

@Issues: 294
13 files changed:
src/examples/ClipPath.cpp
src/lib/gl_engine/tvgGlRenderer.cpp
src/lib/gl_engine/tvgGlRenderer.h
src/lib/sw_engine/tvgSwCommon.h
src/lib/sw_engine/tvgSwImage.cpp
src/lib/sw_engine/tvgSwMath.cpp
src/lib/sw_engine/tvgSwRaster.cpp
src/lib/sw_engine/tvgSwRenderer.cpp
src/lib/sw_engine/tvgSwRenderer.h
src/lib/sw_engine/tvgSwRle.cpp
src/lib/sw_engine/tvgSwShape.cpp
src/lib/tvgPaint.h
src/lib/tvgRender.h