Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
f010e5d8
Commit
f010e5d8
authored
Sep 03, 2015
by
Stefan Dösinger
Committed by
Alexandre Julliard
Sep 03, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Return a texture from wined3d_swapchain_get_back_buffer.
parent
ba9d80ba
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
40 additions
and
18 deletions
+40
-18
swapchain.c
dlls/d3d8/swapchain.c
+12
-3
swapchain.c
dlls/d3d9/swapchain.c
+14
-5
swapchain.c
dlls/dxgi/swapchain.c
+6
-6
device.c
dlls/wined3d/device.c
+5
-1
swapchain.c
dlls/wined3d/swapchain.c
+2
-2
wined3d.h
include/wine/wined3d.h
+1
-1
No files found.
dlls/d3d8/swapchain.c
View file @
f010e5d8
...
...
@@ -112,23 +112,32 @@ static HRESULT WINAPI d3d8_swapchain_GetBackBuffer(IDirect3DSwapChain8 *iface,
UINT
backbuffer_idx
,
D3DBACKBUFFER_TYPE
backbuffer_type
,
IDirect3DSurface8
**
backbuffer
)
{
struct
d3d8_swapchain
*
swapchain
=
impl_from_IDirect3DSwapChain8
(
iface
);
struct
wined3d_surface
*
wined3d_surface
=
NULL
;
struct
wined3d_resource
*
wined3d_resource
;
struct
wined3d_texture
*
wined3d_texture
;
struct
d3d8_surface
*
surface_impl
;
HRESULT
hr
=
D3D_OK
;
TRACE
(
"iface %p, backbuffer_idx %u, backbuffer_type %#x, backbuffer %p.
\n
"
,
iface
,
backbuffer_idx
,
backbuffer_type
,
backbuffer
);
if
(
!
backbuffer
)
{
WARN
(
"The output pointer is NULL, returning D3DERR_INVALIDCALL.
\n
"
);
return
D3DERR_INVALIDCALL
;
}
wined3d_mutex_lock
();
if
((
wined3d_
surfac
e
=
wined3d_swapchain_get_back_buffer
(
swapchain
->
wined3d_swapchain
,
if
((
wined3d_
textur
e
=
wined3d_swapchain_get_back_buffer
(
swapchain
->
wined3d_swapchain
,
backbuffer_idx
,
(
enum
wined3d_backbuffer_type
)
backbuffer_type
)))
{
surface_impl
=
wined3d_surface_get_parent
(
wined3d_surface
);
wined3d_resource
=
wined3d_texture_get_sub_resource
(
wined3d_texture
,
0
);
surface_impl
=
wined3d_resource_get_parent
(
wined3d_resource
);
*
backbuffer
=
&
surface_impl
->
IDirect3DSurface8_iface
;
IDirect3DSurface8_AddRef
(
*
backbuffer
);
}
else
{
/* Do not set *backbuffer = NULL, see tests/device.c, test_swapchain(). */
hr
=
D3DERR_INVALIDCALL
;
}
wined3d_mutex_unlock
();
...
...
dlls/d3d9/swapchain.c
View file @
f010e5d8
...
...
@@ -152,23 +152,32 @@ static HRESULT WINAPI d3d9_swapchain_GetBackBuffer(IDirect3DSwapChain9Ex *iface,
UINT
backbuffer_idx
,
D3DBACKBUFFER_TYPE
backbuffer_type
,
IDirect3DSurface9
**
backbuffer
)
{
struct
d3d9_swapchain
*
swapchain
=
impl_from_IDirect3DSwapChain9Ex
(
iface
);
struct
wined3d_surface
*
wined3d_surface
=
NULL
;
struct
wined3d_resource
*
wined3d_resource
;
struct
wined3d_texture
*
wined3d_texture
;
struct
d3d9_surface
*
surface_impl
;
HRESULT
hr
=
D3D_OK
;
TRACE
(
"iface %p, backbuffer_idx %u, backbuffer_type %#x, backbuffer %p.
\n
"
,
iface
,
backbuffer_idx
,
backbuffer_type
,
backbuffer
);
if
(
!
backbuffer
)
{
WARN
(
"The output pointer is NULL, returning D3DERR_INVALIDCALL.
\n
"
);
return
D3DERR_INVALIDCALL
;
}
wined3d_mutex_lock
();
if
((
wined3d_
surfac
e
=
wined3d_swapchain_get_back_buffer
(
swapchain
->
wined3d_swapchain
,
if
((
wined3d_
textur
e
=
wined3d_swapchain_get_back_buffer
(
swapchain
->
wined3d_swapchain
,
backbuffer_idx
,
(
enum
wined3d_backbuffer_type
)
backbuffer_type
)))
{
surface_impl
=
wined3d_surface_get_parent
(
wined3d_surface
);
*
backbuffer
=
&
surface_impl
->
IDirect3DSurface9_iface
;
IDirect3DSurface9_AddRef
(
*
backbuffer
);
wined3d_resource
=
wined3d_texture_get_sub_resource
(
wined3d_texture
,
0
);
surface_impl
=
wined3d_resource_get_parent
(
wined3d_resource
);
*
backbuffer
=
&
surface_impl
->
IDirect3DSurface9_iface
;
IDirect3DSurface9_AddRef
(
*
backbuffer
);
}
else
{
/* Do not set *backbuffer = NULL, see tests/device.c, test_swapchain(). */
hr
=
D3DERR_INVALIDCALL
;
}
wined3d_mutex_unlock
();
...
...
dlls/dxgi/swapchain.c
View file @
f010e5d8
...
...
@@ -143,7 +143,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_swapchain_GetBuffer(IDXGISwapChain *iface,
UINT
buffer_idx
,
REFIID
riid
,
void
**
surface
)
{
struct
dxgi_swapchain
*
This
=
impl_from_IDXGISwapChain
(
iface
);
struct
wined3d_
surface
*
backbuffer
;
struct
wined3d_
texture
*
texture
;
IUnknown
*
parent
;
HRESULT
hr
;
...
...
@@ -152,14 +152,14 @@ static HRESULT STDMETHODCALLTYPE dxgi_swapchain_GetBuffer(IDXGISwapChain *iface,
EnterCriticalSection
(
&
dxgi_cs
);
if
(
!
(
backbuffer
=
wined3d_swapchain_get_back_buffer
(
This
->
wined3d_swapchain
,
if
(
!
(
texture
=
wined3d_swapchain_get_back_buffer
(
This
->
wined3d_swapchain
,
buffer_idx
,
WINED3D_BACKBUFFER_TYPE_MONO
)))
{
LeaveCriticalSection
(
&
dxgi_cs
);
return
DXGI_ERROR_INVALID_CALL
;
}
parent
=
wined3d_
surface_get_parent
(
backbuffer
);
parent
=
wined3d_
texture_get_parent
(
texture
);
hr
=
IUnknown_QueryInterface
(
parent
,
riid
,
surface
);
LeaveCriticalSection
(
&
dxgi_cs
);
...
...
@@ -220,7 +220,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_swapchain_ResizeBuffers(IDXGISwapChain *if
{
struct
dxgi_swapchain
*
swapchain
=
impl_from_IDXGISwapChain
(
iface
);
struct
wined3d_swapchain_desc
wined3d_desc
;
struct
wined3d_
surface
*
surfac
e
;
struct
wined3d_
texture
*
textur
e
;
IUnknown
*
parent
;
unsigned
int
i
;
HRESULT
hr
;
...
...
@@ -235,9 +235,9 @@ static HRESULT STDMETHODCALLTYPE dxgi_swapchain_ResizeBuffers(IDXGISwapChain *if
wined3d_swapchain_get_desc
(
swapchain
->
wined3d_swapchain
,
&
wined3d_desc
);
for
(
i
=
0
;
i
<
wined3d_desc
.
backbuffer_count
;
++
i
)
{
surfac
e
=
wined3d_swapchain_get_back_buffer
(
swapchain
->
wined3d_swapchain
,
textur
e
=
wined3d_swapchain_get_back_buffer
(
swapchain
->
wined3d_swapchain
,
i
,
WINED3D_BACKBUFFER_TYPE_MONO
);
parent
=
wined3d_
surface_get_parent
(
surfac
e
);
parent
=
wined3d_
texture_get_parent
(
textur
e
);
IUnknown_AddRef
(
parent
);
if
(
IUnknown_Release
(
parent
))
{
...
...
dlls/wined3d/device.c
View file @
f010e5d8
...
...
@@ -3186,6 +3186,8 @@ struct wined3d_texture * CDECL wined3d_device_get_texture(const struct wined3d_d
HRESULT
CDECL
wined3d_device_get_back_buffer
(
const
struct
wined3d_device
*
device
,
UINT
swapchain_idx
,
UINT
backbuffer_idx
,
enum
wined3d_backbuffer_type
backbuffer_type
,
struct
wined3d_surface
**
backbuffer
)
{
struct
wined3d_texture
*
texture
;
struct
wined3d_resource
*
resource
;
struct
wined3d_swapchain
*
swapchain
;
TRACE
(
"device %p, swapchain_idx %u, backbuffer_idx %u, backbuffer_type %#x, backbuffer %p.
\n
"
,
...
...
@@ -3194,8 +3196,10 @@ HRESULT CDECL wined3d_device_get_back_buffer(const struct wined3d_device *device
if
(
!
(
swapchain
=
wined3d_device_get_swapchain
(
device
,
swapchain_idx
)))
return
WINED3DERR_INVALIDCALL
;
if
(
!
(
*
backbuffer
=
wined3d_swapchain_get_back_buffer
(
swapchain
,
backbuffer_idx
,
backbuffer_type
)))
if
(
!
(
texture
=
wined3d_swapchain_get_back_buffer
(
swapchain
,
backbuffer_idx
,
backbuffer_type
)))
return
WINED3DERR_INVALIDCALL
;
resource
=
wined3d_texture_get_sub_resource
(
texture
,
0
);
*
backbuffer
=
wined3d_surface_from_resource
(
resource
);
return
WINED3D_OK
;
}
...
...
dlls/wined3d/swapchain.c
View file @
f010e5d8
...
...
@@ -177,7 +177,7 @@ HRESULT CDECL wined3d_swapchain_get_front_buffer_data(const struct wined3d_swapc
return
wined3d_surface_blt
(
dst_surface
,
&
dst_rect
,
src_surface
,
&
src_rect
,
0
,
NULL
,
WINED3D_TEXF_POINT
);
}
struct
wined3d_
surfac
e
*
CDECL
wined3d_swapchain_get_back_buffer
(
const
struct
wined3d_swapchain
*
swapchain
,
struct
wined3d_
textur
e
*
CDECL
wined3d_swapchain_get_back_buffer
(
const
struct
wined3d_swapchain
*
swapchain
,
UINT
back_buffer_idx
,
enum
wined3d_backbuffer_type
type
)
{
TRACE
(
"swapchain %p, back_buffer_idx %u, type %#x.
\n
"
,
...
...
@@ -198,7 +198,7 @@ struct wined3d_surface * CDECL wined3d_swapchain_get_back_buffer(const struct wi
TRACE
(
"Returning back buffer %p.
\n
"
,
swapchain
->
back_buffers
[
back_buffer_idx
]);
return
s
urface_from_resource
(
wined3d_texture_get_sub_resource
(
swapchain
->
back_buffers
[
back_buffer_idx
],
0
))
;
return
s
wapchain
->
back_buffers
[
back_buffer_idx
]
;
}
HRESULT
CDECL
wined3d_swapchain_get_raster_status
(
const
struct
wined3d_swapchain
*
swapchain
,
...
...
include/wine/wined3d.h
View file @
f010e5d8
...
...
@@ -2513,7 +2513,7 @@ HRESULT __cdecl wined3d_surface_update_overlay_z_order(struct wined3d_surface *s
HRESULT
__cdecl
wined3d_swapchain_create
(
struct
wined3d_device
*
device
,
struct
wined3d_swapchain_desc
*
desc
,
void
*
parent
,
const
struct
wined3d_parent_ops
*
parent_ops
,
struct
wined3d_swapchain
**
swapchain
);
ULONG
__cdecl
wined3d_swapchain_decref
(
struct
wined3d_swapchain
*
swapchain
);
struct
wined3d_
surfac
e
*
__cdecl
wined3d_swapchain_get_back_buffer
(
const
struct
wined3d_swapchain
*
swapchain
,
struct
wined3d_
textur
e
*
__cdecl
wined3d_swapchain_get_back_buffer
(
const
struct
wined3d_swapchain
*
swapchain
,
UINT
backbuffer_idx
,
enum
wined3d_backbuffer_type
backbuffer_type
);
struct
wined3d_device
*
__cdecl
wined3d_swapchain_get_device
(
const
struct
wined3d_swapchain
*
swapchain
);
HRESULT
__cdecl
wined3d_swapchain_get_display_mode
(
const
struct
wined3d_swapchain
*
swapchain
,
...
...
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