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
...
@@ -171,7 +171,7 @@ struct d2d_device_context
const
struct
d2d_device_context_ops
*
ops
;
const
struct
d2d_device_context_ops
*
ops
;
ID2D1Factory
*
factory
;
ID2D1Factory
*
factory
;
ID2D1D
evice
*
device
;
struct
d2d_d
evice
*
device
;
ID3D11Device1
*
d3d_device
;
ID3D11Device1
*
d3d_device
;
ID3DDeviceContextState
*
d3d_state
;
ID3DDeviceContextState
*
d3d_state
;
struct
struct
...
@@ -209,7 +209,7 @@ struct d2d_device_context
...
@@ -209,7 +209,7 @@ struct d2d_device_context
struct
d2d_clip_stack
clip_stack
;
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
,
const
struct
d2d_device_context_ops
*
ops
,
const
D2D1_RENDER_TARGET_PROPERTIES
*
desc
,
void
**
render_target
);
void
**
render_target
);
...
@@ -601,6 +601,7 @@ struct d2d_device
...
@@ -601,6 +601,7 @@ struct d2d_device
};
};
void
d2d_device_init
(
struct
d2d_device
*
device
,
ID2D1Factory1
*
factory
,
IDXGIDevice
*
dxgi_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
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
...
@@ -864,8 +864,9 @@ HRESULT d2d_dc_render_target_init(struct d2d_dc_render_target *render_target, ID
return
hr
;
return
hr
;
}
}
hr
=
d2d_d3d_create_render_target
(
device
,
NULL
,
(
IUnknown
*
)
&
render_target
->
ID2D1DCRenderTarget_iface
,
hr
=
d2d_d3d_create_render_target
(
unsafe_impl_from_ID2D1Device
((
ID2D1Device1
*
)
device
),
NULL
,
&
d2d_dc_render_target_ops
,
desc
,
(
void
**
)
&
render_target
->
dxgi_inner
);
(
IUnknown
*
)
&
render_target
->
ID2D1DCRenderTarget_iface
,
&
d2d_dc_render_target_ops
,
desc
,
(
void
**
)
&
render_target
->
dxgi_inner
);
ID2D1Device_Release
(
device
);
ID2D1Device_Release
(
device
);
if
(
FAILED
(
hr
))
if
(
FAILED
(
hr
))
{
{
...
...
dlls/d2d1/device.c
View file @
9e4ee3e4
...
@@ -40,8 +40,6 @@ static inline struct d2d_device *impl_from_ID2D1Device(ID2D1Device1 *iface)
...
@@ -40,8 +40,6 @@ static inline struct d2d_device *impl_from_ID2D1Device(ID2D1Device1 *iface)
return
CONTAINING_RECORD
(
iface
,
struct
d2d_device
,
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
)
static
ID2D1Brush
*
d2d_draw_get_text_brush
(
struct
d2d_draw_text_layout_ctx
*
context
,
IUnknown
*
effect
)
{
{
ID2D1Brush
*
brush
=
NULL
;
ID2D1Brush
*
brush
=
NULL
;
...
@@ -293,7 +291,7 @@ static ULONG STDMETHODCALLTYPE d2d_device_context_inner_Release(IUnknown *iface)
...
@@ -293,7 +291,7 @@ static ULONG STDMETHODCALLTYPE d2d_device_context_inner_Release(IUnknown *iface)
IUnknown_Release
(
context
->
target
.
object
);
IUnknown_Release
(
context
->
target
.
object
);
ID3D11Device1_Release
(
context
->
d3d_device
);
ID3D11Device1_Release
(
context
->
d3d_device
);
ID2D1Factory_Release
(
context
->
factory
);
ID2D1Factory_Release
(
context
->
factory
);
ID2D1Device
_Release
(
context
->
devi
ce
);
ID2D1Device
1_Release
(
&
context
->
device
->
ID2D1Device1_ifa
ce
);
free
(
context
);
free
(
context
);
}
}
...
@@ -2338,7 +2336,7 @@ static void STDMETHODCALLTYPE d2d_device_context_GetDevice(ID2D1DeviceContext1 *
...
@@ -2338,7 +2336,7 @@ static void STDMETHODCALLTYPE d2d_device_context_GetDevice(ID2D1DeviceContext1 *
TRACE
(
"iface %p, device %p.
\n
"
,
iface
,
device
);
TRACE
(
"iface %p, device %p.
\n
"
,
iface
,
device
);
*
device
=
context
->
devi
ce
;
*
device
=
(
ID2D1Device
*
)
&
context
->
device
->
ID2D1Device1_ifa
ce
;
ID2D1Device_AddRef
(
*
device
);
ID2D1Device_AddRef
(
*
device
);
}
}
...
@@ -3184,8 +3182,8 @@ static const struct ID2D1GdiInteropRenderTargetVtbl d2d_gdi_interop_render_targe
...
@@ -3184,8 +3182,8 @@ static const struct ID2D1GdiInteropRenderTargetVtbl d2d_gdi_interop_render_targe
d2d_gdi_interop_render_target_ReleaseDC
,
d2d_gdi_interop_render_target_ReleaseDC
,
};
};
static
HRESULT
d2d_device_context_init
(
struct
d2d_device_context
*
render_target
,
ID2D1Device
*
device
,
static
HRESULT
d2d_device_context_init
(
struct
d2d_device_context
*
render_target
,
IUnknown
*
outer_unknown
,
const
struct
d2d_device_context_ops
*
ops
)
struct
d2d_device
*
device
,
IUnknown
*
outer_unknown
,
const
struct
d2d_device_context_ops
*
ops
)
{
{
D3D11_SUBRESOURCE_DATA
buffer_data
;
D3D11_SUBRESOURCE_DATA
buffer_data
;
struct
d2d_device
*
device_impl
;
struct
d2d_device
*
device_impl
;
...
@@ -4248,9 +4246,9 @@ static HRESULT d2d_device_context_init(struct d2d_device_context *render_target,
...
@@ -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
->
IDWriteTextRenderer_iface
.
lpVtbl
=
&
d2d_text_renderer_vtbl
;
render_target
->
IUnknown_iface
.
lpVtbl
=
&
d2d_device_context_inner_unknown_vtbl
;
render_target
->
IUnknown_iface
.
lpVtbl
=
&
d2d_device_context_inner_unknown_vtbl
;
render_target
->
refcount
=
1
;
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
;
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
->
outer_unknown
=
outer_unknown
?
outer_unknown
:
&
render_target
->
IUnknown_iface
;
render_target
->
ops
=
ops
;
render_target
->
ops
=
ops
;
...
@@ -4424,12 +4422,12 @@ err:
...
@@ -4424,12 +4422,12 @@ err:
ID3DDeviceContextState_Release
(
render_target
->
d3d_state
);
ID3DDeviceContextState_Release
(
render_target
->
d3d_state
);
if
(
render_target
->
d3d_device
)
if
(
render_target
->
d3d_device
)
ID3D11Device1_Release
(
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
);
ID2D1Factory_Release
(
render_target
->
factory
);
return
hr
;
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
)
const
struct
d2d_device_context_ops
*
ops
,
const
D2D1_RENDER_TARGET_PROPERTIES
*
desc
,
void
**
render_target
)
{
{
D2D1_BITMAP_PROPERTIES1
bitmap_desc
;
D2D1_BITMAP_PROPERTIES1
bitmap_desc
;
...
@@ -4553,8 +4551,9 @@ static void WINAPI d2d_device_GetFactory(ID2D1Device1 *iface, ID2D1Factory **fac
...
@@ -4553,8 +4551,9 @@ static void WINAPI d2d_device_GetFactory(ID2D1Device1 *iface, ID2D1Factory **fac
ID2D1Factory1_AddRef
(
device
->
factory
);
ID2D1Factory1_AddRef
(
device
->
factory
);
}
}
static
HRESULT
d2d_device_create_device_context
(
ID2D1Device1
*
iface
,
D2D1_DEVICE_CONTEXT_OPTIONS
options
,
static
HRESULT
d2d_device_create_device_context
(
struct
d2d_device
*
device
,
ID2D1DeviceContext1
**
context
)
{
D2D1_DEVICE_CONTEXT_OPTIONS
options
,
ID2D1DeviceContext1
**
context
)
{
struct
d2d_device_context
*
object
;
struct
d2d_device_context
*
object
;
HRESULT
hr
;
HRESULT
hr
;
...
@@ -4564,7 +4563,7 @@ static HRESULT d2d_device_create_device_context(ID2D1Device1 *iface, D2D1_DEVICE
...
@@ -4564,7 +4563,7 @@ static HRESULT d2d_device_create_device_context(ID2D1Device1 *iface, D2D1_DEVICE
if
(
!
(
object
=
calloc
(
1
,
sizeof
(
*
object
))))
if
(
!
(
object
=
calloc
(
1
,
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
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
);
WARN
(
"Failed to initialise device context, hr %#lx.
\n
"
,
hr
);
free
(
object
);
free
(
object
);
...
@@ -4580,9 +4579,11 @@ static HRESULT d2d_device_create_device_context(ID2D1Device1 *iface, D2D1_DEVICE
...
@@ -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
,
static
HRESULT
WINAPI
d2d_device_CreateDeviceContext
(
ID2D1Device1
*
iface
,
D2D1_DEVICE_CONTEXT_OPTIONS
options
,
ID2D1DeviceContext
**
context
)
ID2D1DeviceContext
**
context
)
{
{
struct
d2d_device
*
device
=
impl_from_ID2D1Device
(
iface
);
TRACE
(
"iface %p, options %#x, context %p.
\n
"
,
iface
,
options
,
context
);
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
,
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
...
@@ -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
,
static
HRESULT
WINAPI
d2d_device_CreateDeviceContext1
(
ID2D1Device1
*
iface
,
D2D1_DEVICE_CONTEXT_OPTIONS
options
,
ID2D1DeviceContext1
**
context
)
ID2D1DeviceContext1
**
context
)
{
{
struct
d2d_device
*
device
=
impl_from_ID2D1Device
(
iface
);
TRACE
(
"iface %p, options %#x, context %p.
\n
"
,
iface
,
options
,
context
);
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
=
static
const
struct
ID2D1Device1Vtbl
d2d_device_vtbl
=
...
@@ -4650,7 +4653,7 @@ static const struct ID2D1Device1Vtbl d2d_device_vtbl =
...
@@ -4650,7 +4653,7 @@ static const struct ID2D1Device1Vtbl d2d_device_vtbl =
d2d_device_CreateDeviceContext1
,
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
)
if
(
!
iface
)
return
NULL
;
return
NULL
;
...
...
dlls/d2d1/factory.c
View file @
9e4ee3e4
...
@@ -495,7 +495,8 @@ static HRESULT STDMETHODCALLTYPE d2d_factory_CreateDxgiSurfaceRenderTarget(ID2D1
...
@@ -495,7 +495,8 @@ static HRESULT STDMETHODCALLTYPE d2d_factory_CreateDxgiSurfaceRenderTarget(ID2D1
return
hr
;
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
);
ID2D1Device_Release
(
device
);
return
hr
;
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
...
@@ -928,7 +928,7 @@ HRESULT d2d_hwnd_render_target_init(struct d2d_hwnd_render_target *render_target
return
hr
;
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
,
(
IUnknown
*
)
&
render_target
->
ID2D1HwndRenderTarget_iface
,
&
d2d_hwnd_render_target_ops
,
&
dxgi_rt_desc
,
(
void
**
)
&
render_target
->
dxgi_inner
);
&
dxgi_rt_desc
,
(
void
**
)
&
render_target
->
dxgi_inner
);
IDXGISurface_Release
(
dxgi_surface
);
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,
...
@@ -255,7 +255,8 @@ HRESULT d2d_wic_render_target_init(struct d2d_wic_render_target *render_target,
return
hr
;
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
);
&
d2d_wic_render_target_ops
,
desc
,
(
void
**
)
&
render_target
->
dxgi_inner
);
ID2D1Device_Release
(
device
);
ID2D1Device_Release
(
device
);
if
(
FAILED
(
hr
))
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