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
227efbbf
Commit
227efbbf
authored
Jan 19, 2011
by
Henri Verbeet
Committed by
Alexandre Julliard
Jan 20, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Store a pointer to an array of IWineD3DSwapChainImpl pointers in the device.
parent
6f95f05a
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
20 deletions
+27
-20
context.c
dlls/wined3d/context.c
+2
-2
device.c
dlls/wined3d/device.c
+22
-15
surface.c
dlls/wined3d/surface.c
+1
-1
surface_gdi.c
dlls/wined3d/surface_gdi.c
+1
-1
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-1
No files found.
dlls/wined3d/context.c
View file @
227efbbf
...
...
@@ -1877,7 +1877,7 @@ static struct wined3d_context *FindContext(IWineD3DDeviceImpl *This, IWineD3DSur
}
else
{
IWineD3DSwapChainImpl
*
swapchain
=
(
IWineD3DSwapChainImpl
*
)
This
->
swapchains
[
0
];
IWineD3DSwapChainImpl
*
swapchain
=
This
->
swapchains
[
0
];
if
(
swapchain
->
back_buffers
)
target
=
swapchain
->
back_buffers
[
0
];
else
target
=
swapchain
->
front_buffer
;
}
...
...
@@ -1904,7 +1904,7 @@ static struct wined3d_context *FindContext(IWineD3DDeviceImpl *This, IWineD3DSur
if
(
current_context
&&
current_context
->
swapchain
->
device
==
This
)
context
=
current_context
;
else
context
=
swapchain_get_context
(
(
IWineD3DSwapChainImpl
*
)
This
->
swapchains
[
0
]);
context
=
swapchain_get_context
(
This
->
swapchains
[
0
]);
}
context_validate
(
context
);
...
...
dlls/wined3d/device.c
View file @
227efbbf
...
...
@@ -1305,8 +1305,9 @@ static HRESULT WINAPI IWineD3DDeviceImpl_GetSwapChain(IWineD3DDevice *iface, U
IWineD3DDeviceImpl
*
This
=
(
IWineD3DDeviceImpl
*
)
iface
;
TRACE
(
"(%p) : swapchain %d
\n
"
,
This
,
iSwapChain
);
if
(
iSwapChain
<
This
->
NumberOfSwapChains
)
{
*
pSwapChain
=
This
->
swapchains
[
iSwapChain
];
if
(
iSwapChain
<
This
->
NumberOfSwapChains
)
{
*
pSwapChain
=
(
IWineD3DSwapChain
*
)
This
->
swapchains
[
iSwapChain
];
IWineD3DSwapChain_AddRef
(
*
pSwapChain
);
TRACE
(
"(%p) returning %p
\n
"
,
This
,
*
pSwapChain
);
return
WINED3D_OK
;
...
...
@@ -1939,12 +1940,13 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Init3D(IWineD3DDevice *iface,
}
This
->
NumberOfSwapChains
=
1
;
This
->
swapchains
=
HeapAlloc
(
GetProcessHeap
(),
0
,
This
->
NumberOfSwapChains
*
sizeof
(
IWineD3DSwapChain
*
));
if
(
!
This
->
swapchains
)
{
This
->
swapchains
=
HeapAlloc
(
GetProcessHeap
(),
0
,
This
->
NumberOfSwapChains
*
sizeof
(
*
This
->
swapchains
));
if
(
!
This
->
swapchains
)
{
ERR
(
"Out of memory!
\n
"
);
goto
err_out
;
}
This
->
swapchains
[
0
]
=
(
IWineD3DSwapChain
*
)
swapchain
;
This
->
swapchains
[
0
]
=
swapchain
;
if
(
swapchain
->
back_buffers
&&
swapchain
->
back_buffers
[
0
])
{
...
...
@@ -2079,12 +2081,13 @@ static HRESULT WINAPI IWineD3DDeviceImpl_InitGDI(IWineD3DDevice *iface,
}
This
->
NumberOfSwapChains
=
1
;
This
->
swapchains
=
HeapAlloc
(
GetProcessHeap
(),
0
,
This
->
NumberOfSwapChains
*
sizeof
(
IWineD3DSwapChain
*
));
if
(
!
This
->
swapchains
)
{
This
->
swapchains
=
HeapAlloc
(
GetProcessHeap
(),
0
,
This
->
NumberOfSwapChains
*
sizeof
(
*
This
->
swapchains
));
if
(
!
This
->
swapchains
)
{
ERR
(
"Out of memory!
\n
"
);
goto
err_out
;
}
This
->
swapchains
[
0
]
=
(
IWineD3DSwapChain
*
)
swapchain
;
This
->
swapchains
[
0
]
=
swapchain
;
return
WINED3D_OK
;
err_out:
...
...
@@ -2227,9 +2230,11 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Uninit3D(IWineD3DDevice *iface,
context_release
(
context
);
for
(
i
=
0
;
i
<
This
->
NumberOfSwapChains
;
i
++
)
{
TRACE
(
"Releasing the implicit swapchain %d
\n
"
,
i
);
if
(
D3DCB_DestroySwapChain
(
This
->
swapchains
[
i
])
>
0
)
{
for
(
i
=
0
;
i
<
This
->
NumberOfSwapChains
;
++
i
)
{
TRACE
(
"Releasing the implicit swapchain %u.
\n
"
,
i
);
if
(
D3DCB_DestroySwapChain
((
IWineD3DSwapChain
*
)
This
->
swapchains
[
i
])
>
0
)
{
FIXME
(
"(%p) Something's still holding the implicit swapchain
\n
"
,
This
);
}
}
...
...
@@ -2255,9 +2260,11 @@ static HRESULT WINAPI IWineD3DDeviceImpl_UninitGDI(IWineD3DDevice *iface, D3DCB_
IWineD3DDeviceImpl
*
This
=
(
IWineD3DDeviceImpl
*
)
iface
;
unsigned
int
i
;
for
(
i
=
0
;
i
<
This
->
NumberOfSwapChains
;
i
++
)
{
TRACE
(
"Releasing the implicit swapchain %d
\n
"
,
i
);
if
(
D3DCB_DestroySwapChain
(
This
->
swapchains
[
i
])
>
0
)
{
for
(
i
=
0
;
i
<
This
->
NumberOfSwapChains
;
++
i
)
{
TRACE
(
"Releasing the implicit swapchain %u.
\n
"
,
i
);
if
(
D3DCB_DestroySwapChain
((
IWineD3DSwapChain
*
)
This
->
swapchains
[
i
])
>
0
)
{
FIXME
(
"(%p) Something's still holding the implicit swapchain
\n
"
,
This
);
}
}
...
...
@@ -5820,7 +5827,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetDepthStencilSurface(IWineD3DDevice *
if
(
This
->
depth_stencil
)
{
if
(
((
IWineD3DSwapChainImpl
*
)
This
->
swapchains
[
0
])
->
presentParms
.
Flags
&
WINED3DPRESENTFLAG_DISCARD_DEPTHSTENCIL
if
(
This
->
swapchains
[
0
]
->
presentParms
.
Flags
&
WINED3DPRESENTFLAG_DISCARD_DEPTHSTENCIL
||
This
->
depth_stencil
->
flags
&
SFLAG_DISCARD
)
{
surface_modify_ds_location
(
This
->
depth_stencil
,
SFLAG_DS_DISCARDED
,
...
...
dlls/wined3d/surface.c
View file @
227efbbf
...
...
@@ -2014,7 +2014,7 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_GetDC(IWineD3DSurface *iface, HDC *pHD
}
else
{
IWineD3DSurfaceImpl
*
dds_primary
;
IWineD3DSwapChainImpl
*
swapchain
;
swapchain
=
(
IWineD3DSwapChainImpl
*
)
This
->
resource
.
device
->
swapchains
[
0
];
swapchain
=
This
->
resource
.
device
->
swapchains
[
0
];
dds_primary
=
swapchain
->
front_buffer
;
if
(
dds_primary
&&
dds_primary
->
palette
)
pal
=
dds_primary
->
palette
->
palents
;
...
...
dlls/wined3d/surface_gdi.c
View file @
227efbbf
...
...
@@ -266,7 +266,7 @@ static HRESULT WINAPI IWineGDISurfaceImpl_GetDC(IWineD3DSurface *iface, HDC *pHD
}
else
{
IWineD3DSurfaceImpl
*
dds_primary
;
IWineD3DSwapChainImpl
*
swapchain
;
swapchain
=
(
IWineD3DSwapChainImpl
*
)
This
->
resource
.
device
->
swapchains
[
0
];
swapchain
=
This
->
resource
.
device
->
swapchains
[
0
];
dds_primary
=
swapchain
->
front_buffer
;
if
(
dds_primary
&&
dds_primary
->
palette
)
pal
=
dds_primary
->
palette
->
palents
;
...
...
dlls/wined3d/wined3d_private.h
View file @
227efbbf
...
...
@@ -1707,7 +1707,7 @@ struct IWineD3DDeviceImpl
WINED3DDEVTYPE
devType
;
HWND
focus_window
;
IWineD3DSwapChain
**
swapchains
;
IWineD3DSwapChain
Impl
**
swapchains
;
UINT
NumberOfSwapChains
;
struct
list
resources
;
/* a linked list to track resources created by the device */
...
...
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