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
1fb168f0
Commit
1fb168f0
authored
Jul 09, 2007
by
Stefan Dösinger
Committed by
Alexandre Julliard
Jul 10, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Make ActivateContext a bit smaller.
parent
fdadf26c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
20 deletions
+39
-20
context.c
dlls/wined3d/context.c
+39
-20
No files found.
dlls/wined3d/context.c
View file @
1fb168f0
...
...
@@ -650,32 +650,23 @@ static WineD3DContext *findThreadContextForSwapChain(IWineD3DSwapChain *swapchai
}
/*****************************************************************************
*
Activate
Context
*
Find
Context
*
* Finds a rendering context and drawable matching the device and render
* target for the current thread, activates them and puts them into the
* requested state.
* Finds a context for the current render target and thread
*
* Params:
* This: Device to activate the context for
* target: Requested render target
* usage: Prepares the context for blitting, drawing or other actions
* Parameters:
* target: Render target to find the context for
* tid: Thread to activate the context for
*
* Returns: The needed context
*
*****************************************************************************/
void
ActivateContext
(
IWineD3DDeviceImpl
*
This
,
IWineD3DSurface
*
target
,
ContextUsage
usage
)
{
DWORD
tid
=
GetCurrentThreadId
();
int
i
;
DWORD
dirtyState
,
idx
;
BYTE
shift
;
WineD3DContext
*
context
=
This
->
activeContext
;
BOOL
oldRenderOffscreen
=
This
->
render_offscreen
;
TRACE
(
"(%p): Selecting context for render target %p, thread %d
\n
"
,
This
,
target
,
tid
);
if
(
This
->
lastActiveRenderTarget
!=
target
||
tid
!=
This
->
lastThread
)
{
static
inline
WineD3DContext
*
FindContext
(
IWineD3DDeviceImpl
*
This
,
IWineD3DSurface
*
target
,
DWORD
tid
)
{
IWineD3DSwapChain
*
swapchain
=
NULL
;
HRESULT
hr
;
BOOL
readTexture
=
wined3d_settings
.
offscreen_rendering_mode
!=
ORM_FBO
&&
This
->
render_offscreen
;
WineD3DContext
*
context
=
This
->
activeContext
;
BOOL
oldRenderOffscreen
=
This
->
render_offscreen
;
hr
=
IWineD3DSurface_GetContainer
(
target
,
&
IID_IWineD3DSwapChain
,
(
void
**
)
&
swapchain
);
if
(
hr
==
WINED3D_OK
&&
swapchain
)
{
...
...
@@ -817,10 +808,38 @@ void ActivateContext(IWineD3DDeviceImpl *This, IWineD3DSurface *target, ContextU
This
->
isInDraw
=
oldInDraw
;
}
This
->
lastActiveRenderTarget
=
target
;
if
(
oldRenderOffscreen
!=
This
->
render_offscreen
&&
This
->
depth_copy_state
!=
WINED3D_DCS_NO_COPY
)
{
This
->
depth_copy_state
=
WINED3D_DCS_COPY
;
}
return
context
;
}
/*****************************************************************************
* ActivateContext
*
* Finds a rendering context and drawable matching the device and render
* target for the current thread, activates them and puts them into the
* requested state.
*
* Params:
* This: Device to activate the context for
* target: Requested render target
* usage: Prepares the context for blitting, drawing or other actions
*
*****************************************************************************/
void
ActivateContext
(
IWineD3DDeviceImpl
*
This
,
IWineD3DSurface
*
target
,
ContextUsage
usage
)
{
DWORD
tid
=
GetCurrentThreadId
();
int
i
;
DWORD
dirtyState
,
idx
;
BYTE
shift
;
WineD3DContext
*
context
;
TRACE
(
"(%p): Selecting context for render target %p, thread %d
\n
"
,
This
,
target
,
tid
);
if
(
This
->
lastActiveRenderTarget
!=
target
||
tid
!=
This
->
lastThread
)
{
context
=
FindContext
(
This
,
target
,
tid
);
This
->
lastActiveRenderTarget
=
target
;
}
else
{
/* Stick to the old context */
context
=
This
->
activeContext
;
...
...
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