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
9e4ee3e4
Commit
9e4ee3e4
authored
Aug 02, 2023
by
Nikolay Sivov
Committed by
Alexandre Julliard
Aug 03, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d2d1: Use device instance pointer in device context structure.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
parent
cf2e1db7
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
30 additions
and
23 deletions
+30
-23
d2d1_private.h
dlls/d2d1/d2d1_private.h
+3
-2
dc_render_target.c
dlls/d2d1/dc_render_target.c
+3
-2
device.c
dlls/d2d1/device.c
+19
-16
factory.c
dlls/d2d1/factory.c
+2
-1
hwnd_render_target.c
dlls/d2d1/hwnd_render_target.c
+1
-1
wic_render_target.c
dlls/d2d1/wic_render_target.c
+2
-1
No files found.
dlls/d2d1/d2d1_private.h
View file @
9e4ee3e4
...
...
@@ -171,7 +171,7 @@ struct d2d_device_context
const
struct
d2d_device_context_ops
*
ops
;
ID2D1Factory
*
factory
;
ID2D1D
evice
*
device
;
struct
d2d_d
evice
*
device
;
ID3D11Device1
*
d3d_device
;
ID3DDeviceContextState
*
d3d_state
;
struct
...
...
@@ -209,7 +209,7 @@ struct d2d_device_context
struct
d2d_clip_stack
clip_stack
;
};
HRESULT
d2d_d3d_create_render_target
(
ID2D1D
evice
*
device
,
IDXGISurface
*
surface
,
IUnknown
*
outer_unknown
,
HRESULT
d2d_d3d_create_render_target
(
struct
d2d_d
evice
*
device
,
IDXGISurface
*
surface
,
IUnknown
*
outer_unknown
,
const
struct
d2d_device_context_ops
*
ops
,
const
D2D1_RENDER_TARGET_PROPERTIES
*
desc
,
void
**
render_target
);
...
...
@@ -601,6 +601,7 @@ struct d2d_device
};
void
d2d_device_init
(
struct
d2d_device
*
device
,
ID2D1Factory1
*
factory
,
IDXGIDevice
*
dxgi_device
);
struct
d2d_device
*
unsafe_impl_from_ID2D1Device
(
ID2D1Device1
*
iface
);
struct
d2d_shader
{
...
...
dlls/d2d1/dc_render_target.c
View file @
9e4ee3e4
...
...
@@ -864,8 +864,9 @@ HRESULT d2d_dc_render_target_init(struct d2d_dc_render_target *render_target, ID
return
hr
;
}
hr
=
d2d_d3d_create_render_target
(
device
,
NULL
,
(
IUnknown
*
)
&
render_target
->
ID2D1DCRenderTarget_iface
,
&
d2d_dc_render_target_ops
,
desc
,
(
void
**
)
&
render_target
->
dxgi_inner
);
hr
=
d2d_d3d_create_render_target
(
unsafe_impl_from_ID2D1Device
((
ID2D1Device1
*
)
device
),
NULL
,
(
IUnknown
*
)
&
render_target
->
ID2D1DCRenderTarget_iface
,
&
d2d_dc_render_target_ops
,
desc
,
(
void
**
)
&
render_target
->
dxgi_inner
);
ID2D1Device_Release
(
device
);
if
(
FAILED
(
hr
))
{
...
...
dlls/d2d1/device.c
View file @
9e4ee3e4
...
...
@@ -40,8 +40,6 @@ static inline struct d2d_device *impl_from_ID2D1Device(ID2D1Device1 *iface)
return
CONTAINING_RECORD
(
iface
,
struct
d2d_device
,
ID2D1Device1_iface
);
}
static
struct
d2d_device
*
unsafe_impl_from_ID2D1Device
(
ID2D1Device1
*
iface
);
static
ID2D1Brush
*
d2d_draw_get_text_brush
(
struct
d2d_draw_text_layout_ctx
*
context
,
IUnknown
*
effect
)
{
ID2D1Brush
*
brush
=
NULL
;
...
...
@@ -293,7 +291,7 @@ static ULONG STDMETHODCALLTYPE d2d_device_context_inner_Release(IUnknown *iface)
IUnknown_Release
(
context
->
target
.
object
);
ID3D11Device1_Release
(
context
->
d3d_device
);
ID2D1Factory_Release
(
context
->
factory
);
ID2D1Device
_Release
(
context
->
devi
ce
);
ID2D1Device
1_Release
(
&
context
->
device
->
ID2D1Device1_ifa
ce
);
free
(
context
);
}
...
...
@@ -2338,7 +2336,7 @@ static void STDMETHODCALLTYPE d2d_device_context_GetDevice(ID2D1DeviceContext1 *
TRACE
(
"iface %p, device %p.
\n
"
,
iface
,
device
);
*
device
=
context
->
devi
ce
;
*
device
=
(
ID2D1Device
*
)
&
context
->
device
->
ID2D1Device1_ifa
ce
;
ID2D1Device_AddRef
(
*
device
);
}
...
...
@@ -3184,8 +3182,8 @@ static const struct ID2D1GdiInteropRenderTargetVtbl d2d_gdi_interop_render_targe
d2d_gdi_interop_render_target_ReleaseDC
,
};
static
HRESULT
d2d_device_context_init
(
struct
d2d_device_context
*
render_target
,
ID2D1Device
*
device
,
IUnknown
*
outer_unknown
,
const
struct
d2d_device_context_ops
*
ops
)
static
HRESULT
d2d_device_context_init
(
struct
d2d_device_context
*
render_target
,
struct
d2d_device
*
device
,
IUnknown
*
outer_unknown
,
const
struct
d2d_device_context_ops
*
ops
)
{
D3D11_SUBRESOURCE_DATA
buffer_data
;
struct
d2d_device
*
device_impl
;
...
...
@@ -4248,9 +4246,9 @@ static HRESULT d2d_device_context_init(struct d2d_device_context *render_target,
render_target
->
IDWriteTextRenderer_iface
.
lpVtbl
=
&
d2d_text_renderer_vtbl
;
render_target
->
IUnknown_iface
.
lpVtbl
=
&
d2d_device_context_inner_unknown_vtbl
;
render_target
->
refcount
=
1
;
ID2D1Device
_GetFactory
(
devi
ce
,
&
render_target
->
factory
);
ID2D1Device
1_GetFactory
(
&
device
->
ID2D1Device1_ifa
ce
,
&
render_target
->
factory
);
render_target
->
device
=
device
;
ID2D1Device
_AddRef
(
render_target
->
devi
ce
);
ID2D1Device
1_AddRef
(
&
render_target
->
device
->
ID2D1Device1_ifa
ce
);
render_target
->
outer_unknown
=
outer_unknown
?
outer_unknown
:
&
render_target
->
IUnknown_iface
;
render_target
->
ops
=
ops
;
...
...
@@ -4424,12 +4422,12 @@ err:
ID3DDeviceContextState_Release
(
render_target
->
d3d_state
);
if
(
render_target
->
d3d_device
)
ID3D11Device1_Release
(
render_target
->
d3d_device
);
ID2D1Device
_Release
(
render_target
->
devi
ce
);
ID2D1Device
1_Release
(
&
render_target
->
device
->
ID2D1Device1_ifa
ce
);
ID2D1Factory_Release
(
render_target
->
factory
);
return
hr
;
}
HRESULT
d2d_d3d_create_render_target
(
ID2D1D
evice
*
device
,
IDXGISurface
*
surface
,
IUnknown
*
outer_unknown
,
HRESULT
d2d_d3d_create_render_target
(
struct
d2d_d
evice
*
device
,
IDXGISurface
*
surface
,
IUnknown
*
outer_unknown
,
const
struct
d2d_device_context_ops
*
ops
,
const
D2D1_RENDER_TARGET_PROPERTIES
*
desc
,
void
**
render_target
)
{
D2D1_BITMAP_PROPERTIES1
bitmap_desc
;
...
...
@@ -4553,8 +4551,9 @@ static void WINAPI d2d_device_GetFactory(ID2D1Device1 *iface, ID2D1Factory **fac
ID2D1Factory1_AddRef
(
device
->
factory
);
}
static
HRESULT
d2d_device_create_device_context
(
ID2D1Device1
*
iface
,
D2D1_DEVICE_CONTEXT_OPTIONS
options
,
ID2D1DeviceContext1
**
context
)
{
static
HRESULT
d2d_device_create_device_context
(
struct
d2d_device
*
device
,
D2D1_DEVICE_CONTEXT_OPTIONS
options
,
ID2D1DeviceContext1
**
context
)
{
struct
d2d_device_context
*
object
;
HRESULT
hr
;
...
...
@@ -4564,7 +4563,7 @@ static HRESULT d2d_device_create_device_context(ID2D1Device1 *iface, D2D1_DEVICE
if
(
!
(
object
=
calloc
(
1
,
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
if
(
FAILED
(
hr
=
d2d_device_context_init
(
object
,
(
ID2D1Device
*
)
ifa
ce
,
NULL
,
NULL
)))
if
(
FAILED
(
hr
=
d2d_device_context_init
(
object
,
devi
ce
,
NULL
,
NULL
)))
{
WARN
(
"Failed to initialise device context, hr %#lx.
\n
"
,
hr
);
free
(
object
);
...
...
@@ -4580,9 +4579,11 @@ static HRESULT d2d_device_create_device_context(ID2D1Device1 *iface, D2D1_DEVICE
static
HRESULT
WINAPI
d2d_device_CreateDeviceContext
(
ID2D1Device1
*
iface
,
D2D1_DEVICE_CONTEXT_OPTIONS
options
,
ID2D1DeviceContext
**
context
)
{
struct
d2d_device
*
device
=
impl_from_ID2D1Device
(
iface
);
TRACE
(
"iface %p, options %#x, context %p.
\n
"
,
iface
,
options
,
context
);
return
d2d_device_create_device_context
(
ifa
ce
,
options
,
(
ID2D1DeviceContext1
**
)
context
);
return
d2d_device_create_device_context
(
devi
ce
,
options
,
(
ID2D1DeviceContext1
**
)
context
);
}
static
HRESULT
WINAPI
d2d_device_CreatePrintControl
(
ID2D1Device1
*
iface
,
IWICImagingFactory
*
wic_factory
,
...
...
@@ -4629,9 +4630,11 @@ static void WINAPI d2d_device_SetRenderingPriority(ID2D1Device1 *iface, D2D1_REN
static
HRESULT
WINAPI
d2d_device_CreateDeviceContext1
(
ID2D1Device1
*
iface
,
D2D1_DEVICE_CONTEXT_OPTIONS
options
,
ID2D1DeviceContext1
**
context
)
{
struct
d2d_device
*
device
=
impl_from_ID2D1Device
(
iface
);
TRACE
(
"iface %p, options %#x, context %p.
\n
"
,
iface
,
options
,
context
);
return
d2d_device_create_device_context
(
ifa
ce
,
options
,
context
);
return
d2d_device_create_device_context
(
devi
ce
,
options
,
context
);
}
static
const
struct
ID2D1Device1Vtbl
d2d_device_vtbl
=
...
...
@@ -4650,7 +4653,7 @@ static const struct ID2D1Device1Vtbl d2d_device_vtbl =
d2d_device_CreateDeviceContext1
,
};
st
atic
st
ruct
d2d_device
*
unsafe_impl_from_ID2D1Device
(
ID2D1Device1
*
iface
)
struct
d2d_device
*
unsafe_impl_from_ID2D1Device
(
ID2D1Device1
*
iface
)
{
if
(
!
iface
)
return
NULL
;
...
...
dlls/d2d1/factory.c
View file @
9e4ee3e4
...
...
@@ -495,7 +495,8 @@ static HRESULT STDMETHODCALLTYPE d2d_factory_CreateDxgiSurfaceRenderTarget(ID2D1
return
hr
;
}
hr
=
d2d_d3d_create_render_target
(
device
,
surface
,
NULL
,
NULL
,
desc
,
(
void
**
)
render_target
);
hr
=
d2d_d3d_create_render_target
(
unsafe_impl_from_ID2D1Device
((
ID2D1Device1
*
)
device
),
surface
,
NULL
,
NULL
,
desc
,
(
void
**
)
render_target
);
ID2D1Device_Release
(
device
);
return
hr
;
}
...
...
dlls/d2d1/hwnd_render_target.c
View file @
9e4ee3e4
...
...
@@ -928,7 +928,7 @@ HRESULT d2d_hwnd_render_target_init(struct d2d_hwnd_render_target *render_target
return
hr
;
}
hr
=
d2d_d3d_create_render_target
(
device
,
dxgi_surface
,
hr
=
d2d_d3d_create_render_target
(
unsafe_impl_from_ID2D1Device
((
ID2D1Device1
*
)
device
)
,
dxgi_surface
,
(
IUnknown
*
)
&
render_target
->
ID2D1HwndRenderTarget_iface
,
&
d2d_hwnd_render_target_ops
,
&
dxgi_rt_desc
,
(
void
**
)
&
render_target
->
dxgi_inner
);
IDXGISurface_Release
(
dxgi_surface
);
...
...
dlls/d2d1/wic_render_target.c
View file @
9e4ee3e4
...
...
@@ -255,7 +255,8 @@ HRESULT d2d_wic_render_target_init(struct d2d_wic_render_target *render_target,
return
hr
;
}
hr
=
d2d_d3d_create_render_target
(
device
,
render_target
->
dxgi_surface
,
&
render_target
->
IUnknown_iface
,
hr
=
d2d_d3d_create_render_target
(
unsafe_impl_from_ID2D1Device
((
ID2D1Device1
*
)
device
),
render_target
->
dxgi_surface
,
&
render_target
->
IUnknown_iface
,
&
d2d_wic_render_target_ops
,
desc
,
(
void
**
)
&
render_target
->
dxgi_inner
);
ID2D1Device_Release
(
device
);
if
(
FAILED
(
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