Commit graph

2123 commits

Author SHA1 Message Date
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
Bartosz Kosiorek edee5538e3 gdiplus: Add support for LineCapArrowAnchor.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=42809
2022-11-29 21:33:58 +01:00
Bartosz Kosiorek 0fd51346e1 gdiplus: Fix position of Custom Cap when Scale is different that 1. 2022-11-29 21:33:58 +01:00
Bartosz Kosiorek be7db8457d gdiplus: Add support for Custom Line Indent.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45273
2022-11-29 21:33:58 +01:00
Bartosz Kosiorek e0f32f53d5 gdiplus: Add GdipSetCustomLineCapStrokeCaps implementation and usage. 2022-11-23 22:27:38 +01:00
Bartosz Kosiorek cd17de8827 gdiplus: Fix shape of CustomLineCap created by GdipCreateAdjustableArrowCap. 2022-11-23 22:27:38 +01:00
Bartosz Kosiorek 1271ae3ebd gdiplus: Add support for widen path with GpCustomLineCap.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45273
2022-11-23 22:27:38 +01:00
Bartosz Kosiorek a8e8730769 gdiplus: Use GpPointF for drawing in widen_closed_figure. 2022-11-23 22:27:20 +01:00
Bartosz Kosiorek 200652075b gdiplus: Add GdipSetCustomLineCapBaseInset implementation. 2022-11-23 22:27:20 +01:00
Bartosz Kosiorek bc8ced226a gdiplus: Remove not used LineCustomCap parameter. 2022-11-23 22:27:20 +01:00
Bartosz Kosiorek 742c315702 gdiplus: Add GdipSetCustomLineCapBaseCap implementation.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45273
2022-11-23 22:27:20 +01:00
Alexandre Julliard a1c8232b33 include: Remove custom/undocumented language identifiers.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-11-16 21:24:18 +01:00
Bartosz Kosiorek 2f26b02fd2 gdiplus: Add GdipGetPenCompoundArray implementation.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52196
2022-10-31 12:11:55 +01:00
Bartosz Kosiorek e2e8487b99 gdiplus: Add GdipGetPenCompoundCount implementation.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52196
2022-10-31 12:05:02 +01:00
Bartosz Kosiorek 9d5d4dba28 gdiplus: Add GdipSetPenCompoundArray implementation.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52196
2022-10-31 12:04:59 +01:00
Jinoh Kang 72c0c88f2a gdiplus: Replace GpImage's busy flag with SRWLOCK.
Today, the image_unlock() helper function has a data race due to
non-atomic write to GpImage's 'busy' flag which is accessible by other
threads.  Also, it lacks a release fence, which means that other threads
can observe the unlocked (busy = 0) state too early when the current
thread unlocks the image; specifically, the write to the 'busy' field of
the GpImage can be reordered before the last read/write to any other
fields of the same GpImage.

Fix this by replacing the 'busy' field of GpImage with SRWLOCK.
2022-10-24 11:17:39 +02:00
Jinoh Kang 7abca9742a gdiplus: Avoid copying GpImage's busy flag in select_frame_wic().
The 'busy' field in GpImage is used as an atomic variable.  The C11
standard (§5.1.2.4, paragraph 25) states that two conflicting actions to
a memory location shall be both atomic operations, or otherwise properly
synchronized; otherwise, it constitutes a data race.

However, select_frame_wic() performs a non-atomic access to the 'busy'
field on a GpImage that is potentially accessible by other threads.
This happens when select_frame_wic() copies new_image to the old image
object.  Although it does attempt to preserve the value of the 'busy'
field by setting new_image->busy = image->busy first, thereby
effectively assigning an identical value to the field, it is unclear
that this does not actually constitute a theoretical, if not practical,
data race.  This also prevents replacing the busy flag with a mutex or
other synchronization primitives.

Therefore, skip the 'busy' field when copying fields from the new image
to the original image object.
2022-10-24 11:17:37 +02:00
Jinoh Kang d6b4321125 gdiplus: Avoid recursively locking image in GdipImageRotateFlip.
GdipImageRotateFlip() calls GdipBitmapLockBits() while holding the image
lock, resulting in a recursive lock.

Since GdipImageRotateFlip() uses GdipBitmapLockBits() only to obtain
Scan0 and Stride, replace them with equivalent fields from GpBitmap
itself.
2022-10-24 11:17:35 +02:00
Alexandre Julliard fe7df46118 gdiplus: Get the compositing mode directly from the graphics object.
GdipGetCompositingMode() fails when the object is busy, which happens
when flushing changes in GdipReleaseDC().

Fixes a test crash on Gitlab CI.
2022-09-28 15:39:04 +02:00
Esme Povirk 7d118a25c0 gdiplus: Accept newer version in OpenType header.
Signed-off-by: Esme Povirk <esme@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-11 11:54:54 +02:00
Eric Pouech 57a8ccf4e8 gdiplus/tests: Enable compilation with long types.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Esme Povirk <esme@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-28 21:31:56 +01:00
Eric Pouech eb39c4e4fe gdiplus/tests: Introduce helper functions (expect*) to handle integral conversions.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Esme Povirk <esme@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-28 21:31:56 +01:00
Eric Pouech af403bd34f gdiplus: Get rid of gcc11 warnings (-Warray-bounds).
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Esme Povirk <esme@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-16 08:22:06 +01:00
Eric Pouech aa9d1bd130 gdiplus/tests: Get rid of some GCC11 warnings (-Warray-bounds).
don't pretend using a BITMAPINFO when only a BITMAPINFOHEADER is used

Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Esme Povirk <esme@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-16 08:21:29 +01:00
Eric Pouech 846fcc5bf6 gdiplus: Enable compilation with long types.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Esme Povirk <esme@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-14 21:20:41 +01:00
Eric Pouech e393526855 gdiplus: Use correct integral type.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Esme Povirk <esme@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-04 22:44:48 +01:00
Fabian Maurer 759a93d94d gdiplus/tests: Avoid "misleading indentation" warnings.
Signed-off-by: Fabian Maurer <dark.shadow4@web.de>
Signed-off-by: Esme Povirk <esme@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-28 21:10:20 +01:00
Alexandre Julliard f0cd33c69e include: Add support for defining Win32 types as 'long' where possible.
Add -DWINE_NO_LONG_TYPES to modules that still have compilation
warnings with long types.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-27 20:38:22 +01:00
Florian Will 6090276b3e gdiplus: Disable PNG encoding filters.
This speeds up the encoding process, sometimes at the cost of increased
PNG file sizes. PNGs created using gdiplus on Windows 10 have filters
disabled, too, according to pngcheck.

The application "ZusiDisplay" encodes finished frames in PNG format and
sends them through a named pipe for "Zusi 3" to use as an in-game
texture, so performance matters for that use case to improve "embedded
display" FPS.

Signed-off-by: Florian Will <florian.will@gmail.com>
Signed-off-by: Esme Povirk <esme@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-25 09:25:40 +01:00
Bernhard Kölbl d3275f5f6a gdiplus: Add simple test for bitmap clone from rgb values to indexed.
Signed-off-by: Bernhard Kölbl <besentv@gmail.com>
Signed-off-by: Esme Povirk <esme@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-29 23:25:46 +01:00
Bernhard Kölbl ec29292141 gdiplus: Introduce dst palette parameter to convert_pixels().
Make it possible to define a destination colour palette when
using convert_pixels(), so converting a bitmap from a non
indexed format to an indexed format does not produce an empty image.

Signed-off-by: Bernhard Kölbl <besentv@gmail.com>
Signed-off-by: Esme Povirk <esme@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-29 23:25:46 +01:00
Esme Povirk 28c35689d2 gdiplus: Mark a Windows behavior as broken.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51989
Signed-off-by: Esme Povirk <esme@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-23 22:24:20 +01:00
Bernhard Kölbl 77121b3b23 gdiplus: Add pixel conversions to 4bpp indexed.
Signed-off-by: Bernhard Kölbl <besentv@gmail.com>
Signed-off-by: Esme Povirk <esme@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-19 20:56:26 +01:00
Huw Davies 0d8428fbc5 gdiplus: Switch to STRETCH_HALFTONE mode before playing a blit record.
This is done even if the emf contains a previous EMR_SETSTRETCHBLTMODE
record.

Thanks to Sebastián Aedo for some of the testing.

Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Esme Povirk <esme@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-20 20:11:46 +02:00
Alexandre Julliard 088a787a2c makefiles: Make -mno-cygwin the default.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-20 22:45:48 +02:00
Francois Gouget 53371cc556 gdiplus/tests: Fix a font test crash when "MS Shell Dlg" is not found.
When "MS Shell Dlg" is missing GdipCreateFontFamilyFromName() leaves
the GpFontFamily* pointer uninitialised. So initialize it to NULL in
order to get clean failures instead of a crash.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Esme Povirk <esme@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-27 20:27:22 +02:00
Francois Gouget ad663360fa gdiplus: GdipGetFamilyName() should not crash when given a NULL name.
It used to crash on Windows XP and Vista but does not since Windows 7.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Esme Povirk <esme@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-27 20:27:22 +02:00
Esme Povirk a554079860 gdiplus: Implement reference counting for private font families.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50896
Signed-off-by: Esme Povirk <esme@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-27 11:33:16 +02:00
Dongwan Kim aa54278250 gdiplus: Implement GdipEnumerateMetafileSrcRectDestRectI.
Signed-off-by: Dongwan Kim <kdw6485@gmail.com>
Signed-off-by: Esme Povirk <esme@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-18 21:25:00 +02:00
Haoyang Chen 43e2563f44 gdiplus: Avoid filtering of special characters.
Symbols such as ←  should also be displayed.

Signed-off-by: Haoyang Chen <chenhaoyang@uniontech.com>
Signed-off-by: Esme Povirk <esme@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-17 09:27:00 +02:00
Nikolay Sivov 2c77f717c8 gdiplus/metafile: Implement rendering origin recording.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Esme Povirk <esme@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-03-29 09:41:21 +02:00
Nikolay Sivov 42cb11b1c1 gdiplus/metafile: Implement SetClipPath() recording.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Esme Povirk <esme@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-03-29 09:41:19 +02:00
Nikolay Sivov 24278c4fc7 gdiplus/metafile: Implement ResetClip() recording.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Esme Povirk <esme@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-03-29 09:41:16 +02:00
Nikolay Sivov 33d2f6b7ec gdiplus/metafile: Implement TranslateClip() recording.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Esme Povirk <esme@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-03-29 09:41:13 +02:00
Nikolay Sivov 7ca2f86f06 gdiplus/metafile: Fully initialize record header on allocation.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Esme Povirk <esme@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-03-29 09:41:11 +02:00
Jacek Caban 883298f627 gdiplus: Use nameless unions.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Esme Povirk <esme@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-03-29 09:24:46 +02:00
Nikolay Sivov c17cd0fcab gdiplus/metafile: Implement DrawArc() recording.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Esme Povirk <esme@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-03-23 21:02:45 +01:00
Nikolay Sivov beefe76c6f gdiplus: Add a helper to initialize RectF.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Esme Povirk <esme@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-03-23 21:02:43 +01:00
Nikolay Sivov 41651d2e16 gdiplus: Forward GdipDrawRectangle() to GdipDrawRectangles().
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Esme Povirk <esme@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-03-23 21:02:40 +01:00