Add USE_DRAW_POLYGON_FALLBACK build option for testing.

This new option, when enabled, forces the in-tree front ends
(Emcscripten, GTK, NestedVM, OS X, and Windows) to use the recently
introduced draw_polygon_fallback() in place of their native
draw_poly(). This will enable easy testing of this function in the
future.

This new option is off by default. To enable it, run CMake as:

$ cmake -DUSE_DRAW_POLYGON_FALLBACK=on

Note that I did _not_ update the Postscript frontend (ps.c) to use
this new option, as I don't think draw_polygon_fallback() would work
at all in Postscript, where the drawing units are no longer guaranteed
to be pixels. The envisioned use case for this option is a developer
testing changes to this function for sanity and/or performance, which
I only foresee happening on a standard GUI front end.
This commit is contained in:
Franklin Wei
2024-08-14 17:53:41 -04:00
committed by Simon Tatham
parent 989df5d2bf
commit a8b544d2aa
6 changed files with 25 additions and 0 deletions

View File

@ -899,7 +899,11 @@ const struct drawing_api win_drawing = {
win_draw_text,
win_draw_rect,
win_draw_line,
#ifdef USE_DRAW_POLYGON_FALLBACK
draw_polygon_fallback,
#else
win_draw_polygon,
#endif
win_draw_circle,
win_draw_update,
win_clip,