Commit Graph

501 Commits

Author SHA1 Message Date
Ziqing Hui c634bd201b d2d1: Implement SetUnitMode().
Signed-off-by: Ziqing Hui <zhui@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-15 20:53:45 +02:00
Ziqing Hui eeed1bb541 d2d1: Implement GetUnitMode().
Signed-off-by: Ziqing Hui <zhui@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-15 20:53:42 +02:00
Ziqing Hui a23e07937d d2d1/tests: Add tests for context unit mode.
Signed-off-by: Ziqing Hui <zhui@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-13 18:17:13 +02:00
Ziqing Hui c037144db7 d2d1: Implement GetImageLocalBounds() for bitmap.
Signed-off-by: Ziqing Hui <zhui@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-12 21:39:42 +02:00
Ziqing Hui 1f0b080f15 d2d1/tests: Add tests for GetImageLocalBounds().
Signed-off-by: Ziqing Hui <zhui@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-12 21:39:42 +02:00
Ziqing Hui ca5a2bf076 d2d1/tests: Add tests for D2D1Grayscale effect.
Signed-off-by: Ziqing Hui <zhui@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-05 17:50:57 +02:00
Ziqing Hui a45a4b0b48 d2d1: Add stubs for ID2D1Factory3.
Signed-off-by: Ziqing Hui <zhui@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-04 19:52:45 +02:00
Ziqing Hui e0be2d476f include: Add defines for ID2D1InkStyle.
Signed-off-by: Ziqing Hui <zhui@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-29 20:53:50 +02:00
Ziqing Hui 16abbb4ae8 d2d1: Fix a typo.
Signed-off-by: Ziqing Hui <zhui@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-29 20:53:50 +02:00
Michael Stefaniuc 9bfe419e67 d2d1/tests: Actually test the return of ID2D1TransformedGeometry_GetBounds.
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-14 18:30:28 +01:00
Zhiyi Zhang b88f06fd34 d2d1: Shrink stroke width for d2d_transformed_geometry_StrokeContainsPoint().
So that stroke width won't be transformed. Fix PowerPoint 2016 text in TextBoxes can not be selected
properly.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-11 19:23:28 +01:00
Zhiyi Zhang f2dbb0b410 d2d1/tests: Add d2d_transformed_geometry_StrokeContainsPoint() tests.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-11 19:23:28 +01:00
Zhiyi Zhang 6556ed2058 d2d1: Use newer blend options in d2d_device_context_SetTarget() for bitmaps of D2D1_ALPHA_MODE_IGNORE.
When bitmap alpha mode is D2D1_ALPHA_MODE_IGNORE, D3D11_BLEND_ZERO is used for SrcBlendAlpha and
D3D11_BLEND_ONE for DestBlendAlpha on Win7. However, tests show that D3D11_BLEND_ONE is used for
SrcBlendAlpha and D3D11_BLEND_INV_SRC_ALPHA for DestBlendAlpha on Win8+. The patch changes
d2d_device_context_SetTarget() to use the Win8+ behaviour.

Fix PowerPoint 2016 slideshow artifacts.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-11 19:23:28 +01:00
Zhiyi Zhang fe4c187a7c d2d1/tests: Test d2d_device_context_SetTarget() with bitmaps of D2D1_ALPHA_MODE_IGNORE.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-11 19:23:28 +01:00
Zhiyi Zhang d0902b7c8e d2d1: Release bitmap on d2d_device_context_SetTarget() error path.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-11 19:23:28 +01:00
Jactry Zeng f8426dbb3b d2d1: Add D2D1Shadow effect.
Signed-off-by: Jactry Zeng <jzeng@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-07 16:29:57 +01:00
Francois Gouget 0cdbbd2913 d2d1/tests: Fix the spelling of an ok() message.
Signed-off-by: Francois Gouget <fgouget@free.fr>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-14 21:20:42 +01:00
Jactry Zeng 1a3921475c d2d1: Implement d2d_bitmap_CopyFromBitmap().
Signed-off-by: Jactry Zeng <jzeng@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-11 17:08:46 +01:00
Zebediah Figura 0823de79c1 d2d1/tests: Don't run the 32-bit tests multithreaded.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-07 17:31:31 +01:00
Eric Pouech aa45100f4a d2d1/tests: Build without -DWINE_NO_LONG_TYPES.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-03 21:06:36 +01:00
Henri Verbeet a6b44a551f d2d1/tests: Declare "level" as D3D_FEATURE_LEVEL in create_d3d11_device().
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-03 21:06:32 +01:00
Henri Verbeet ce6372d9b8 d2d1/tests: Pass the hash size as DWORD in compare_sha1().
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-03 21:06:29 +01:00
Eric Pouech 0201606bac d2d1: Build without -DWINE_NO_LONG_TYPES.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-01 20:36:16 +01:00
Henri Verbeet 2c6fd7b617 d2d1: Return numeric configuration settings as uint32_t.
To allow building without -DWINE_NO_LONG_TYPES.

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-01 20:36:09 +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
Fabian Maurer d2f7621f34 d2d1/tests: Avoid "misleading indentation" warnings.
Signed-off-by: Fabian Maurer <dark.shadow4@web.de>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-26 21:53:35 +01:00
Stefan Brüns 7aaeec35e2 d2d1/tests: Avoid out-of-bounds access when comparing segments.
In case real and expected segment count differ, don't compare the
segment type/position for extra segments.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-12 20:29:34 +01:00
Stefan Brüns ee59534f9c d2d1: Remove extraneous checks for last vertex.
The very last vertex of a figure can only be a of type LINE
(non-coincident last/first vertices) or type END (otherwise).
In case the current vertex starts a Bézier path, there is always
at least one more vertex, i.e. (vertex_idx + 1) < vertex_count
is always true.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-11 21:59:51 +01:00
Stefan Brüns b92b6c2929 d2d1: Use the TYPE_END vertex type when last/first vertices coincide.
When the last vertex is coincident with the first vertex, the last
segment should be suppressed for both END_OPEN and END_CLOSED.
Only when last and first vertex are not coincident the additional
line segment may be added - always for intersection tests and
similar, and for stroking operations when the figure is CLOSED.

Trying to use an zero-length segment in d2d_geometry_intersect_self()
will create invalid segments, causing infinite loops later.

Instead of reducing the vertex_count for coincident first/last
vertices add a dedicated type. This is required as some operations
need the last segment, others do not.

This also allows to remove some replicated code in
StrokeContains()/GetBounds()/Simplify(), as a last Bézier segment
is always processed in the regular loop.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51139
Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-11 21:59:51 +01:00
Stefan Brüns 065917d101 d2d1: Refactor outline generation as preparation for the new TYPE_END vertex type.
This is a preparative patch for the next change, behaviour is
essentially unchanged, though it may be slightly faster.

Rearrange code for outline segment and join generation so it
will work for END_OPEN/END_CLOSED path, with coincident and disparate
last/first vertex.

Each vertex is now fetched once, and pivoted on the next iteration.
Also move invariants in front of the loop,

Path segments are drawn starting with the first segment, up
to vertex_count - 2 (index of start vertex). Only in case of
a END_CLOSED figure with non-coincident last/first vertex,
also the last line segment is drawn.

Joins are added between all drawn segments, and only for
END_CLOSED also the join at the first vertex is added.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-11 21:59:51 +01:00
Stefan Brüns 56f2d1c1a7 d2d1/tests: Test coincident last/first vertex for both OPEN and CLOSED.
Provide two orientatations for both cases (END_OPEN/END_CLOSED) each.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51139
Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-11 21:59:51 +01:00
Stefan Brüns 31ac65e9ab d2d1/tests: Add a test for single quadratic Bézier segment.
Extra test for outline generation code, path with only 2 vertices.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-11 21:59:51 +01:00
Stefan Brüns da3fec94c1 d2d1: Silence SetSegmentFlags() FIXME when setting default value.
Some software (Buhl Tax and variants) repeatedly calls SetSegmentFlags()
with D2D1_PATH_SEGMENT_NONE, which is just the default value and has no
effect (unless the flags where already changed, which still reports
a FIXME).

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-11 21:59:51 +01:00
Stefan Brüns 2ec267c0de d2d1/tests: Test StrokeContains when last segment is bezier and closes the path.
Also check StrokeContains result on the last segment when the last vertex
of a bezier curve coincedes with the first vertex of the figure and
the figure is explicitly closed.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-07 21:40:02 +01:00
Henri Verbeet 7fabf02978 d2d1: Create feature level 10.0 device context state objects.
Commit 8c93549262 introduced a feature level
11.0 requirement for Direct2D, but that was unintentional. We want Direct2D to
be usable with feature level 10.0 hardware, and don't actually require any
feature level 11.0 features.

This issue was pointed out by Matteo Bruni.

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-10 22:00:17 +01:00
Dmitry Timoshkov ac34ebf891 d2d1: Implement ID2D1Factory2::CreateStrokeStyle1().
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-09 17:14:59 +01:00
David White b495ff5cc8 d2d1: Implement path_geometry_StrokeContainsPoint() for Bézier segments.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-08 22:14:45 +01:00
David White f467f6385e d2d1: Implement path_geometry_StrokeContainsPoint() for line segments.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-08 22:14:45 +01:00
Nikolay Sivov 1fceac2382 d2d1: Implement d2d_rectangle_geometry_StrokeContainsPoint().
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-08 22:14:45 +01:00
Henri Verbeet bdd49f86f5 d2d1: Store original Bézier curves as cubics.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-08 22:14:44 +01:00
Jan Sikorski bf284dfc17 d2d1: Explicitly set default blend state.
Signed-off-by: Jan Sikorski <jsikorski@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-03 21:06:48 +01:00
Ziqing Hui 36c80777f1 d2d1/tests: Add tests for crop effect.
Signed-off-by: Ziqing Hui <zhui@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-05 20:09:21 +02:00
Ziqing Hui 57d5314ad6 d2d1/tests: Add tests for 2D affine effect.
Signed-off-by: Ziqing Hui <zhui@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-29 21:38:11 +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
Henri Verbeet 8718a23b2e d2d1: Check the vertex count again after duplicate removal in d2d_path_geometry_triangulate().
As the test shows, we can create geometries that have less than two vertices
after eliminating duplicates. Calling d2d_cdt_triangulate() on those would
lead to infinite recursion. In principle we could now get rid of the original
vertex count check, but it seems cheap enough that it's worth keeping in order
to avoid some unnecessary work in the somewhat more common case that we have
less than three vertices before duplicate removal.

Based on a patch by Changsheng Chen.

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-16 22:22:44 +02:00
Francois Gouget a3efdeeb17 d2d1/tests: Some languages need a longer buffer for property display names.
Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-17 18:16:49 +02:00
Ziqing Hui a52b58473c d2d1: Add D2D1Crop.
Signed-off-by: Ziqing Hui <zhui@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-11 23:00:50 +02:00
Ziqing Hui 77930f1fe2 d2d1: Implement d2d_effect_GetValue().
Signed-off-by: Ziqing Hui <zhui@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-10 17:53:55 +02:00
Ziqing Hui a60e45b64b d2d1: Implement d2d_effect_SetInputCount().
Signed-off-by: Ziqing Hui <zhui@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-10 17:53:55 +02:00
Ziqing Hui 8bf2603838 d2d1: Implement d2d_effect_GetInput().
Signed-off-by: Ziqing Hui <zhui@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-09 21:05:38 +02:00