performance: Cache zone fill triangulation at draw.

This commit is contained in:
Alex Shvartzkop 2023-10-22 11:55:18 +03:00
parent f50de028fb
commit 08e8e13f46
1 changed files with 7 additions and 0 deletions

View File

@ -2484,6 +2484,13 @@ void PCB_PAINTER::draw( const ZONE* aZone, int aLayer )
m_gal->SetIsStroke( true );
}
// On Opengl, a not convex filled polygon is usually drawn by using triangles
// as primitives. CacheTriangulation() can create basic triangle primitives to
// draw the polygon solid shape on Opengl. GLU tessellation is much slower,
// so currently we are using our tessellation.
if( m_gal->IsOpenGlEngine() && !polySet->IsTriangulationUpToDate() )
polySet->CacheTriangulation( true, true );
m_gal->DrawPolygon( *polySet, displayMode == ZONE_DISPLAY_MODE::SHOW_TRIANGULATION );
}
}