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
5284e1db
Commit
5284e1db
authored
Jul 02, 2022
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jul 05, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d2d1: Implement GetRegisteredEffects().
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
parent
97abb6d2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
92 additions
and
2 deletions
+92
-2
factory.c
dlls/d2d1/factory.c
+28
-2
d2d1.c
dlls/d2d1/tests/d2d1.c
+64
-0
No files found.
dlls/d2d1/factory.c
View file @
5284e1db
...
...
@@ -1037,10 +1037,36 @@ static HRESULT STDMETHODCALLTYPE d2d_factory_UnregisterEffect(ID2D1Factory3 *ifa
static
HRESULT
STDMETHODCALLTYPE
d2d_factory_GetRegisteredEffects
(
ID2D1Factory3
*
iface
,
CLSID
*
effects
,
UINT32
effect_count
,
UINT32
*
returned
,
UINT32
*
registered
)
{
FIXME
(
"iface %p, effects %p, effect_count %u, returned %p, registered %p stub!
\n
"
,
struct
d2d_factory
*
factory
=
impl_from_ID2D1Factory3
(
iface
);
struct
d2d_effect_registration
*
effect
;
UINT32
ret
,
reg
;
TRACE
(
"iface %p, effects %p, effect_count %u, returned %p, registered %p.
\n
"
,
iface
,
effects
,
effect_count
,
returned
,
registered
);
return
E_NOTIMPL
;
if
(
!
returned
)
returned
=
&
ret
;
if
(
!
registered
)
registered
=
&
reg
;
*
registered
=
0
;
*
returned
=
0
;
d2d_factory_init_builtin_effects
(
factory
);
LIST_FOR_EACH_ENTRY
(
effect
,
&
factory
->
effects
,
struct
d2d_effect_registration
,
entry
)
{
if
(
effects
&&
effect_count
)
{
*
effects
=
effect
->
id
;
effects
++
;
effect_count
--
;
*
returned
+=
1
;
}
*
registered
+=
1
;
}
if
(
!
effects
)
return
S_OK
;
return
*
returned
==
*
registered
?
S_OK
:
D2DERR_INSUFFICIENT_BUFFER
;
}
static
HRESULT
STDMETHODCALLTYPE
d2d_factory_GetEffectProperties
(
ID2D1Factory3
*
iface
,
...
...
dlls/d2d1/tests/d2d1.c
View file @
5284e1db
...
...
@@ -11935,6 +11935,69 @@ static void test_effect_grayscale(BOOL d3d11)
release_test_context
(
&
ctx
);
}
static
void
test_registered_effects
(
BOOL
d3d11
)
{
UINT32
ret
,
count
,
count2
,
count3
;
struct
d2d1_test_context
ctx
;
ID2D1Factory1
*
factory
;
CLSID
*
effects
;
HRESULT
hr
;
if
(
!
init_test_context
(
&
ctx
,
d3d11
))
return
;
factory
=
ctx
.
factory1
;
count
=
0
;
hr
=
ID2D1Factory1_GetRegisteredEffects
(
factory
,
NULL
,
0
,
NULL
,
&
count
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
ok
(
count
>
0
,
"Unexpected effect count %u.
\n
"
,
count
);
hr
=
ID2D1Factory1_RegisterEffectFromString
(
factory
,
&
CLSID_TestEffect
,
effect_xml_a
,
NULL
,
0
,
effect_impl_create
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
count2
=
0
;
hr
=
ID2D1Factory1_GetRegisteredEffects
(
factory
,
NULL
,
0
,
NULL
,
&
count2
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
ok
(
count2
==
count
+
1
,
"Unexpected effect count %u.
\n
"
,
count2
);
effects
=
calloc
(
count2
,
sizeof
(
*
effects
));
count3
=
0
;
hr
=
ID2D1Factory1_GetRegisteredEffects
(
factory
,
effects
,
0
,
NULL
,
&
count3
);
ok
(
hr
==
D2DERR_INSUFFICIENT_BUFFER
,
"Unexpected hr %#lx.
\n
"
,
hr
);
ok
(
count2
==
count3
,
"Unexpected effect count %u.
\n
"
,
count3
);
ret
=
999
;
hr
=
ID2D1Factory1_GetRegisteredEffects
(
factory
,
effects
,
0
,
&
ret
,
NULL
);
ok
(
hr
==
D2DERR_INSUFFICIENT_BUFFER
,
"Unexpected hr %#lx.
\n
"
,
hr
);
ok
(
!
ret
,
"Unexpected count %u.
\n
"
,
ret
);
ret
=
0
;
hr
=
ID2D1Factory1_GetRegisteredEffects
(
factory
,
effects
,
1
,
&
ret
,
NULL
);
ok
(
hr
==
D2DERR_INSUFFICIENT_BUFFER
,
"Unexpected hr %#lx.
\n
"
,
hr
);
ok
(
ret
==
1
,
"Unexpected count %u.
\n
"
,
ret
);
ok
(
!
IsEqualGUID
(
effects
,
&
CLSID_TestEffect
),
"Unexpected clsid.
\n
"
);
ret
=
0
;
hr
=
ID2D1Factory1_GetRegisteredEffects
(
factory
,
effects
,
count2
,
&
ret
,
NULL
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
ok
(
ret
==
count2
,
"Unexpected count %u.
\n
"
,
ret
);
ok
(
IsEqualGUID
(
&
effects
[
ret
-
1
],
&
CLSID_TestEffect
),
"Unexpected clsid.
\n
"
);
free
(
effects
);
ID2D1Factory1_UnregisterEffect
(
factory
,
&
CLSID_TestEffect
);
count2
=
0
;
hr
=
ID2D1Factory1_GetRegisteredEffects
(
factory
,
NULL
,
0
,
NULL
,
&
count2
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
ok
(
count2
==
count
,
"Unexpected effect count %u.
\n
"
,
count2
);
release_test_context
(
&
ctx
);
}
static
void
test_stroke_contains_point
(
BOOL
d3d11
)
{
ID2D1TransformedGeometry
*
transformed_geometry
;
...
...
@@ -12749,6 +12812,7 @@ START_TEST(d2d1)
queue_test
(
test_effect_2d_affine
);
queue_test
(
test_effect_crop
);
queue_test
(
test_effect_grayscale
);
queue_test
(
test_registered_effects
);
queue_d3d10_test
(
test_stroke_contains_point
);
queue_test
(
test_image_bounds
);
queue_test
(
test_bitmap_map
);
...
...
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