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
16710311
Commit
16710311
authored
Jan 03, 2024
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jan 22, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d2d1/effect: Use XML description for builtin effects.
parent
9b32b18b
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
114 additions
and
40 deletions
+114
-40
d2d1_private.h
dlls/d2d1/d2d1_private.h
+3
-2
effect.c
dlls/d2d1/effect.c
+0
-0
factory.c
dlls/d2d1/factory.c
+54
-22
d2d1.c
dlls/d2d1/tests/d2d1.c
+57
-16
No files found.
dlls/d2d1/d2d1_private.h
View file @
16710311
...
...
@@ -674,8 +674,6 @@ struct d2d_effect_registration
BOOL
builtin
;
CLSID
id
;
UINT32
input_count
;
UINT32
default_input_count
;
struct
d2d_effect_properties
properties
;
};
...
...
@@ -740,6 +738,9 @@ HRESULT d2d_effect_subproperties_add(struct d2d_effect_properties *props, const
struct
d2d_effect_property
*
d2d_effect_properties_get_property_by_name
(
const
struct
d2d_effect_properties
*
properties
,
const
WCHAR
*
name
);
void
d2d_effect_properties_cleanup
(
struct
d2d_effect_properties
*
props
);
HRESULT
d2d_factory_register_builtin_effect
(
struct
d2d_factory
*
factory
,
REFCLSID
effect_id
,
const
WCHAR
*
property_xml
,
const
D2D1_PROPERTY_BINDING
*
bindings
,
UINT32
binding_count
,
PD2D1_EFFECT_FACTORY
effect_factory
);
enum
d2d_command_list_state
{
...
...
dlls/d2d1/effect.c
View file @
16710311
This diff is collapsed.
Click to expand it.
dlls/d2d1/factory.c
View file @
16710311
...
...
@@ -69,7 +69,7 @@ struct d2d_effect_registration * d2d_factory_get_registered_effect(ID2D1Factory
struct
d2d_factory
*
factory
=
unsafe_impl_from_ID2D1Factory
(
iface
);
struct
d2d_effect_registration
*
reg
;
d2d_
effects_init_builtin
s
(
factory
);
d2d_
factory_init_builtin_effect
s
(
factory
);
LIST_FOR_EACH_ENTRY
(
reg
,
&
factory
->
effects
,
struct
d2d_effect_registration
,
entry
)
{
...
...
@@ -880,7 +880,7 @@ static HRESULT parse_effect_inputs(IXmlReader *reader, struct d2d_effect_registr
return
E_INVALIDARG
;
}
/* Apply default value to a missing property. */
/* Apply default value to a missing property.
If both properties are missing, add them.
*/
if
(
min_inputs
!=
max_inputs
)
{
swprintf
(
buffW
,
ARRAY_SIZE
(
buffW
),
L"%lu"
,
min_inputs
?
min_inputs_value
:
max_inputs_value
);
...
...
@@ -889,6 +889,13 @@ static HRESULT parse_effect_inputs(IXmlReader *reader, struct d2d_effect_registr
else
hr
=
d2d_effect_properties_add
(
&
effect
->
properties
,
L"MinInputs"
,
D2D1_PROPERTY_MIN_INPUTS
,
D2D1_PROPERTY_TYPE_UINT32
,
buffW
);
}
else
if
(
!
min_inputs
)
{
swprintf
(
buffW
,
ARRAY_SIZE
(
buffW
),
L"%lu"
,
input_count
);
hr
=
d2d_effect_properties_add
(
&
effect
->
properties
,
L"MinInputs"
,
D2D1_PROPERTY_MIN_INPUTS
,
D2D1_PROPERTY_TYPE_UINT32
,
buffW
);
if
(
SUCCEEDED
(
hr
))
hr
=
d2d_effect_properties_add
(
&
effect
->
properties
,
L"MaxInputs"
,
D2D1_PROPERTY_MAX_INPUTS
,
D2D1_PROPERTY_TYPE_UINT32
,
buffW
);
}
return
hr
;
}
...
...
@@ -933,21 +940,15 @@ static HRESULT parse_effect_xml(IXmlReader *reader, struct d2d_effect_registrati
return
hr
;
}
static
HRESULT
STDMETHODCALLTYPE
d2d_factory_RegisterEffectFromStream
(
ID2D1Factory3
*
iface
,
static
HRESULT
d2d_factory_register_effect_from_stream
(
struct
d2d_factory
*
factory
,
REFCLSID
effect_id
,
IStream
*
property_xml
,
const
D2D1_PROPERTY_BINDING
*
bindings
,
UINT32
binding_count
,
PD2D1_EFFECT_FACTORY
effect_factory
)
UINT32
binding_count
,
PD2D1_EFFECT_FACTORY
effect_factory
,
BOOL
builtin
)
{
struct
d2d_factory
*
factory
=
impl_from_ID2D1Factory3
(
iface
);
struct
d2d_effect_registration
*
effect
;
IXmlReader
*
reader
;
unsigned
int
i
;
HRESULT
hr
;
TRACE
(
"iface %p, effect_id %s, property_xml %p, bindings %p, binding_count %u, effect_factory %p.
\n
"
,
iface
,
debugstr_guid
(
effect_id
),
property_xml
,
bindings
,
binding_count
,
effect_factory
);
d2d_factory_init_builtin_effects
(
factory
);
LIST_FOR_EACH_ENTRY_REV
(
effect
,
&
factory
->
effects
,
struct
d2d_effect_registration
,
entry
)
{
if
(
IsEqualGUID
(
effect_id
,
&
effect
->
id
))
...
...
@@ -972,6 +973,7 @@ static HRESULT STDMETHODCALLTYPE d2d_factory_RegisterEffectFromStream(ID2D1Facto
IXmlReader_Release
(
reader
);
return
E_OUTOFMEMORY
;
}
effect
->
builtin
=
builtin
;
hr
=
parse_effect_xml
(
reader
,
effect
);
IXmlReader_Release
(
reader
);
...
...
@@ -1013,28 +1015,35 @@ static HRESULT STDMETHODCALLTYPE d2d_factory_RegisterEffectFromStream(ID2D1Facto
effect
->
registration_count
=
1
;
effect
->
id
=
*
effect_id
;
effect
->
factory
=
effect_factory
;
d2d_effect_properties_add
(
&
effect
->
properties
,
L"MinInputs"
,
D2D1_PROPERTY_MIN_INPUTS
,
D2D1_PROPERTY_TYPE_UINT32
,
L"1"
);
d2d_effect_properties_add
(
&
effect
->
properties
,
L"MaxInputs"
,
D2D1_PROPERTY_MAX_INPUTS
,
D2D1_PROPERTY_TYPE_UINT32
,
L"1"
/* FIXME */
);
effect
->
default_input_count
=
1
;
d2d_factory_register_effect
(
factory
,
effect
);
return
S_OK
;
}
static
HRESULT
STDMETHODCALLTYPE
d2d_factory_RegisterEffectFromStr
ing
(
ID2D1Factory3
*
iface
,
REFCLSID
effect_id
,
const
WCHAR
*
property_xml
,
const
D2D1_PROPERTY_BINDING
*
bindings
,
static
HRESULT
STDMETHODCALLTYPE
d2d_factory_RegisterEffectFromStr
eam
(
ID2D1Factory3
*
iface
,
REFCLSID
effect_id
,
IStream
*
property_xml
,
const
D2D1_PROPERTY_BINDING
*
bindings
,
UINT32
binding_count
,
PD2D1_EFFECT_FACTORY
effect_factory
)
{
struct
d2d_factory
*
factory
=
impl_from_ID2D1Factory3
(
iface
);
TRACE
(
"iface %p, effect_id %s, property_xml %p, bindings %p, binding_count %u, effect_factory %p.
\n
"
,
iface
,
debugstr_guid
(
effect_id
),
property_xml
,
bindings
,
binding_count
,
effect_factory
);
d2d_factory_init_builtin_effects
(
factory
);
return
d2d_factory_register_effect_from_stream
(
factory
,
effect_id
,
property_xml
,
bindings
,
binding_count
,
effect_factory
,
FALSE
);
}
static
HRESULT
d2d_factory_register_effect_from_string
(
struct
d2d_factory
*
factory
,
REFCLSID
effect_id
,
const
WCHAR
*
property_xml
,
const
D2D1_PROPERTY_BINDING
*
bindings
,
UINT32
binding_count
,
PD2D1_EFFECT_FACTORY
effect_factory
,
BOOL
builtin
)
{
static
const
LARGE_INTEGER
zero
;
IStream
*
stream
;
ULONG
size
;
HRESULT
hr
;
TRACE
(
"iface %p, effect_id %s, property_xml %s, bindings %p, binding_count %u, effect_factory %p.
\n
"
,
iface
,
debugstr_guid
(
effect_id
),
debugstr_w
(
property_xml
),
bindings
,
binding_count
,
effect_factory
);
if
(
FAILED
(
hr
=
CreateStreamOnHGlobal
(
NULL
,
TRUE
,
&
stream
)))
return
hr
;
...
...
@@ -1043,13 +1052,36 @@ static HRESULT STDMETHODCALLTYPE d2d_factory_RegisterEffectFromString(ID2D1Facto
hr
=
IStream_Seek
(
stream
,
zero
,
SEEK_SET
,
NULL
);
if
(
SUCCEEDED
(
hr
))
hr
=
ID2D1Factory3_RegisterEffectFromStream
(
iface
,
effect_id
,
stream
,
bindings
,
binding_count
,
effect_factory
);
hr
=
d2d_factory_register_effect_from_stream
(
factory
,
effect_id
,
stream
,
bindings
,
binding_count
,
effect_factory
,
builtin
);
IStream_Release
(
stream
);
return
hr
;
}
HRESULT
d2d_factory_register_builtin_effect
(
struct
d2d_factory
*
factory
,
REFCLSID
effect_id
,
const
WCHAR
*
property_xml
,
const
D2D1_PROPERTY_BINDING
*
bindings
,
UINT32
binding_count
,
PD2D1_EFFECT_FACTORY
effect_factory
)
{
return
d2d_factory_register_effect_from_string
(
factory
,
effect_id
,
property_xml
,
bindings
,
binding_count
,
effect_factory
,
TRUE
);
}
static
HRESULT
STDMETHODCALLTYPE
d2d_factory_RegisterEffectFromString
(
ID2D1Factory3
*
iface
,
REFCLSID
effect_id
,
const
WCHAR
*
property_xml
,
const
D2D1_PROPERTY_BINDING
*
bindings
,
UINT32
binding_count
,
PD2D1_EFFECT_FACTORY
effect_factory
)
{
struct
d2d_factory
*
factory
=
impl_from_ID2D1Factory3
(
iface
);
TRACE
(
"iface %p, effect_id %s, property_xml %s, bindings %p, binding_count %u, effect_factory %p.
\n
"
,
iface
,
debugstr_guid
(
effect_id
),
debugstr_w
(
property_xml
),
bindings
,
binding_count
,
effect_factory
);
d2d_factory_init_builtin_effects
(
factory
);
return
d2d_factory_register_effect_from_string
(
factory
,
effect_id
,
property_xml
,
bindings
,
binding_count
,
effect_factory
,
FALSE
);
}
static
HRESULT
STDMETHODCALLTYPE
d2d_factory_UnregisterEffect
(
ID2D1Factory3
*
iface
,
REFCLSID
effect_id
)
{
struct
d2d_factory
*
factory
=
impl_from_ID2D1Factory3
(
iface
);
...
...
dlls/d2d1/tests/d2d1.c
View file @
16710311
This diff is collapsed.
Click to expand it.
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