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
798d659f
Commit
798d659f
authored
Nov 14, 2022
by
Nikolay Sivov
Committed by
Alexandre Julliard
Nov 15, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d2d1: Silently ignore non-default state block implementations.
Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=53915
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
parent
f63f0d3b
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
3 deletions
+19
-3
device.c
dlls/d2d1/device.c
+4
-2
state_block.c
dlls/d2d1/state_block.c
+5
-1
d2d1.c
dlls/d2d1/tests/d2d1.c
+10
-0
No files found.
dlls/d2d1/device.c
View file @
798d659f
...
@@ -1735,11 +1735,12 @@ static HRESULT STDMETHODCALLTYPE d2d_device_context_Flush(ID2D1DeviceContext1 *i
...
@@ -1735,11 +1735,12 @@ static HRESULT STDMETHODCALLTYPE d2d_device_context_Flush(ID2D1DeviceContext1 *i
static
void
STDMETHODCALLTYPE
d2d_device_context_SaveDrawingState
(
ID2D1DeviceContext1
*
iface
,
static
void
STDMETHODCALLTYPE
d2d_device_context_SaveDrawingState
(
ID2D1DeviceContext1
*
iface
,
ID2D1DrawingStateBlock
*
state_block
)
ID2D1DrawingStateBlock
*
state_block
)
{
{
struct
d2d_state_block
*
state_block_impl
=
unsafe_impl_from_ID2D1DrawingStateBlock
(
state_block
);
struct
d2d_device_context
*
render_target
=
impl_from_ID2D1DeviceContext
(
iface
);
struct
d2d_device_context
*
render_target
=
impl_from_ID2D1DeviceContext
(
iface
);
struct
d2d_state_block
*
state_block_impl
;
TRACE
(
"iface %p, state_block %p.
\n
"
,
iface
,
state_block
);
TRACE
(
"iface %p, state_block %p.
\n
"
,
iface
,
state_block
);
if
(
!
(
state_block_impl
=
unsafe_impl_from_ID2D1DrawingStateBlock
(
state_block
)))
return
;
state_block_impl
->
drawing_state
=
render_target
->
drawing_state
;
state_block_impl
->
drawing_state
=
render_target
->
drawing_state
;
if
(
render_target
->
text_rendering_params
)
if
(
render_target
->
text_rendering_params
)
IDWriteRenderingParams_AddRef
(
render_target
->
text_rendering_params
);
IDWriteRenderingParams_AddRef
(
render_target
->
text_rendering_params
);
...
@@ -1751,11 +1752,12 @@ static void STDMETHODCALLTYPE d2d_device_context_SaveDrawingState(ID2D1DeviceCon
...
@@ -1751,11 +1752,12 @@ static void STDMETHODCALLTYPE d2d_device_context_SaveDrawingState(ID2D1DeviceCon
static
void
STDMETHODCALLTYPE
d2d_device_context_RestoreDrawingState
(
ID2D1DeviceContext1
*
iface
,
static
void
STDMETHODCALLTYPE
d2d_device_context_RestoreDrawingState
(
ID2D1DeviceContext1
*
iface
,
ID2D1DrawingStateBlock
*
state_block
)
ID2D1DrawingStateBlock
*
state_block
)
{
{
struct
d2d_state_block
*
state_block_impl
=
unsafe_impl_from_ID2D1DrawingStateBlock
(
state_block
);
struct
d2d_device_context
*
context
=
impl_from_ID2D1DeviceContext
(
iface
);
struct
d2d_device_context
*
context
=
impl_from_ID2D1DeviceContext
(
iface
);
struct
d2d_state_block
*
state_block_impl
;
TRACE
(
"iface %p, state_block %p.
\n
"
,
iface
,
state_block
);
TRACE
(
"iface %p, state_block %p.
\n
"
,
iface
,
state_block
);
if
(
!
(
state_block_impl
=
unsafe_impl_from_ID2D1DrawingStateBlock
(
state_block
)))
return
;
if
(
context
->
target
.
type
==
D2D_TARGET_COMMAND_LIST
)
if
(
context
->
target
.
type
==
D2D_TARGET_COMMAND_LIST
)
{
{
struct
d2d_command_list
*
command_list
=
context
->
target
.
command_list
;
struct
d2d_command_list
*
command_list
=
context
->
target
.
command_list
;
...
...
dlls/d2d1/state_block.c
View file @
798d659f
...
@@ -186,6 +186,10 @@ struct d2d_state_block *unsafe_impl_from_ID2D1DrawingStateBlock(ID2D1DrawingStat
...
@@ -186,6 +186,10 @@ struct d2d_state_block *unsafe_impl_from_ID2D1DrawingStateBlock(ID2D1DrawingStat
{
{
if
(
!
iface
)
if
(
!
iface
)
return
NULL
;
return
NULL
;
assert
(
iface
->
lpVtbl
==
(
ID2D1DrawingStateBlockVtbl
*
)
&
d2d_state_block_vtbl
);
if
(
iface
->
lpVtbl
!=
(
ID2D1DrawingStateBlockVtbl
*
)
&
d2d_state_block_vtbl
)
{
WARN
(
"Unexpected state block vtbl %p.
\n
"
,
iface
->
lpVtbl
);
return
NULL
;
}
return
CONTAINING_RECORD
(
iface
,
struct
d2d_state_block
,
ID2D1DrawingStateBlock1_iface
);
return
CONTAINING_RECORD
(
iface
,
struct
d2d_state_block
,
ID2D1DrawingStateBlock1_iface
);
}
}
dlls/d2d1/tests/d2d1.c
View file @
798d659f
...
@@ -1835,6 +1835,7 @@ static void test_state_block(BOOL d3d11)
...
@@ -1835,6 +1835,7 @@ static void test_state_block(BOOL d3d11)
ID2D1Factory
*
factory
;
ID2D1Factory
*
factory
;
ULONG
refcount
;
ULONG
refcount
;
HRESULT
hr
;
HRESULT
hr
;
void
*
ptr
;
static
const
D2D1_MATRIX_3X2_F
identity
=
static
const
D2D1_MATRIX_3X2_F
identity
=
{{{
{{{
1
.
0
f
,
0
.
0
f
,
1
.
0
f
,
0
.
0
f
,
...
@@ -2078,6 +2079,15 @@ static void test_state_block(BOOL d3d11)
...
@@ -2078,6 +2079,15 @@ static void test_state_block(BOOL d3d11)
refcount
=
IDWriteRenderingParams_Release
(
text_rendering_params1
);
refcount
=
IDWriteRenderingParams_Release
(
text_rendering_params1
);
ok
(
!
refcount
,
"Rendering params %lu references left.
\n
"
,
refcount
);
ok
(
!
refcount
,
"Rendering params %lu references left.
\n
"
,
refcount
);
/* State block object pointer is validated, but does not result in an error state. */
ptr
=
(
void
*
)
0xdeadbeef
;
ID2D1RenderTarget_BeginDraw
(
rt
);
ID2D1RenderTarget_SaveDrawingState
(
rt
,
(
ID2D1DrawingStateBlock
*
)
&
ptr
);
ID2D1RenderTarget_RestoreDrawingState
(
rt
,
(
ID2D1DrawingStateBlock
*
)
&
ptr
);
hr
=
ID2D1RenderTarget_EndDraw
(
rt
,
NULL
,
NULL
);
ok
(
hr
==
S_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
release_test_context
(
&
ctx
);
release_test_context
(
&
ctx
);
}
}
...
...
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