mirror of
https://github.com/thorvg/thorvg.git
synced 2025-07-23 22:58:44 +00:00
gl_engine: ++safety
This commit is contained in:
parent
56f6a8672b
commit
212e888725
1 changed files with 3 additions and 2 deletions
|
@ -985,12 +985,13 @@ bool GlRenderer::sync()
|
||||||
|
|
||||||
RenderRegion GlRenderer::region(RenderData data)
|
RenderRegion GlRenderer::region(RenderData data)
|
||||||
{
|
{
|
||||||
if (currentPass()->isEmpty()) return {};
|
auto pass = currentPass();
|
||||||
|
if (!data || !pass || pass->isEmpty()) return {};
|
||||||
|
|
||||||
auto shape = reinterpret_cast<GlShape*>(data);
|
auto shape = reinterpret_cast<GlShape*>(data);
|
||||||
auto bounds = shape->geometry->getBounds();
|
auto bounds = shape->geometry->getBounds();
|
||||||
|
|
||||||
auto const& vp = currentPass()->getViewport();
|
auto const& vp = pass->getViewport();
|
||||||
bounds.intersect(vp);
|
bounds.intersect(vp);
|
||||||
|
|
||||||
return bounds;
|
return bounds;
|
||||||
|
|
Loading…
Add table
Reference in a new issue