mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-09 06:04:03 +00:00
sw_engine: fine-tuning RLE performance.
the arranged value is examined with the local test, improved the speed twice for a corner-case that extreamly huge size shape.
This commit is contained in:
parent
bfb7d46297
commit
46f4b8aeab
1 changed files with 2 additions and 5 deletions
|
@ -928,7 +928,7 @@ SwRleData* rleRender(SwRleData* rle, const SwOutline* outline, const SwBBox& ren
|
||||||
rw.cellYCnt = rw.cellMax.y - rw.cellMin.y;
|
rw.cellYCnt = rw.cellMax.y - rw.cellMin.y;
|
||||||
rw.ySpan = 0;
|
rw.ySpan = 0;
|
||||||
rw.outline = const_cast<SwOutline*>(outline);
|
rw.outline = const_cast<SwOutline*>(outline);
|
||||||
rw.bandSize = rw.bufferSize / (sizeof(Cell) * 8); //bandSize: 64
|
rw.bandSize = rw.bufferSize / (sizeof(Cell) * 2); //bandSize: 256
|
||||||
rw.bandShoot = 0;
|
rw.bandShoot = 0;
|
||||||
rw.antiAlias = antiAlias;
|
rw.antiAlias = antiAlias;
|
||||||
|
|
||||||
|
@ -966,10 +966,7 @@ SwRleData* rleRender(SwRleData* rle, const SwOutline* outline, const SwBBox& ren
|
||||||
|
|
||||||
if (cellMod > 0) cellStart += sizeof(Cell) - cellMod;
|
if (cellMod > 0) cellStart += sizeof(Cell) - cellMod;
|
||||||
|
|
||||||
auto cellEnd = rw.bufferSize;
|
auto cellsMax = reinterpret_cast<Cell*>((char*)rw.buffer + rw.bufferSize);
|
||||||
cellEnd -= cellEnd % sizeof(Cell);
|
|
||||||
|
|
||||||
auto cellsMax = reinterpret_cast<Cell*>((char*)rw.buffer + cellEnd);
|
|
||||||
rw.cells = reinterpret_cast<Cell*>((char*)rw.buffer + cellStart);
|
rw.cells = reinterpret_cast<Cell*>((char*)rw.buffer + cellStart);
|
||||||
|
|
||||||
if (rw.cells >= cellsMax) goto reduce_bands;
|
if (rw.cells >= cellsMax) goto reduce_bands;
|
||||||
|
|
Loading…
Add table
Reference in a new issue