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
c172b895
Commit
c172b895
authored
Jun 26, 2022
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jun 27, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d2d1: Move effect object creation to effect.c.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
parent
8eff207c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
40 deletions
+35
-40
d2d1_private.h
dlls/d2d1/d2d1_private.h
+2
-2
device.c
dlls/d2d1/device.c
+1
-27
effect.c
dlls/d2d1/effect.c
+32
-11
No files found.
dlls/d2d1/d2d1_private.h
View file @
c172b895
...
...
@@ -624,8 +624,8 @@ struct d2d_effect
size_t
input_count
;
};
HRESULT
d2d_effect_
init
(
struct
d2d_effect
*
effect
,
struct
d2d_effect_context
*
effect_context
,
const
CLSID
*
effect_id
)
DECLSPEC_HIDDEN
;
HRESULT
d2d_effect_
create
(
struct
d2d_device_context
*
context
,
const
CLSID
*
effect_id
,
ID2D1Effect
**
effect
)
DECLSPEC_HIDDEN
;
static
inline
BOOL
d2d_array_reserve
(
void
**
elements
,
size_t
*
capacity
,
size_t
count
,
size_t
size
)
{
...
...
dlls/d2d1/device.c
View file @
c172b895
...
...
@@ -1946,36 +1946,10 @@ static HRESULT STDMETHODCALLTYPE d2d_device_context_CreateEffect(ID2D1DeviceCont
REFCLSID
effect_id
,
ID2D1Effect
**
effect
)
{
struct
d2d_device_context
*
context
=
impl_from_ID2D1DeviceContext
(
iface
);
struct
d2d_effect_context
*
effect_context
;
struct
d2d_effect
*
object
;
HRESULT
hr
;
TRACE
(
"iface %p, effect_id %s, effect %p.
\n
"
,
iface
,
debugstr_guid
(
effect_id
),
effect
);
if
(
!
(
effect_context
=
calloc
(
1
,
sizeof
(
*
effect_context
))))
return
E_OUTOFMEMORY
;
d2d_effect_context_init
(
effect_context
,
context
);
if
(
!
(
object
=
calloc
(
1
,
sizeof
(
*
object
))))
{
ID2D1EffectContext_Release
(
&
effect_context
->
ID2D1EffectContext_iface
);
return
E_OUTOFMEMORY
;
}
hr
=
d2d_effect_init
(
object
,
effect_context
,
effect_id
);
ID2D1EffectContext_Release
(
&
effect_context
->
ID2D1EffectContext_iface
);
if
(
FAILED
(
hr
))
{
WARN
(
"Failed to initialise effect, hr %#lx.
\n
"
,
hr
);
free
(
object
);
return
hr
;
}
*
effect
=
&
object
->
ID2D1Effect_iface
;
TRACE
(
"Created effect %p.
\n
"
,
*
effect
);
return
S_OK
;
return
d2d_effect_create
(
context
,
effect_id
,
effect
);
}
static
HRESULT
STDMETHODCALLTYPE
d2d_device_context_ID2D1DeviceContext_CreateGradientStopCollection
(
...
...
dlls/d2d1/effect.c
View file @
c172b895
...
...
@@ -753,26 +753,47 @@ static const ID2D1ImageVtbl d2d_effect_image_vtbl =
d2d_effect_image_GetFactory
,
};
HRESULT
d2d_effect_init
(
struct
d2d_effect
*
effect
,
struct
d2d_effect_context
*
effect_context
,
const
CLSID
*
effect_id
)
HRESULT
d2d_effect_create
(
struct
d2d_device_context
*
context
,
const
CLSID
*
effect_id
,
ID2D1Effect
**
effect
)
{
struct
d2d_effect_context
*
effect_context
;
struct
d2d_effect
*
object
;
unsigned
int
i
;
effect
->
ID2D1Effect_iface
.
lpVtbl
=
&
d2d_effect_vtbl
;
effect
->
ID2D1Image_iface
.
lpVtbl
=
&
d2d_effect_image_vtbl
;
effect
->
refcount
=
1
;
if
(
!
(
effect_context
=
calloc
(
1
,
sizeof
(
*
effect_context
))))
return
E_OUTOFMEMORY
;
d2d_effect_context_init
(
effect_context
,
context
);
if
(
!
(
object
=
calloc
(
1
,
sizeof
(
*
object
))))
{
ID2D1EffectContext_Release
(
&
effect_context
->
ID2D1EffectContext_iface
);
return
E_OUTOFMEMORY
;
}
object
->
ID2D1Effect_iface
.
lpVtbl
=
&
d2d_effect_vtbl
;
object
->
ID2D1Image_iface
.
lpVtbl
=
&
d2d_effect_image_vtbl
;
object
->
refcount
=
1
;
object
->
effect_context
=
effect_context
;
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
builtin_effects
);
++
i
)
{
if
(
IsEqualGUID
(
effect_id
,
builtin_effects
[
i
].
clsid
))
{
effect
->
info
=
&
builtin_effects
[
i
];
d2d_effect_SetInputCount
(
&
effect
->
ID2D1Effect_iface
,
effect
->
info
->
default_input_count
);
effect
->
effect_context
=
effect_context
;
ID2D1EffectContext_AddRef
(
&
effect_context
->
ID2D1EffectContext_iface
);
return
S_OK
;
object
->
info
=
&
builtin_effects
[
i
];
d2d_effect_SetInputCount
(
&
object
->
ID2D1Effect_iface
,
object
->
info
->
default_input_count
);
break
;
}
}
WARN
(
"Unsupported effect clsid %s.
\n
"
,
debugstr_guid
(
effect_id
));
return
E_FAIL
;
if
(
i
==
ARRAY_SIZE
(
builtin_effects
))
{
ID2D1Effect_Release
(
&
object
->
ID2D1Effect_iface
);
return
E_FAIL
;
}
*
effect
=
&
object
->
ID2D1Effect_iface
;
TRACE
(
"Created effect %p.
\n
"
,
*
effect
);
return
S_OK
;
}
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