renderer: increased the reference count capacity

255 is enough size in general but a bit limited.
This commit is contained in:
Hermet Park 2025-06-10 14:49:52 +09:00 committed by Mira Grudzinska
parent 081cb8cad3
commit 04728acc47

View file

@ -74,9 +74,9 @@ namespace tvg
} tr;
RenderUpdateFlag renderFlag = RenderUpdateFlag::None;
BlendMethod blendMethod;
uint16_t refCnt = 0; //reference count
uint8_t ctxFlag;
uint8_t opacity;
uint8_t refCnt = 0; //reference count
Impl(Paint* pnt) : paint(pnt)
{
@ -95,8 +95,9 @@ namespace tvg
uint8_t ref()
{
if (refCnt == 255) TVGERR("RENDERER", "Corrupted reference count!");
return ++refCnt;
if (refCnt == UINT16_MAX) TVGERR("RENDERER", "Reference Count Overflow!");
else ++refCnt;
return refCnt;
}
uint8_t unref()