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
5908d7fa
Commit
5908d7fa
authored
Apr 02, 2024
by
Nikolay Sivov
Committed by
Alexandre Julliard
Apr 02, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d2d1/effect: Implement offset transform object.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
parent
a9926aeb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
117 additions
and
9 deletions
+117
-9
d2d1_private.h
dlls/d2d1/d2d1_private.h
+11
-0
effect.c
dlls/d2d1/effect.c
+103
-2
d2d1.c
dlls/d2d1/tests/d2d1.c
+3
-7
No files found.
dlls/d2d1/d2d1_private.h
View file @
5908d7fa
...
...
@@ -708,6 +708,17 @@ void d2d_factory_register_effect(struct d2d_factory *factory,
HRESULT
d2d_effect_property_get_uint32_value
(
const
struct
d2d_effect_properties
*
properties
,
const
struct
d2d_effect_property
*
prop
,
UINT32
*
value
);
struct
d2d_transform
{
ID2D1TransformNode
ID2D1TransformNode_iface
;
LONG
refcount
;
union
{
D2D1_POINT_2L
offset
;
};
};
struct
d2d_transform_graph
{
ID2D1TransformGraph
ID2D1TransformGraph_iface
;
...
...
dlls/d2d1/effect.c
View file @
5908d7fa
...
...
@@ -20,6 +20,107 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
d2d
);
static
inline
struct
d2d_transform
*
impl_from_ID2D1OffsetTransform
(
ID2D1OffsetTransform
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
struct
d2d_transform
,
ID2D1TransformNode_iface
);
}
static
HRESULT
STDMETHODCALLTYPE
d2d_offset_transform_QueryInterface
(
ID2D1OffsetTransform
*
iface
,
REFIID
iid
,
void
**
out
)
{
TRACE
(
"iface %p, iid %s, out %p.
\n
"
,
iface
,
debugstr_guid
(
iid
),
out
);
if
(
IsEqualGUID
(
iid
,
&
IID_ID2D1OffsetTransform
)
||
IsEqualGUID
(
iid
,
&
IID_ID2D1TransformNode
)
||
IsEqualGUID
(
iid
,
&
IID_IUnknown
))
{
*
out
=
iface
;
ID2D1OffsetTransform_AddRef
(
iface
);
return
S_OK
;
}
WARN
(
"Unsupported interface %s.
\n
"
,
debugstr_guid
(
iid
));
*
out
=
NULL
;
return
E_NOINTERFACE
;
}
static
ULONG
STDMETHODCALLTYPE
d2d_offset_transform_AddRef
(
ID2D1OffsetTransform
*
iface
)
{
struct
d2d_transform
*
transform
=
impl_from_ID2D1OffsetTransform
(
iface
);
ULONG
refcount
=
InterlockedIncrement
(
&
transform
->
refcount
);
TRACE
(
"%p increasing refcount to %lu.
\n
"
,
iface
,
refcount
);
return
refcount
;
}
static
ULONG
STDMETHODCALLTYPE
d2d_offset_transform_Release
(
ID2D1OffsetTransform
*
iface
)
{
struct
d2d_transform
*
transform
=
impl_from_ID2D1OffsetTransform
(
iface
);
ULONG
refcount
=
InterlockedDecrement
(
&
transform
->
refcount
);
TRACE
(
"%p decreasing refcount to %lu.
\n
"
,
iface
,
refcount
);
if
(
!
refcount
)
free
(
transform
);
return
refcount
;
}
static
UINT32
STDMETHODCALLTYPE
d2d_offset_transform_GetInputCount
(
ID2D1OffsetTransform
*
iface
)
{
TRACE
(
"iface %p.
\n
"
,
iface
);
return
1
;
}
static
void
STDMETHODCALLTYPE
d2d_offset_transform_SetOffset
(
ID2D1OffsetTransform
*
iface
,
D2D1_POINT_2L
offset
)
{
struct
d2d_transform
*
transform
=
impl_from_ID2D1OffsetTransform
(
iface
);
TRACE
(
"iface %p, offset %s.
\n
"
,
iface
,
debug_d2d_point_2l
(
&
offset
));
transform
->
offset
=
offset
;
}
static
D2D1_POINT_2L
*
STDMETHODCALLTYPE
d2d_offset_transform_GetOffset
(
ID2D1OffsetTransform
*
iface
,
D2D1_POINT_2L
*
offset
)
{
struct
d2d_transform
*
transform
=
impl_from_ID2D1OffsetTransform
(
iface
);
TRACE
(
"iface %p.
\n
"
,
iface
);
*
offset
=
transform
->
offset
;
return
offset
;
}
static
const
ID2D1OffsetTransformVtbl
d2d_offset_transform_vtbl
=
{
d2d_offset_transform_QueryInterface
,
d2d_offset_transform_AddRef
,
d2d_offset_transform_Release
,
d2d_offset_transform_GetInputCount
,
d2d_offset_transform_SetOffset
,
d2d_offset_transform_GetOffset
,
};
static
HRESULT
d2d_offset_transform_create
(
D2D1_POINT_2L
offset
,
ID2D1OffsetTransform
**
transform
)
{
struct
d2d_transform
*
object
;
if
(
!
(
object
=
calloc
(
1
,
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
object
->
ID2D1TransformNode_iface
.
lpVtbl
=
(
ID2D1TransformNodeVtbl
*
)
&
d2d_offset_transform_vtbl
;
object
->
refcount
=
1
;
object
->
offset
=
offset
;
*
transform
=
(
ID2D1OffsetTransform
*
)
&
object
->
ID2D1TransformNode_iface
;
return
S_OK
;
}
static
inline
struct
d2d_transform_graph
*
impl_from_ID2D1TransformGraph
(
ID2D1TransformGraph
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
struct
d2d_transform_graph
,
ID2D1TransformGraph_iface
);
...
...
@@ -802,9 +903,9 @@ static HRESULT STDMETHODCALLTYPE d2d_effect_context_CreateBorderTransform(ID2D1E
static
HRESULT
STDMETHODCALLTYPE
d2d_effect_context_CreateOffsetTransform
(
ID2D1EffectContext
*
iface
,
D2D1_POINT_2L
offset
,
ID2D1OffsetTransform
**
transform
)
{
FIXME
(
"iface %p, offset %s, transform %p stub!
\n
"
,
iface
,
debug_d2d_point_2l
(
&
offset
),
transform
);
TRACE
(
"iface %p, offset %s, transform %p.
\n
"
,
iface
,
debug_d2d_point_2l
(
&
offset
),
transform
);
return
E_NOTIMPL
;
return
d2d_offset_transform_create
(
offset
,
transform
)
;
}
static
HRESULT
STDMETHODCALLTYPE
d2d_effect_context_CreateBoundsAdjustmentTransform
(
ID2D1EffectContext
*
iface
,
...
...
dlls/d2d1/tests/d2d1.c
View file @
5908d7fa
...
...
@@ -12722,7 +12722,7 @@ static void test_transform_graph(BOOL d3d11)
/* Create transforms */
hr
=
ID2D1EffectContext_CreateOffsetTransform
(
effect_context
,
point
,
&
offset_transform
);
todo_wine
ok
(
hr
==
S_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
hr
=
ID2D1EffectContext_CreateBlendTransform
(
effect_context
,
2
,
&
blend_desc
,
&
blend_transform
);
todo_wine
ok
(
hr
==
S_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
if
(
!
offset_transform
||
!
blend_transform
)
...
...
@@ -12836,9 +12836,7 @@ static void test_offset_transform(BOOL d3d11)
offset
.
x
=
1
;
offset
.
y
=
2
;
hr
=
ID2D1EffectContext_CreateOffsetTransform
(
effect_context
,
offset
,
&
transform
);
todo_wine
ok
(
hr
==
S_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
if
(
hr
!=
S_OK
)
goto
done
;
ok
(
hr
==
S_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
offset
=
ID2D1OffsetTransform_GetOffset
(
transform
);
ok
(
offset
.
x
==
1
&&
offset
.
y
==
2
,
"Got unexpected offset {%ld, %ld}.
\n
"
,
offset
.
x
,
offset
.
y
);
...
...
@@ -12853,9 +12851,7 @@ static void test_offset_transform(BOOL d3d11)
offset
=
ID2D1OffsetTransform_GetOffset
(
transform
);
ok
(
offset
.
x
==
-
10
&&
offset
.
y
==
20
,
"Got unexpected offset {%ld, %ld}.
\n
"
,
offset
.
x
,
offset
.
y
);
done:
if
(
transform
)
ID2D1OffsetTransform_Release
(
transform
);
ID2D1OffsetTransform_Release
(
transform
);
ID2D1Effect_Release
(
effect
);
hr
=
ID2D1Factory1_UnregisterEffect
(
factory
,
&
CLSID_TestEffect
);
ok
(
hr
==
S_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
...
...
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