Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
49c801d0
Commit
49c801d0
authored
Jun 26, 2022
by
Ziqing Hui
Committed by
Alexandre Julliard
Jun 27, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d2d1/effect: Create implementation instance for the effect object.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
parent
4bb4469e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
83 additions
and
0 deletions
+83
-0
d2d1_private.h
dlls/d2d1/d2d1_private.h
+1
-0
effect.c
dlls/d2d1/effect.c
+82
-0
No files found.
dlls/d2d1/d2d1_private.h
View file @
49c801d0
...
...
@@ -654,6 +654,7 @@ struct d2d_effect
ID2D1Image
ID2D1Image_iface
;
LONG
refcount
;
ID2D1EffectImpl
*
impl
;
struct
d2d_effect_properties
properties
;
struct
d2d_effect_context
*
effect_context
;
ID2D1Image
**
inputs
;
...
...
dlls/d2d1/effect.c
View file @
49c801d0
...
...
@@ -20,6 +20,67 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
d2d
);
static
HRESULT
STDMETHODCALLTYPE
d2d_effect_impl_QueryInterface
(
ID2D1EffectImpl
*
iface
,
REFIID
iid
,
void
**
out
)
{
TRACE
(
"iface %p, iid %s, out %p.
\n
"
,
iface
,
debugstr_guid
(
iid
),
out
);
if
(
IsEqualGUID
(
iid
,
&
IID_ID2D1EffectImpl
)
||
IsEqualGUID
(
iid
,
&
IID_IUnknown
))
{
ID2D1EffectImpl_AddRef
(
iface
);
*
out
=
iface
;
return
S_OK
;
}
*
out
=
NULL
;
return
E_NOINTERFACE
;
}
static
ULONG
STDMETHODCALLTYPE
d2d_effect_impl_AddRef
(
ID2D1EffectImpl
*
iface
)
{
return
2
;
}
static
ULONG
STDMETHODCALLTYPE
d2d_effect_impl_Release
(
ID2D1EffectImpl
*
iface
)
{
return
1
;
}
static
HRESULT
STDMETHODCALLTYPE
d2d_effect_impl_Initialize
(
ID2D1EffectImpl
*
iface
,
ID2D1EffectContext
*
context
,
ID2D1TransformGraph
*
graph
)
{
return
S_OK
;
}
static
HRESULT
STDMETHODCALLTYPE
d2d_effect_impl_PrepareForRender
(
ID2D1EffectImpl
*
iface
,
D2D1_CHANGE_TYPE
type
)
{
return
S_OK
;
}
static
HRESULT
STDMETHODCALLTYPE
d2d_effect_impl_SetGraph
(
ID2D1EffectImpl
*
iface
,
ID2D1TransformGraph
*
graph
)
{
return
E_NOTIMPL
;
}
static
const
ID2D1EffectImplVtbl
d2d_effect_impl_vtbl
=
{
d2d_effect_impl_QueryInterface
,
d2d_effect_impl_AddRef
,
d2d_effect_impl_Release
,
d2d_effect_impl_Initialize
,
d2d_effect_impl_PrepareForRender
,
d2d_effect_impl_SetGraph
,
};
static
HRESULT
STDMETHODCALLTYPE
builtin_factory_stub
(
IUnknown
**
effect_impl
)
{
static
ID2D1EffectImpl
builtin_stub
=
{
&
d2d_effect_impl_vtbl
};
*
effect_impl
=
(
IUnknown
*
)
&
builtin_stub
;
return
S_OK
;
}
struct
d2d_effect_info
{
const
CLSID
*
clsid
;
...
...
@@ -684,6 +745,8 @@ static void d2d_effect_cleanup(struct d2d_effect *effect)
free
(
effect
->
inputs
);
ID2D1EffectContext_Release
(
&
effect
->
effect_context
->
ID2D1EffectContext_iface
);
d2d_effect_properties_cleanup
(
&
effect
->
properties
);
if
(
effect
->
impl
)
ID2D1EffectImpl_Release
(
effect
->
impl
);
}
static
HRESULT
STDMETHODCALLTYPE
d2d_effect_QueryInterface
(
ID2D1Effect
*
iface
,
REFIID
iid
,
void
**
out
)
...
...
@@ -1040,9 +1103,11 @@ HRESULT d2d_effect_create(struct d2d_device_context *context, const CLSID *effec
const
struct
d2d_effect_info
*
builtin
=
NULL
;
struct
d2d_effect_context
*
effect_context
;
const
struct
d2d_effect_registration
*
reg
;
PD2D1_EFFECT_FACTORY
factory
;
struct
d2d_effect
*
object
;
WCHAR
clsidW
[
39
];
unsigned
int
i
;
HRESULT
hr
;
if
(
!
(
reg
=
d2d_factory_get_registered_effect
(
context
->
factory
,
effect_id
)))
{
...
...
@@ -1091,6 +1156,8 @@ HRESULT d2d_effect_create(struct d2d_device_context *context, const CLSID *effec
D2D1_PROPERTY_TYPE_UINT32
,
max_inputs
);
d2d_effect_SetInputCount
(
&
object
->
ID2D1Effect_iface
,
builtin
->
default_input_count
);
factory
=
builtin_factory_stub
;
}
else
{
...
...
@@ -1102,11 +1169,26 @@ HRESULT d2d_effect_create(struct d2d_device_context *context, const CLSID *effec
d2d_effect_SetInputCount
(
&
object
->
ID2D1Effect_iface
,
1
);
factory
=
reg
->
factory
;
}
d2d_effect_properties_add
(
&
object
->
properties
,
L""
,
D2D1_PROPERTY_CLSID
,
D2D1_PROPERTY_TYPE_CLSID
,
clsidW
);
d2d_effect_properties_add
(
&
object
->
properties
,
L"Cached"
,
D2D1_PROPERTY_CACHED
,
D2D1_PROPERTY_TYPE_BOOL
,
L"false"
);
if
(
FAILED
(
hr
=
factory
((
IUnknown
**
)
&
object
->
impl
)))
{
WARN
(
"Failed to create implementation object, hr %#lx.
\n
"
,
hr
);
ID2D1Effect_Release
(
&
object
->
ID2D1Effect_iface
);
return
hr
;
}
if
(
FAILED
(
hr
=
ID2D1EffectImpl_Initialize
(
object
->
impl
,
&
effect_context
->
ID2D1EffectContext_iface
,
NULL
/* FIXME */
)))
{
WARN
(
"Failed to initialize effect, hr %#lx.
\n
"
,
hr
);
ID2D1Effect_Release
(
&
object
->
ID2D1Effect_iface
);
return
hr
;
}
*
effect
=
&
object
->
ID2D1Effect_iface
;
TRACE
(
"Created effect %p.
\n
"
,
*
effect
);
...
...
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