From 6bb58bde70e9efad900603d27ec09df898d93a99 Mon Sep 17 00:00:00 2001 From: ketmar Date: Fri, 3 Dec 2021 09:37:05 +0000 Subject: [PATCH] egra: do not record cells outside of the vertical canvas (framebuffer) in agg mini rasterizer FossilOrigin-Name: a1ad6d0d28912493629112d2653c21f0e08ae37a654db1481edf9f9cc26ec09b --- egra/gfx/aggmini/render.d | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/egra/gfx/aggmini/render.d b/egra/gfx/aggmini/render.d index 49a0a52..5e26ebe 100644 --- a/egra/gfx/aggmini/render.d +++ b/egra/gfx/aggmini/render.d @@ -239,12 +239,15 @@ public: private: void addCurCell () { if (mCurCell.area|mCurCell.cover) { - if ((mNumCells&CellBlockMask) == 0) { - if (mNumBlocks >= CellBlockLimit) return; - allocateBlock(); + if (mCurCell.y >= -1 && mCurCell.y <= VBufHeight+1) { + if ((mNumCells&CellBlockMask) == 0) { + if (mNumBlocks >= CellBlockLimit) return; + allocateBlock(); + } + *mCurCellPtr++ = mCurCell; + ++mNumCells; } - *mCurCellPtr++ = mCurCell; - ++mNumCells; + mCurCell.area = mCurCell.cover = 0; } } -- 2.11.4.GIT