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
5fcc1f8f
Commit
5fcc1f8f
authored
Oct 04, 2012
by
Henri Verbeet
Committed by
Alexandre Julliard
Oct 04, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Just return the surface from wined3d_swapchain_get_back_buffer().
parent
272f6326
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
31 additions
and
37 deletions
+31
-37
device.c
dlls/d3d8/device.c
+0
-1
swapchain.c
dlls/d3d8/swapchain.c
+7
-5
device.c
dlls/d3d9/device.c
+0
-1
swapchain.c
dlls/d3d9/swapchain.c
+7
-5
swapchain.c
dlls/dxgi/swapchain.c
+3
-5
device.c
dlls/wined3d/device.c
+3
-1
stateblock.c
dlls/wined3d/stateblock.c
+1
-4
swapchain.c
dlls/wined3d/swapchain.c
+7
-12
wined3d.spec
dlls/wined3d/wined3d.spec
+1
-1
wined3d.h
include/wine/wined3d.h
+2
-2
No files found.
dlls/d3d8/device.c
View file @
5fcc1f8f
...
...
@@ -647,7 +647,6 @@ static HRESULT WINAPI d3d8_device_GetBackBuffer(IDirect3DDevice8 *iface,
surface_impl
=
wined3d_surface_get_parent
(
wined3d_surface
);
*
backbuffer
=
&
surface_impl
->
IDirect3DSurface8_iface
;
IDirect3DSurface8_AddRef
(
*
backbuffer
);
wined3d_surface_decref
(
wined3d_surface
);
}
wined3d_mutex_unlock
();
...
...
dlls/d3d8/swapchain.c
View file @
5fcc1f8f
...
...
@@ -110,20 +110,22 @@ static HRESULT WINAPI d3d8_swapchain_GetBackBuffer(IDirect3DSwapChain8 *iface,
struct
d3d8_swapchain
*
swapchain
=
impl_from_IDirect3DSwapChain8
(
iface
);
struct
wined3d_surface
*
wined3d_surface
=
NULL
;
struct
d3d8_surface
*
surface_impl
;
HRESULT
hr
;
HRESULT
hr
=
D3D_OK
;
TRACE
(
"iface %p, backbuffer_idx %u, backbuffer_type %#x, backbuffer %p.
\n
"
,
iface
,
backbuffer_idx
,
backbuffer_type
,
backbuffer
);
wined3d_mutex_lock
();
hr
=
wined3d_swapchain_get_back_buffer
(
swapchain
->
wined3d_swapchain
,
backbuffer_idx
,
(
enum
wined3d_backbuffer_type
)
backbuffer_type
,
&
wined3d_surface
);
if
(
SUCCEEDED
(
hr
)
&&
wined3d_surface
)
if
((
wined3d_surface
=
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
->
IDirect3DSurface8_iface
;
IDirect3DSurface8_AddRef
(
*
backbuffer
);
wined3d_surface_decref
(
wined3d_surface
);
}
else
{
hr
=
D3DERR_INVALIDCALL
;
}
wined3d_mutex_unlock
();
...
...
dlls/d3d9/device.c
View file @
5fcc1f8f
...
...
@@ -628,7 +628,6 @@ static HRESULT WINAPI d3d9_device_GetBackBuffer(IDirect3DDevice9Ex *iface, UINT
surface_impl
=
wined3d_surface_get_parent
(
wined3d_surface
);
*
backbuffer
=
&
surface_impl
->
IDirect3DSurface9_iface
;
IDirect3DSurface9_AddRef
(
*
backbuffer
);
wined3d_surface_decref
(
wined3d_surface
);
}
wined3d_mutex_unlock
();
...
...
dlls/d3d9/swapchain.c
View file @
5fcc1f8f
...
...
@@ -131,20 +131,22 @@ static HRESULT WINAPI d3d9_swapchain_GetBackBuffer(IDirect3DSwapChain9 *iface,
struct
d3d9_swapchain
*
swapchain
=
impl_from_IDirect3DSwapChain9
(
iface
);
struct
wined3d_surface
*
wined3d_surface
=
NULL
;
struct
d3d9_surface
*
surface_impl
;
HRESULT
hr
;
HRESULT
hr
=
D3D_OK
;
TRACE
(
"iface %p, backbuffer_idx %u, backbuffer_type %#x, backbuffer %p.
\n
"
,
iface
,
backbuffer_idx
,
backbuffer_type
,
backbuffer
);
wined3d_mutex_lock
();
hr
=
wined3d_swapchain_get_back_buffer
(
swapchain
->
wined3d_swapchain
,
backbuffer_idx
,
(
enum
wined3d_backbuffer_type
)
backbuffer_type
,
&
wined3d_surface
);
if
(
SUCCEEDED
(
hr
)
&&
wined3d_surface
)
if
((
wined3d_surface
=
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_surface_decref
(
wined3d_surface
);
}
else
{
hr
=
D3DERR_INVALIDCALL
;
}
wined3d_mutex_unlock
();
...
...
dlls/dxgi/swapchain.c
View file @
5fcc1f8f
...
...
@@ -158,17 +158,15 @@ static HRESULT STDMETHODCALLTYPE dxgi_swapchain_GetBuffer(IDXGISwapChain *iface,
EnterCriticalSection
(
&
dxgi_cs
);
hr
=
wined3d_swapchain_get_back_buffer
(
This
->
wined3d_swapchain
,
buffer_idx
,
WINED3D_BACKBUFFER_TYPE_MONO
,
&
backbuffer
);
if
(
FAILED
(
hr
))
if
(
!
(
backbuffer
=
wined3d_swapchain_get_back_buffer
(
This
->
wined3d_swapchain
,
buffer_idx
,
WINED3D_BACKBUFFER_TYPE_MONO
)))
{
LeaveCriticalSection
(
&
dxgi_cs
);
return
hr
;
return
DXGI_ERROR_INVALID_CALL
;
}
parent
=
wined3d_surface_get_parent
(
backbuffer
);
hr
=
IUnknown_QueryInterface
(
parent
,
riid
,
surface
);
wined3d_surface_decref
(
backbuffer
);
LeaveCriticalSection
(
&
dxgi_cs
);
return
hr
;
...
...
dlls/wined3d/device.c
View file @
5fcc1f8f
...
...
@@ -3583,7 +3583,9 @@ HRESULT CDECL wined3d_device_get_back_buffer(const struct wined3d_device *device
if
(
!
(
swapchain
=
wined3d_device_get_swapchain
(
device
,
swapchain_idx
)))
return
WINED3DERR_INVALIDCALL
;
return
wined3d_swapchain_get_back_buffer
(
swapchain
,
backbuffer_idx
,
backbuffer_type
,
backbuffer
);
if
(
!
(
*
backbuffer
=
wined3d_swapchain_get_back_buffer
(
swapchain
,
backbuffer_idx
,
backbuffer_type
)))
return
WINED3DERR_INVALIDCALL
;
return
WINED3D_OK
;
}
HRESULT
CDECL
wined3d_device_get_device_caps
(
const
struct
wined3d_device
*
device
,
WINED3DCAPS
*
caps
)
...
...
dlls/wined3d/stateblock.c
View file @
5fcc1f8f
...
...
@@ -1095,7 +1095,6 @@ void stateblock_init_default_state(struct wined3d_stateblock *stateblock)
unsigned
int
i
;
struct
wined3d_swapchain
*
swapchain
;
struct
wined3d_surface
*
backbuffer
;
HRESULT
hr
;
TRACE
(
"stateblock %p.
\n
"
,
stateblock
);
...
...
@@ -1298,13 +1297,11 @@ void stateblock_init_default_state(struct wined3d_stateblock *stateblock)
/* check the return values, because the GetBackBuffer call isn't valid for ddraw */
if
((
swapchain
=
wined3d_device_get_swapchain
(
device
,
0
)))
{
hr
=
wined3d_swapchain_get_back_buffer
(
swapchain
,
0
,
WINED3D_BACKBUFFER_TYPE_MONO
,
&
backbuffer
);
if
(
SUCCEEDED
(
hr
)
&&
backbuffer
)
if
((
backbuffer
=
wined3d_swapchain_get_back_buffer
(
swapchain
,
0
,
WINED3D_BACKBUFFER_TYPE_MONO
)))
{
struct
wined3d_resource_desc
desc
;
wined3d_resource_get_desc
(
&
backbuffer
->
resource
,
&
desc
);
wined3d_surface_decref
(
backbuffer
);
/* Set the default scissor rect values */
state
->
scissor_rect
.
left
=
0
;
...
...
dlls/wined3d/swapchain.c
View file @
5fcc1f8f
...
...
@@ -188,11 +188,11 @@ 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
);
}
HRESULT
CDECL
wined3d_swapchain_get_back_buffer
(
const
struct
wined3d_swapchain
*
swapchain
,
UINT
back_buffer_idx
,
enum
wined3d_backbuffer_type
type
,
struct
wined3d_surface
**
back_buffer
)
struct
wined3d_surface
*
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
, back_buffer %p
.
\n
"
,
swapchain
,
back_buffer_idx
,
type
,
back_buffer
);
TRACE
(
"swapchain %p, back_buffer_idx %u, type %#x.
\n
"
,
swapchain
,
back_buffer_idx
,
type
);
/* Return invalid if there is no backbuffer array, otherwise it will
* crash when ddraw is used (there swapchain->back_buffers is always
...
...
@@ -204,17 +204,12 @@ HRESULT CDECL wined3d_swapchain_get_back_buffer(const struct wined3d_swapchain *
WARN
(
"Invalid back buffer index.
\n
"
);
/* Native d3d9 doesn't set NULL here, just as wine's d3d9. But set it
* here in wined3d to avoid problems in other libs. */
*
back_buffer
=
NULL
;
return
WINED3DERR_INVALIDCALL
;
return
NULL
;
}
*
back_buffer
=
swapchain
->
back_buffers
[
back_buffer_idx
];
if
(
*
back_buffer
)
wined3d_surface_incref
(
*
back_buffer
);
TRACE
(
"Returning back buffer %p.
\n
"
,
swapchain
->
back_buffers
[
back_buffer_idx
]);
TRACE
(
"Returning back buffer %p.
\n
"
,
*
back_buffer
);
return
WINED3D_OK
;
return
swapchain
->
back_buffers
[
back_buffer_idx
];
}
HRESULT
CDECL
wined3d_swapchain_get_raster_status
(
const
struct
wined3d_swapchain
*
swapchain
,
...
...
dlls/wined3d/wined3d.spec
View file @
5fcc1f8f
...
...
@@ -222,7 +222,7 @@
@ cdecl wined3d_swapchain_create(ptr ptr long ptr ptr ptr)
@ cdecl wined3d_swapchain_decref(ptr)
@ cdecl wined3d_swapchain_get_back_buffer(ptr long long
ptr
)
@ cdecl wined3d_swapchain_get_back_buffer(ptr long long)
@ cdecl wined3d_swapchain_get_device(ptr)
@ cdecl wined3d_swapchain_get_display_mode(ptr ptr ptr)
@ cdecl wined3d_swapchain_get_front_buffer_data(ptr ptr)
...
...
include/wine/wined3d.h
View file @
5fcc1f8f
...
...
@@ -2359,8 +2359,8 @@ HRESULT __cdecl wined3d_swapchain_create(struct wined3d_device *device,
struct
wined3d_swapchain_desc
*
desc
,
enum
wined3d_surface_type
surface_type
,
void
*
parent
,
const
struct
wined3d_parent_ops
*
parent_ops
,
struct
wined3d_swapchain
**
swapchain
);
ULONG
__cdecl
wined3d_swapchain_decref
(
struct
wined3d_swapchain
*
swapchain
);
HRESULT
__cdecl
wined3d_swapchain_get_back_buffer
(
const
struct
wined3d_swapchain
*
swapchain
,
UINT
backbuffer_idx
,
enum
wined3d_backbuffer_type
backbuffer_type
,
struct
wined3d_surface
**
backbuffer
);
struct
wined3d_surface
*
__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
,
struct
wined3d_display_mode
*
mode
,
enum
wined3d_display_rotation
*
rotation
);
...
...
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