Commit Graph

2550 Commits

Author SHA1 Message Date
Zhiyi Zhang 3ba4412be6 gdi32: Fix typos for GET_DC_PHYSDEV.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-03 23:32:38 +02:00
Nikolay Sivov 8241d21ae0 gdi32: Enumerate scalable fonts with zero charset mask as OEM.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51041
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-03 23:19:53 +02:00
Alexandre Julliard f2068ec438 gdi32: Don't bother computing the gamma ramp when not used.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-03 09:56:08 +02:00
Zhiyi Zhang 3ebc715881 gdi32: Reselect font and pen when changing world transforms for enhanced metafiles.
Reselect font and pen into enhanced metafile device contexts after world transform is changed so
that content can be drawn using the correct size. Also modifying the world transform for enhanced
metafiles doesn't generate EMR_SELECTOBJECT records according to winedump outputs.

Fix an issue that Tally may produce a print preview with a too large font or with a black side bar.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-20 21:07:10 +02:00
Zhiyi Zhang 1543be811d gdi32: Move common SetLayout() code to nulldrv_SetLayout().
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-20 21:07:10 +02:00
Zhiyi Zhang aadf11fb4f gdi32/tests: Test text extents for enhanced metafiles.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-20 21:07:10 +02:00
Zhiyi Zhang 8ae18d055a gdi32: Implement EMFDRV_AlphaBlend().
Fix a bug that Tally produces a blank print preview when images have to be scaled.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-20 21:07:10 +02:00
Zhiyi Zhang 0893240da5 gdi32/tests: Test GdiAlphaBlend() for enhanced metafiles.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-20 21:07:09 +02:00
Sven Baars 842b0d7338 gdi32: Fix some leaks on error paths.
Signed-off-by: Sven Baars <sbaars@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-19 22:06:55 +02:00
Sven Baars bdfc865014 gdi32: Fix a leak on error path (Coverity).
Signed-off-by: Sven Baars <sbaars@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-19 22:06:55 +02:00
Sven Baars 9cd6568062 gdi32: Add a missing break (Coverity).
Signed-off-by: Sven Baars <sbaars@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-19 22:06:55 +02:00
Sven Baars 265a32aa12 gdi32: Remove some unreachable code (Coverity).
Signed-off-by: Sven Baars <sbaars@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-19 22:06:55 +02:00
Gabriel Ivăncescu 02a94ecc86 gdi32: Use a lazy-init lookup cache when converting RGB values to colour table indices.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-16 22:39:46 +02:00
Gabriel Ivăncescu d4dc8fd2c2 gdi32: Move the loop through each clipped rectangle to the primitive blend funcs.
This is to prepare so we don't recalculate the lookup cache map for color
tables on every clipped rect (which is expensive).

Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-16 22:39:46 +02:00
Akihiro Sagawa 629ba19200 gdi32: Get rid of redundant ntmCellHeight member.
Signed-off-by: Akihiro Sagawa <sagawa.aki@gmail.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-07 22:36:11 +02:00
Akihiro Sagawa 837c4f4b87 gdi32: Fix text metrics used in EnumFonts families.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50818
Signed-off-by: Akihiro Sagawa <sagawa.aki@gmail.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-07 22:36:11 +02:00
Akihiro Sagawa 8f6f1c8f7a gdi32: Move otmEMSquare initialization to freetype_load_font.
Signed-off-by: Akihiro Sagawa <sagawa.aki@gmail.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-07 22:36:11 +02:00
Akihiro Sagawa 67093e3b4a gdi32/tests: Remove unreliable height tests.
Signed-off-by: Akihiro Sagawa <sagawa.aki@gmail.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-07 22:36:11 +02:00
Alexandre Julliard 23389127ec gdi32: Try to load the printer driver from the printer driver directory.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-03-31 19:26:09 +02:00
Zhiyi Zhang efdd6f46c9 gdi32: Fix handling of ModifyWorldTransform( MWT_IDENTITY ) on an emf dc.
When the mode parameter is MWT_IDENTITY, the xform parameter can be NULL because it should be
ignored and use the identity matrix.

Fix Tally crashing when exporting a JPEG image.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-03-31 19:26:09 +02:00
Byeongsik Jeon 56b16ff466 gdi32: Remove needTransform variable of freetype_get_glyph_outline().
Signed-off-by: Byeongsik Jeon <bsjeon@hanmail.net>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-03-09 21:33:43 +01:00
Byeongsik Jeon bb86ae80c8 gdi32: Remove metrics, vertical_metrics arguments of get_advance_metric().
Signed-off-by: Byeongsik Jeon <bsjeon@hanmail.net>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-03-09 21:33:43 +01:00
Byeongsik Jeon 64ca79529b gdi32: Remove incoming_font argument of get_advance_metric().
Signed-off-by: Byeongsik Jeon <bsjeon@hanmail.net>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-03-09 21:33:43 +01:00
Byeongsik Jeon 062aa9a614 gdi32: Fix typo in get_transformed_bbox() trace message.
Signed-off-by: Byeongsik Jeon <bsjeon@hanmail.net>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-03-09 21:33:43 +01:00
Byeongsik Jeon d6e83e3027 gdi32: Move FT_Library_SetLcdFilter() to init_freetype().
Signed-off-by: Byeongsik Jeon <bsjeon@hanmail.net>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-03-09 21:33:43 +01:00
Gabriel Ivăncescu 14a9551a94 gdi32: ExtTextOut should fail if count is larger than INT_MAX.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-03 21:01:38 +01:00
Alexandre Julliard 9581b2df8c gdi32: Cache the codepage tables also for OpenType names mapping.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-03 20:55:06 +01:00
Alexandre Julliard 8d373a67e1 gdi32/tests: Regenerate ttf files with the official fontforge version.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-03 20:43:55 +01:00
Zhiyi Zhang 8fad0b146d gdi32: Report real VREFRESH values for GetDeviceCaps() with display DCs.
Even though MSDN says 0 and 1 are both valid and they represent the default refresh rate of display
hardware. Some games rely on the value being the real refresh rate and use it to cap frame rates.

Fix an issue that Sakuna: Of Rice and Ruin reports monitors of 1Hz and cap to 1fps.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-27 21:12:06 +01:00
Zhiyi Zhang 2006f76b5f gdi32: Report correct HORZRES and VERTRES values for GetDeviceCaps() with DCs on a specific monitor.
Fix DLC Quest uses the primary monitor size to render when in fullscreen mode on non-primary monitors.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-27 21:12:01 +01:00
Alexandre Julliard b67f39ccc6 gdi32: Merge rectangles horizontally when possible in CreatePolyPolygonRgn.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50539
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-22 11:12:21 +01:00
Byeongsik Jeon f026739564 gdi32: Preserve the GGO_UNHINTED bits until used.
Fix a regression caused by 044315c0b3.

Signed-off-by: Byeongsik Jeon <bsjeon@hanmail.net>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-21 20:46:13 +01:00
Nikolay Sivov 016eeb5109 gdi32/uniscribe: Get rid of shaping group values in Arabic shaping data table.
It's not used right now, Syriac specific groups will be accomodated
as additional joining types.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-20 22:11:40 +01:00
Nikolay Sivov f734d98a98 gdi32/uniscribe: Merge Arabic joining types C and D.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-20 22:11:15 +01:00
Dmitry Timoshkov f45606c5f8 gdi32: Avoid best fit chars when mapping unicode character to a glyph index.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-20 22:09:48 +01:00
Zebediah Figura 96fdbabc72 gdi32: Do not compare face file names in insert_face_in_family_list() if either is NULL.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50486
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-01-15 10:09:47 +01:00
Alexandre Julliard 5e648e8967 gdi32: Don't fail font creation when we are out of handles.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50354
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-21 21:04:55 +01:00
Dmitry Timoshkov 22d776fc1b gdi32/tests: Add some tests to show that GetGlyphIndices() should avoid best fit chars.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-21 16:55:53 +01:00
Zhiyi Zhang aa3e02e193 gdi32/tests: Fix test failures on Win10 1909+.
Memory DC, metafile DC and enhanced metafile DC support gamma ramp on Win10 1909+.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-21 16:41:46 +01:00
Zhiyi Zhang d93412ca67 gdi32/tests: Fix possible test failures in test_clip_box().
When there are multiple monitors and their monitor region union can still be represented by a simple
rectangle, the clip box region type for the screen DC is still SIMPLEREGION.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-21 16:41:43 +01:00
Michael Stefaniuc f6a0c60618 gdi32/tests: Use wide-char string literals.
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-18 15:21:37 +01:00
Jacek Caban fcf545f449 winapi: Use __alignof__ on clang.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-16 15:30:07 +01:00
Alexandre Julliard a0559ad5c3 gdi32: Properly fail mapping glyph for invalid characters in fonts without encoding.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50252
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-14 17:02:39 +01:00
Alexandre Julliard 057b4b4148 gdi32: Don't create font substitutes for identical names.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-14 17:02:39 +01:00
Rémi Bernon 76c9dbd4fb gdi32: Fix gdi font leak in CreateScalableFontResourceW.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50273
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-09 22:09:53 +01:00
Rémi Bernon 06206f1628 gdi32: Don't try to get glyph index when default char is 0.
Fixes a regression from 5bdc6e0fe6, this
is what the code was originally doing.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50175
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-08 22:25:59 +01:00
Rémi Bernon 6245f07201 gdi32/tests: Test GetGlyphIndices with '\0' default and a glyph.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50175
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-08 22:25:59 +01:00
Alexandre Julliard 5f70191470 gdi32: Always let the Freetype driver fixup the AA flags.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50127
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-07 22:35:29 +01:00
Rémi Bernon 8aa404bba0 gdi32: Use FreeType as a fallback when loading font faces.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-03 20:18:38 +01:00
Rémi Bernon 3ea171dee5 gdi32: Try to parse font props without FreeType.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-12-03 20:18:38 +01:00