View: optimize Fill/StrokePolygon with raw points array argument

Converting points array to `BPolygon` has significant cost, including
heap allocation, when drawing a lot of polygons.

Change-Id: I81e6b4031bac4beadcc79412c58eedddffc00a82
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10337
Reviewed-by: waddlesplash <[email protected]>
This commit is contained in:
X512
2026-03-05 02:42:51 +00:00
committed by waddlesplash
parent 7ef695df5c
commit 02683a08de
3 changed files with 103 additions and 35 deletions
+1 -1
View File
@@ -40,7 +40,7 @@ private:
bool _AddPoints(const BPoint* points, int32 count,
bool computeBounds);
void _ComputeBounds();
static BRect _ComputeBounds(const BPoint* points, uint32 count);
void _MapPoint(BPoint* point, const BRect& source,
const BRect& destination);
void _MapRectangle(BRect* rect, const BRect& source,