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
401e99b0
Commit
401e99b0
authored
Jul 23, 2009
by
Henri Verbeet
Committed by
Alexandre Julliard
Jul 23, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Remove some unnecessary code.
Now that we don't depend on activeContext and lastActiveRenderTarget to be non-NULL this code can go.
parent
57ccdb7e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
65 deletions
+3
-65
context.c
dlls/wined3d/context.c
+3
-49
swapchain.c
dlls/wined3d/swapchain.c
+0
-16
No files found.
dlls/wined3d/context.c
View file @
401e99b0
...
...
@@ -467,59 +467,13 @@ void context_resource_released(IWineD3DDevice *iface, IWineD3DResource *resource
IWineD3DDeviceImpl
*
This
=
(
IWineD3DDeviceImpl
*
)
iface
;
UINT
i
;
if
(
!
This
->
d3d_initialized
)
return
;
switch
(
type
)
{
case
WINED3DRTYPE_SURFACE
:
{
if
(
This
->
activeContext
&&
(
IWineD3DSurface
*
)
resource
==
This
->
activeContext
->
current_rt
)
{
IWineD3DSwapChainImpl
*
swapchain
;
TRACE
(
"Last active render target destroyed.
\n
"
);
/* Find a replacement surface for the currently active back
* buffer. The context manager does not do NULL checks, so
* switch to a valid target as long as the currently set
* surface is still valid. Use the surface of the implicit
* swpchain. If that is the same as the destroyed surface the
* device is destroyed and the lastActiveRenderTarget member
* shouldn't matter. */
swapchain
=
This
->
swapchains
?
(
IWineD3DSwapChainImpl
*
)
This
->
swapchains
[
0
]
:
NULL
;
if
(
swapchain
)
{
if
(
swapchain
->
backBuffer
&&
swapchain
->
backBuffer
[
0
]
!=
(
IWineD3DSurface
*
)
resource
)
{
TRACE
(
"Activating primary back buffer.
\n
"
);
ActivateContext
(
This
,
swapchain
->
backBuffer
[
0
],
CTXUSAGE_RESOURCELOAD
);
}
else
if
(
!
swapchain
->
backBuffer
&&
swapchain
->
frontBuffer
!=
(
IWineD3DSurface
*
)
resource
)
{
/* Single buffering environment */
TRACE
(
"Activating primary front buffer.
\n
"
);
ActivateContext
(
This
,
swapchain
->
frontBuffer
,
CTXUSAGE_RESOURCELOAD
);
}
else
{
/* Implicit render target destroyed, that means the
* device is being destroyed whatever we set here, it
* shouldn't matter. */
TRACE
(
"Device is being destroyed, setting current_rt to 0xdeadbabe.
\n
"
);
This
->
activeContext
->
current_rt
=
(
IWineD3DSurface
*
)
0xdeadbabe
;
}
}
else
{
WARN
(
"Render target set, but swapchain does not exist!
\n
"
);
/* May happen during ddraw uninitialization. */
This
->
activeContext
->
current_rt
=
(
IWineD3DSurface
*
)
0xdeadcafe
;
}
}
else
if
(
This
->
d3d_initialized
)
{
ActivateContext
(
This
,
NULL
,
CTXUSAGE_RESOURCELOAD
);
}
ActivateContext
(
This
,
NULL
,
CTXUSAGE_RESOURCELOAD
);
for
(
i
=
0
;
i
<
This
->
numContexts
;
++
i
)
{
...
...
dlls/wined3d/swapchain.c
View file @
401e99b0
...
...
@@ -66,22 +66,6 @@ static void WINAPI IWineD3DSwapChainImpl_Destroy(IWineD3DSwapChain *iface, D3DCB
for
(
i
=
0
;
i
<
This
->
num_contexts
;
++
i
)
{
if
(
This
->
context
[
i
]
==
This
->
wineD3DDevice
->
activeContext
)
{
IWineD3DSwapChainImpl
*
swapchain
=
(
IWineD3DSwapChainImpl
*
)
This
->
wineD3DDevice
->
swapchains
[
0
];
/* Avoid destroying the currently active context for non-implicit swapchains. */
if
(
This
!=
swapchain
)
{
TRACE
(
"Would destroy currently active context %p on a non-implicit swapchain.
\n
"
,
This
->
context
[
i
]);
if
(
swapchain
->
backBuffer
)
ActivateContext
(
This
->
wineD3DDevice
,
swapchain
->
backBuffer
[
0
],
CTXUSAGE_RESOURCELOAD
);
else
ActivateContext
(
This
->
wineD3DDevice
,
swapchain
->
frontBuffer
,
CTXUSAGE_RESOURCELOAD
);
}
}
DestroyContext
(
This
->
wineD3DDevice
,
This
->
context
[
i
]);
}
/* Restore the screen resolution if we rendered in fullscreen
...
...
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