Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
5f1f52cf
Commit
5f1f52cf
authored
Jul 02, 2022
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jul 04, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d2d1/effect: Support parsing int32 property values.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
parent
618141d8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
1 deletion
+33
-1
effect.c
dlls/d2d1/effect.c
+2
-1
d2d1.c
dlls/d2d1/tests/d2d1.c
+31
-0
No files found.
dlls/d2d1/effect.c
View file @
5f1f52cf
...
...
@@ -267,7 +267,7 @@ static HRESULT d2d_effect_properties_internal_add(struct d2d_effect_properties *
0
,
/* D2D1_PROPERTY_TYPE_STRING */
sizeof
(
BOOL
),
/* D2D1_PROPERTY_TYPE_BOOL */
sizeof
(
UINT32
),
/* D2D1_PROPERTY_TYPE_UINT32 */
sizeof
(
INT32
),
/* D2D1_PROPERTY_TYPE_IN32 */
sizeof
(
INT32
),
/* D2D1_PROPERTY_TYPE_IN
T
32 */
sizeof
(
float
),
/* D2D1_PROPERTY_TYPE_FLOAT */
2
*
sizeof
(
float
),
/* D2D1_PROPERTY_TYPE_VECTOR2 */
3
*
sizeof
(
float
),
/* D2D1_PROPERTY_TYPE_VECTOR3 */
...
...
@@ -345,6 +345,7 @@ static HRESULT d2d_effect_properties_internal_add(struct d2d_effect_properties *
switch
(
p
->
type
)
{
case
D2D1_PROPERTY_TYPE_UINT32
:
case
D2D1_PROPERTY_TYPE_INT32
:
case
D2D1_PROPERTY_TYPE_ENUM
:
_uint32
=
wcstoul
(
value
,
NULL
,
10
);
src
=
&
_uint32
;
...
...
dlls/d2d1/tests/d2d1.c
View file @
5f1f52cf
...
...
@@ -50,6 +50,14 @@ L"<?xml version='1.0'?> \
<Property name='Max' type='uint32' value='100'/> \
<Property name='Default' type='uint32' value='10'/> \
</Property> \
<Property name='Int32Prop' type='int32' value='-2'> \
<Property name='DisplayName' type='string' value='Int32 prop'/> \
<Property name='Default' type='int32' value='10'/> \
</Property> \
<Property name='UInt32Prop' type='uint32' value='-3'> \
<Property name='DisplayName' type='string' value='UInt32 prop'/> \
<Property name='Default' type='uint32' value='10'/> \
</Property> \
<Property name='Bool' type='bool'> \
<Property name='DisplayName' type='string' value='Bool property'/> \
<Property name='Default' type='bool' value='false'/> \
...
...
@@ -11042,6 +11050,7 @@ static void test_effect_properties(BOOL d3d11)
ID2D1Effect
*
effect
;
UINT32
count
,
data
;
WCHAR
buffer
[
128
];
INT32
_int32
;
CLSID
clsid
;
BOOL
cached
;
HRESULT
hr
;
...
...
@@ -11133,6 +11142,28 @@ static void test_effect_properties(BOOL d3d11)
ID2D1Properties_Release
(
subproperties
);
/* Int32 property. */
index
=
ID2D1Effect_GetPropertyIndex
(
effect
,
L"Int32Prop"
);
hr
=
ID2D1Effect_GetPropertyName
(
effect
,
index
,
buffer
,
ARRAY_SIZE
(
buffer
));
ok
(
hr
==
S_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
ok
(
!
wcscmp
(
buffer
,
L"Int32Prop"
),
"Unexpected name %s.
\n
"
,
wine_dbgstr_w
(
buffer
));
prop_type
=
ID2D1Effect_GetType
(
effect
,
index
);
ok
(
prop_type
==
D2D1_PROPERTY_TYPE_INT32
,
"Unexpected type %u.
\n
"
,
prop_type
);
hr
=
ID2D1Effect_GetValue
(
effect
,
index
,
D2D1_PROPERTY_TYPE_INT32
,
(
BYTE
*
)
&
_int32
,
sizeof
(
_int32
));
ok
(
hr
==
S_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
ok
(
_int32
==
-
2
,
"Unexpected value %d.
\n
"
,
_int32
);
/* UInt32 property. */
index
=
ID2D1Effect_GetPropertyIndex
(
effect
,
L"UInt32Prop"
);
hr
=
ID2D1Effect_GetPropertyName
(
effect
,
index
,
buffer
,
ARRAY_SIZE
(
buffer
));
ok
(
hr
==
S_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
ok
(
!
wcscmp
(
buffer
,
L"UInt32Prop"
),
"Unexpected name %s.
\n
"
,
wine_dbgstr_w
(
buffer
));
prop_type
=
ID2D1Effect_GetType
(
effect
,
index
);
ok
(
prop_type
==
D2D1_PROPERTY_TYPE_UINT32
,
"Unexpected type %u.
\n
"
,
prop_type
);
hr
=
ID2D1Effect_GetValue
(
effect
,
index
,
D2D1_PROPERTY_TYPE_UINT32
,
(
BYTE
*
)
&
integer
,
sizeof
(
integer
));
ok
(
hr
==
S_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
ok
(
integer
==
-
3
,
"Unexpected value %u.
\n
"
,
integer
);
/* Vector2 property. */
index
=
ID2D1Effect_GetPropertyIndex
(
effect
,
L"Vec2Prop"
);
hr
=
ID2D1Effect_GetPropertyName
(
effect
,
index
,
buffer
,
ARRAY_SIZE
(
buffer
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment