Commit graph

2171 commits

Author SHA1 Message Date
Jeff Smith 0b34786097 gdiplus/tests: Use compare_uint() in compare_float() instead of abs().
The result of abs(INT_MIN) is INT_MIN, which breaks the ulps comparison.
2023-08-05 10:43:06 +09:00
David Kahurani 08d9f9b60b gdiplus: Use get_log_fontW in GdipGetLogFontW.
Signed-off-by: David Kahurani <k.kahurani@gmail.com>
2023-08-02 20:03:51 +09:00
David Kahurani 326a9e18bb gdiplus: Use helper to calculate transform properties.
Signed-off-by: David Kahurani <k.kahurani@gmail.com>
2023-08-02 20:03:51 +09:00
David Kahurani 40f06d46a3 gdiplus: Move Flatten() tests into the same function.
Signed-off-by: David Kahurani <k.kahurani@gmail.com>
2023-08-01 21:50:34 +09:00
David Kahurani d58d990256 gdiplus: Reject zero-width/zero-height rectangles.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55351
Signed-off-by: David Kahurani <k.kahurani@gmail.com>
2023-08-01 21:50:34 +09:00
Fabian Maurer 36c3a51d6a gdiplus: Prevent infinite loops due to floating point inaccuracy.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52492
2023-07-27 13:12:06 +09:00
Fabian Maurer 7da5dff88c gdiplus: Make flatten_bezier_add iterative. 2023-07-24 22:30:38 +02:00
David Kahurani cfc50b2887 gdiplus/font: Fix GdipGetLogFontW/A with gdi_transform.
Signed-off-by: David Kahurani <k.kahurani@gmail.com>
2023-07-24 22:11:52 +02:00
Jeff Smith 4245b1199c gdiplus: Set correct frame delay when GCE is missing. 2023-07-24 12:09:32 +02:00
Jeff Smith 8c6e578864 gdiplus: Return GIF frame property only if set. 2023-07-24 12:09:32 +02:00
Jeff Smith f6ef0205b8 gdiplus: Set GIF frame delay and loop count properties correctly.
These properties are expected to be present even if frame count is 1.
2023-07-24 12:09:31 +02:00
Jeff Smith ba564e2aba gdiplus: Expose GIF background index property only when global color table present. 2023-07-24 12:09:30 +02:00
Jeff Smith 07fa0082bb gdiplus/tests: Allow for testing properties of multiple GIF samples. 2023-07-24 12:09:30 +02:00
Jeff Smith 96540638e7 gdiplus/tests: Factor out property_test_data struct. 2023-07-24 12:09:30 +02:00
Alexandre Julliard 6077ea6946 gdiplus/tests: Use nameless unions/structs. 2023-07-20 21:48:39 +02:00
Jeff Smith b48a37f450 gdiplus: Fix GdipGetAllPropertyItems return value when no properties exist.
Discovered in researching https://bugs.winehq.org/show_bug.cgi?id=54748
2023-07-18 15:26:13 +02:00
Jeff Smith 1517342fac gdiplus: Fix GdipGetPropertySize return value when no properties exist.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54748
2023-07-18 15:26:13 +02:00
Jeff Smith d84210f00a gdiplus/tests: Pare down image property tests that are not run for Wine. 2023-07-18 15:26:13 +02:00
Jeff Smith 7c8a4c1ce8 gdiplus/tests: Use test context for test ran in a loop. 2023-07-18 15:26:13 +02:00
Jeff Smith 95be104443 gdiplus/tests: Add GIF to image properties tests. 2023-07-18 15:26:13 +02:00
Jeff Smith 211d538d35 gdiplus/tests: Use consistent no-alternate value for image properties. 2023-07-18 15:26:13 +02:00
Jeff Smith a55c89dba6 gdiplus/tests: Fix mangled test output when dumping data in hex format. 2023-07-17 21:58:57 +02:00
Alistair Leslie-Hughes 92f52d1eb4 gdiplus: Remove DECLSPEC_HIDDEN usage. 2023-07-17 09:40:20 +02:00
Alexandre Julliard 313e4d0efc gdiplus: Use nameless unions/structs. 2023-07-13 11:57:07 +02:00
David Kahurani 6c1319e7ad gdiplus: Dump both variable address and internal values for matrices.
Dumping variable address by itself is barely useful.

Signed-off-by: David Kahurani <k.kahurani@gmail.com>
2023-07-11 22:39:35 +02:00
Jeff Smith abdde73a1c gdiplus: Dash pattern scaling does not shrink below line width 1.0.
Signed-off-by: Jeff Smith <whydoubt@gmail.com>
2023-07-10 20:33:24 +02:00
Michael Stefaniuc 3bb5fcd5f3 gdiplus/tests: Remove superfluous casts to self. 2023-06-27 22:14:15 +02:00
David Kahurani 101bcc221d gdiplus: Allow NULL format in GdipAddPathString.
GdipAddPathString accepts NULL for format and presumably uses
the default format for formating

Signed-off-by: David Kahurani <k.kahurani@gmail.com>
2023-06-19 21:10:17 +02:00
Fabian Maurer 2c235b6fe4 gdiplus: Refactor and add comments for easier understanding.
Hopefully useful for people like me who had a hard time understanding
what was going on. Especially with the rearranged divison and the
simplification I had a hard time seeing why that does what it does

Signed-off-by: Fabian Maurer <dark.shadow4@web.de>
2023-06-19 13:17:24 +02:00
Zhiyi Zhang f9e77ad77c gdiplus: Support playing back pen custom end line cap.
Fix Cafe Stella (SteamID: 1829980) Flowchart crashes once there are 2 things on it.
2023-05-29 11:26:07 +02:00
Zhiyi Zhang fea3a7447a gdiplus: Support playing back pen custom start line cap. 2023-05-29 11:26:07 +02:00
Zhiyi Zhang 78261ecb98 gdiplus: Support recording pen custom end line cap. 2023-05-29 11:26:07 +02:00
Zhiyi Zhang abdd45c41a gdiplus: Support recording pen custom start line cap. 2023-05-29 11:26:06 +02:00
Zhiyi Zhang f76caee6e7 gdiplus/tests: Add pen custom line cap record and play back tests. 2023-05-29 11:26:06 +02:00
David Kahurani c1da4fb167 gdiplus: Handle Windows style newline.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54962
Signed-off-by: David Kahurani <k.kahurani@gmail.com>
2023-05-29 11:25:50 +02:00
Bartosz Kosiorek f898f206f6 gdiplus: Improve performance of DrawImagePointsRect by avoid TransformMatrixPoints.
Using TransformMatrixPoints is not needed and all values could
be taken from transformation matrix:
 - ShearX from m11, m12
 - ShearY from m21, m22
 - Translation mdx, mdy

The result could be calculated by taking destination points values:
 {{0.0, 0.0}, {1.0, 0.0}, {0.0, 1.0}}

and calculating it with GdipTransformMatrixPoints function:
  dst_to_src_points[0].X = dst_to_src.matrix[4];
  dst_to_src_points[0].Y = dst_to_src.matrix[5];
  dst_to_src_points[1].X = dst_to_src.matrix[0] + dst_to_src.matrix[4];
  dst_to_src_points[1].Y = dst_to_src.matrix[1] + dst_to_src.matrix[5];
  dst_to_src_points[2].X = dst_to_src.matrix[2] + dst_to_src.matrix[4];
  dst_to_src_points[2].Y = dst_to_src.matrix[3] + dst_to_src.matrix[5];
2023-05-23 22:19:30 +02:00
Bartosz Kosiorek 382603afa7 gdiplus: Use float increment instead of calculation to impove perf.
Improves efficiency by using addition instead of float numbers
multiplication for destination points.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53947
2023-05-23 22:19:30 +02:00
Bartosz Kosiorek 9705fbd493 gdiplus: Use iterator instead calculate pointer position every time.
With previous implementation, every iteration pointer value was
calculated by taking row and column of the image.
It needs multiply calculation. With current implementation,
pointer value calculation, is replaced with iterator, which takes
next pixel data.

It improves efficiency by using addition instead of multiplication
for iterating through points data.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53947
2023-05-23 22:19:30 +02:00
Bartosz Kosiorek 66ebf9169e gdiplus: Limit calculating transformation points to resampling.
Calculating transformation points and not using it it is a waste
of CPU time. With this patch the code was moved where it is used.
It is improving performance of GdipDrawImagePointsRect when
resampling is not needed.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53947
2023-05-23 22:19:30 +02:00
Bartosz Kosiorek 413fc34be7 gdiplus: Fix GdipGetGenericFontFamily functions according to native gdiplus.dll. 2023-05-22 22:56:13 +02:00
Bartosz Kosiorek 9749caf78e gdiplus: Improve performance of gdip_transform_points.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53947
2023-05-18 13:48:07 -05:00
Bartosz Kosiorek 9a94647656 gdiplus: Improve performance of GdipInvertMatrix.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53947
2023-05-18 05:29:12 -05:00
David Kahurani 03bc97a8c1 gdiplus: Traverse and draw the whole string.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45698
Signed-off-by: David Kahurani <k.kahurani@gmail.com>
2023-05-01 18:29:12 +02:00
Piotr Caban 333a63c456 gdiplus: Use transparency instead of background color if transparent color flag is set in GIF GCE.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54563
2023-03-06 11:09:39 +01:00
Florian Will b3bf30e7e2 gdiplus: Use FILE_SHARE_READ in GdipPrivateAddFontFile().
ZusiDisplay sometimes loads the same font file into two different
PrivateFontCollections using two threads, so there is a race condition
when the file is opened without the FILE_SHARE_READ sharing mode. The
second call to GdipPrivateAddFontFile() might fail if the first one
hasn't closed the file handle yet.
2023-03-02 10:20:39 +01:00
Florian Will 0ebf3222e5 gdiplus/tests: Test for GdipPrivateAddFontFile() sharing violation. 2023-03-02 10:20:38 +01:00
Alexandre Julliard fab4d1fd7f gdiplus: Initialize a variable to avoid a spurious compiler warning. 2023-01-27 13:39:07 +01:00
Bartosz Kosiorek 82d94219cb gdiplus: Improve performance of GdipTranslateMatrix.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53947
2022-12-09 21:21:59 +01:00
Bartosz Kosiorek 13b16116bf gdiplus: Improve performance of matrix multiplication by unrolling loop. 2022-12-06 17:17:23 +01:00
Bartosz Kosiorek a97911fdfe gdiplus: Improve performance of GdipScaleMatrix.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53947
2022-12-06 17:17:23 +01:00