Validate user data before passing it to PolyDraw.
The program in the bug requests to draw figures outrageously outside the DC's region after presumably, some uninitialized values happen as a result of a missing font. Native gdiplus seems to handle this gracefully so we probably also should.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=41617
Signed-off-by: David Kahurani <k.kahurani(a)gmail.com>
--
v7: gdiplus: Hook on optimized path drawing code
gdiplus: Re-implement trace_path to avoid circular dependency
gdiplus: Make get_region_hrgn public to gdiplus
gdiplus: Clip polygons before drawing them
gdiplus: Make get_graphis_device_bounds public to gdiplus
gdiplus: Allow for writing nodes to an empty path points list
https://gitlab.winehq.org/wine/wine/-/merge_requests/3288
On Fri Dec 15 16:05:24 2023 +0000, Esme Povirk wrote:
> I don't believe `draw_poly` is the right place for this. Either
> optimizations should be in gdi32, or in `SOFTWARE_GdipFillPath` (which
> we don't use now for drawing outlines because the gdi32 path is
> currently more efficient, but we could if that changed).
I guess the way forward would be:
1) Optimize `GdipGetRegionHrgn` in GDI+ which is done in this MR(assuming we remove the last patch)
2) Optimize `DrawPoly` in gdi32
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3288#note_56103
Esme Povirk (@madewokherd) commented about dlls/gdiplus/graphics.c:
> return Ok;
> }
>
> -static GpStatus get_graphics_device_bounds(GpGraphics* graphics, GpRectF* rect)
> +GpStatus get_graphics_device_bounds(GpGraphics* graphics, GpRectF* rect)
Changing a static function to non-static shouldn't be in its own commit. You should combine it with the first commit that uses it outside its source file.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3288#note_56101
Esme Povirk (@madewokherd) commented about dlls/gdiplus/graphicspath.c:
> * pointer on success
> * NULL on allocation problems
> */
> -static path_list_node_t* add_path_list_node(path_list_node_t *node, REAL x, REAL y, BOOL type)
> +static path_list_node_t* add_path_list_node(path_list_node_t **node, REAL x, REAL y, BOOL type)
> {
> path_list_node_t *new;
>
> + if (!*node)
> + {
> + *node = calloc(1, sizeof(path_list_node_t));
All fields are immediately initialized below, so I think it's fine to use `malloc`.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3288#note_56100
Adds an env variable WINE_WAYLAND_UNACCELERATED_POINTER
which allows raw input. This makes it easier to calculate
the same sensitivity in different games, use sensitivity
calculators, and easily change values when changing DPI
and do not depend on the compositor or OS.
For example, you want to set the sensitivity to half as much,
and sensitivity curves in libinput are more difficult
to calculate than in the games themselves.
--
v3: winewayland.drv: Add unaccelerated pointer support
https://gitlab.winehq.org/wine/wine/-/merge_requests/4698
Validate user data before passing it to PolyDraw.
The program in the bug requests to draw figures outrageously outside the DC's region after presumably, some uninitialized values happen as a result of a missing font. Native gdiplus seems to handle this gracefully so we probably also should.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=41617
Signed-off-by: David Kahurani <k.kahurani(a)gmail.com>
--
v6: gdiplus: Hook on optimized path drawing code
gdiplus: Re-implement trace_path to avoid circular dependency
gdiplus: Make get_region_hrgn public to gdiplus
gdiplus: Clip polygons before drawing them
gdiplus: Make get_graphis_device_bounds public to gdiplus
gdiplus: Allow for writing nodes to an empty path points list
https://gitlab.winehq.org/wine/wine/-/merge_requests/3288