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
6b34b8e6
Commit
6b34b8e6
authored
Apr 21, 2010
by
Henri Verbeet
Committed by
Alexandre Julliard
Apr 22, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Simply pass an IWineD3DSurfaceImpl pointer to context_acquire().
parent
1c403e44
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
27 additions
and
28 deletions
+27
-28
arb_program_shader.c
dlls/wined3d/arb_program_shader.c
+1
-1
context.c
dlls/wined3d/context.c
+4
-3
device.c
dlls/wined3d/device.c
+5
-5
drawprim.c
dlls/wined3d/drawprim.c
+1
-1
query.c
dlls/wined3d/query.c
+6
-8
surface.c
dlls/wined3d/surface.c
+7
-7
swapchain.c
dlls/wined3d/swapchain.c
+2
-2
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-1
No files found.
dlls/wined3d/arb_program_shader.c
View file @
6b34b8e6
...
...
@@ -6909,7 +6909,7 @@ HRESULT arbfp_blit_surface(IWineD3DDeviceImpl *device, IWineD3DSurfaceImpl *src_
surface_internal_preload
((
IWineD3DSurface
*
)
src_surface
,
SRGB_RGB
);
/* Activate the destination context, set it up for blitting */
context
=
context_acquire
(
device
,
(
IWineD3DSurface
*
)
dst_surface
,
CTXUSAGE_BLIT
);
context
=
context_acquire
(
device
,
dst_surface
,
CTXUSAGE_BLIT
);
/* The coordinates of the ddraw front buffer are always fullscreen ('screen coordinates',
* while OpenGL coordinates are window relative.
...
...
dlls/wined3d/context.c
View file @
6b34b8e6
...
...
@@ -2179,15 +2179,16 @@ static void context_setup_target(IWineD3DDeviceImpl *device,
* usage: Prepares the context for blitting, drawing or other actions
*
*****************************************************************************/
struct
wined3d_context
*
context_acquire
(
IWineD3DDeviceImpl
*
device
,
IWineD3DSurface
*
target
,
enum
ContextUsage
usage
)
struct
wined3d_context
*
context_acquire
(
IWineD3DDeviceImpl
*
device
,
IWineD3DSurfaceImpl
*
target
,
enum
ContextUsage
usage
)
{
struct
wined3d_context
*
current_context
=
context_get_current
();
struct
wined3d_context
*
context
;
TRACE
(
"device %p, target %p, usage %#x.
\n
"
,
device
,
target
,
usage
);
context
=
FindContext
(
device
,
(
IWineD3DSurfaceImpl
*
)
target
);
context_setup_target
(
device
,
context
,
(
IWineD3DSurfaceImpl
*
)
target
);
context
=
FindContext
(
device
,
target
);
context_setup_target
(
device
,
context
,
target
);
context_enter
(
context
);
if
(
!
context
->
valid
)
return
context
;
...
...
dlls/wined3d/device.c
View file @
6b34b8e6
...
...
@@ -1658,7 +1658,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Init3D(IWineD3DDevice *iface,
/* Setup all the devices defaults */
IWineD3DStateBlock_InitStartupStateBlock
((
IWineD3DStateBlock
*
)
This
->
stateBlock
);
context
=
context_acquire
(
This
,
swapchain
->
frontBuffer
,
CTXUSAGE_RESOURCELOAD
);
context
=
context_acquire
(
This
,
(
IWineD3DSurfaceImpl
*
)
swapchain
->
frontBuffer
,
CTXUSAGE_RESOURCELOAD
);
create_dummy_textures
(
This
);
...
...
@@ -4394,7 +4394,7 @@ HRESULT IWineD3DDeviceImpl_ClearSurface(IWineD3DDeviceImpl *This, IWineD3DSurfac
IWineD3DSurface_LoadLocation
((
IWineD3DSurface
*
)
target
,
SFLAG_INDRAWABLE
,
NULL
);
}
context
=
context_acquire
(
This
,
(
IWineD3DSurface
*
)
target
,
CTXUSAGE_CLEAR
);
context
=
context_acquire
(
This
,
target
,
CTXUSAGE_CLEAR
);
if
(
wined3d_settings
.
offscreen_rendering_mode
==
ORM_FBO
)
{
if
(
!
surface_is_offscreen
(
target
))
...
...
@@ -5462,7 +5462,7 @@ static void color_fill_fbo(IWineD3DDevice *iface, IWineD3DSurface *surface,
{
TRACE
(
"Surface %p is onscreen
\n
"
,
surface
);
context
=
context_acquire
(
This
,
surface
,
CTXUSAGE_RESOURCELOAD
);
context
=
context_acquire
(
This
,
(
IWineD3DSurfaceImpl
*
)
surface
,
CTXUSAGE_RESOURCELOAD
);
ENTER_GL
();
context_bind_fbo
(
context
,
GL_FRAMEBUFFER
,
NULL
);
context_set_draw_buffer
(
context
,
surface_get_gl_buffer
((
IWineD3DSurfaceImpl
*
)
surface
));
...
...
@@ -5756,8 +5756,8 @@ void stretch_rect_fbo(IWineD3DDeviceImpl *device, IWineD3DSurfaceImpl *src_surfa
IWineD3DSurface_LoadLocation
((
IWineD3DSurface
*
)
src_surface
,
SFLAG_INDRAWABLE
,
NULL
);
IWineD3DSurface_LoadLocation
((
IWineD3DSurface
*
)
dst_surface
,
SFLAG_INDRAWABLE
,
NULL
);
if
(
!
surface_is_offscreen
(
src_surface
))
context
=
context_acquire
(
device
,
(
IWineD3DSurface
*
)
src_surface
,
CTXUSAGE_RESOURCELOAD
);
else
if
(
!
surface_is_offscreen
(
dst_surface
))
context
=
context_acquire
(
device
,
(
IWineD3DSurface
*
)
dst_surface
,
CTXUSAGE_RESOURCELOAD
);
if
(
!
surface_is_offscreen
(
src_surface
))
context
=
context_acquire
(
device
,
src_surface
,
CTXUSAGE_RESOURCELOAD
);
else
if
(
!
surface_is_offscreen
(
dst_surface
))
context
=
context_acquire
(
device
,
dst_surface
,
CTXUSAGE_RESOURCELOAD
);
else
context
=
context_acquire
(
device
,
NULL
,
CTXUSAGE_RESOURCELOAD
);
if
(
!
context
->
valid
)
...
...
dlls/wined3d/drawprim.c
View file @
6b34b8e6
...
...
@@ -594,7 +594,7 @@ void drawPrimitive(IWineD3DDevice *iface, UINT index_count, UINT StartIdx, UINT
/* Signals other modules that a drawing is in progress and the stateblock finalized */
This
->
isInDraw
=
TRUE
;
context
=
context_acquire
(
This
,
(
IWineD3DSurface
*
)
This
->
render_targets
[
0
],
CTXUSAGE_DRAWPRIM
);
context
=
context_acquire
(
This
,
This
->
render_targets
[
0
],
CTXUSAGE_DRAWPRIM
);
if
(
!
context
->
valid
)
{
context_release
(
context
);
...
...
dlls/wined3d/query.c
View file @
6b34b8e6
...
...
@@ -59,7 +59,7 @@ enum wined3d_event_query_result wined3d_event_query_test(struct wined3d_event_qu
return
WINED3D_EVENT_QUERY_WRONG_THREAD
;
}
context
=
context_acquire
(
device
,
(
IWineD3DSurface
*
)
query
->
context
->
current_rt
,
CTXUSAGE_RESOURCELOAD
);
context
=
context_acquire
(
device
,
query
->
context
->
current_rt
,
CTXUSAGE_RESOURCELOAD
);
gl_info
=
context
->
gl_info
;
ENTER_GL
();
...
...
@@ -136,7 +136,7 @@ enum wined3d_event_query_result wined3d_event_query_finish(struct wined3d_event_
return
WINED3D_EVENT_QUERY_WRONG_THREAD
;
}
context
=
context_acquire
(
device
,
(
IWineD3DSurface
*
)
query
->
context
->
current_rt
,
CTXUSAGE_RESOURCELOAD
);
context
=
context_acquire
(
device
,
query
->
context
->
current_rt
,
CTXUSAGE_RESOURCELOAD
);
ENTER_GL
();
if
(
gl_info
->
supported
[
ARB_SYNC
])
...
...
@@ -195,7 +195,7 @@ void wined3d_event_query_issue(struct wined3d_event_query *query, IWineD3DDevice
}
else
{
context
=
context_acquire
(
device
,
(
IWineD3DSurface
*
)
query
->
context
->
current_rt
,
CTXUSAGE_RESOURCELOAD
);
context
=
context_acquire
(
device
,
query
->
context
->
current_rt
,
CTXUSAGE_RESOURCELOAD
);
}
}
else
...
...
@@ -348,7 +348,7 @@ static HRESULT WINAPI IWineD3DOcclusionQueryImpl_GetData(IWineD3DQuery* iface,
return
S_OK
;
}
context
=
context_acquire
(
This
->
device
,
(
IWineD3DSurface
*
)
query
->
context
->
current_rt
,
CTXUSAGE_RESOURCELOAD
);
context
=
context_acquire
(
This
->
device
,
query
->
context
->
current_rt
,
CTXUSAGE_RESOURCELOAD
);
ENTER_GL
();
...
...
@@ -490,8 +490,7 @@ static HRESULT WINAPI IWineD3DOcclusionQueryImpl_Issue(IWineD3DQuery* iface, D
}
else
{
context
=
context_acquire
(
This
->
device
,
(
IWineD3DSurface
*
)
query
->
context
->
current_rt
,
CTXUSAGE_RESOURCELOAD
);
context
=
context_acquire
(
This
->
device
,
query
->
context
->
current_rt
,
CTXUSAGE_RESOURCELOAD
);
ENTER_GL
();
GL_EXTCALL
(
glEndQueryARB
(
GL_SAMPLES_PASSED_ARB
));
...
...
@@ -526,8 +525,7 @@ static HRESULT WINAPI IWineD3DOcclusionQueryImpl_Issue(IWineD3DQuery* iface, D
}
else
{
context
=
context_acquire
(
This
->
device
,
(
IWineD3DSurface
*
)
query
->
context
->
current_rt
,
CTXUSAGE_RESOURCELOAD
);
context
=
context_acquire
(
This
->
device
,
query
->
context
->
current_rt
,
CTXUSAGE_RESOURCELOAD
);
ENTER_GL
();
GL_EXTCALL
(
glEndQueryARB
(
GL_SAMPLES_PASSED_ARB
));
...
...
dlls/wined3d/surface.c
View file @
6b34b8e6
...
...
@@ -1272,7 +1272,7 @@ static void read_from_framebuffer(IWineD3DSurfaceImpl *This, const RECT *rect, v
* should help here. Furthermore unlockrect will need the context set up for blitting. The context manager will find
* context->last_was_blit set on the unlock.
*/
context
=
context_acquire
(
device
,
(
IWineD3DSurface
*
)
This
,
CTXUSAGE_BLIT
);
context
=
context_acquire
(
device
,
This
,
CTXUSAGE_BLIT
);
gl_info
=
context
->
gl_info
;
ENTER_GL
();
...
...
@@ -1500,7 +1500,7 @@ static void read_from_framebuffer_texture(IWineD3DSurfaceImpl *This, BOOL srgb)
* locking during offscreen rendering). RESOURCELOAD is ok because glCopyTexSubImage2D isn't affected by any
* states in the stateblock, and no driver was found yet that had bugs in that regard.
*/
context
=
context_acquire
(
device
,
(
IWineD3DSurface
*
)
This
,
CTXUSAGE_RESOURCELOAD
);
context
=
context_acquire
(
device
,
This
,
CTXUSAGE_RESOURCELOAD
);
gl_info
=
context
->
gl_info
;
surface_bind_and_dirtify
(
This
,
srgb
);
...
...
@@ -1767,7 +1767,7 @@ static void flush_to_framebuffer_drawpixels(IWineD3DSurfaceImpl *This, GLenum fm
struct
wined3d_context
*
context
;
/* Activate the correct context for the render target */
context
=
context_acquire
(
device
,
(
IWineD3DSurface
*
)
This
,
CTXUSAGE_BLIT
);
context
=
context_acquire
(
device
,
This
,
CTXUSAGE_BLIT
);
gl_info
=
context
->
gl_info
;
ENTER_GL
();
...
...
@@ -2983,7 +2983,7 @@ static inline void fb_copy_to_texture_direct(IWineD3DSurfaceImpl *This, IWineD3D
upsidedown
=
TRUE
;
}
context
=
context_acquire
(
device
,
Src
Surface
,
CTXUSAGE_BLIT
);
context
=
context_acquire
(
device
,
Src
,
CTXUSAGE_BLIT
);
surface_internal_preload
((
IWineD3DSurface
*
)
This
,
SRGB_RGB
);
ENTER_GL
();
...
...
@@ -3089,7 +3089,7 @@ static inline void fb_copy_to_texture_hwstretch(IWineD3DSurfaceImpl *This, IWine
TRACE
(
"Using hwstretch blit
\n
"
);
/* Activate the Proper context for reading from the source surface, set it up for blitting */
context
=
context_acquire
(
device
,
Src
Surface
,
CTXUSAGE_BLIT
);
context
=
context_acquire
(
device
,
Src
,
CTXUSAGE_BLIT
);
surface_internal_preload
((
IWineD3DSurface
*
)
This
,
SRGB_RGB
);
src_offscreen
=
surface_is_offscreen
(
Src
);
...
...
@@ -3623,7 +3623,7 @@ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, const
surface_internal_preload
((
IWineD3DSurface
*
)
Src
,
SRGB_RGB
);
/* Activate the destination context, set it up for blitting */
context
=
context_acquire
(
device
,
(
IWineD3DSurface
*
)
This
,
CTXUSAGE_BLIT
);
context
=
context_acquire
(
device
,
This
,
CTXUSAGE_BLIT
);
/* The coordinates of the ddraw front buffer are always fullscreen ('screen coordinates',
* while OpenGL coordinates are window relative.
...
...
@@ -4262,7 +4262,7 @@ static inline void surface_blt_to_drawable(IWineD3DSurfaceImpl *This, const RECT
surface_get_rect
(
This
,
rect_in
,
&
src_rect
);
context
=
context_acquire
(
device
,
(
IWineD3DSurface
*
)
This
,
CTXUSAGE_BLIT
);
context
=
context_acquire
(
device
,
This
,
CTXUSAGE_BLIT
);
if
(
context
->
render_offscreen
)
{
dst_rect
.
left
=
src_rect
.
left
;
...
...
dlls/wined3d/swapchain.c
View file @
6b34b8e6
...
...
@@ -142,7 +142,7 @@ static void swapchain_blit(IWineD3DSwapChainImpl *This, struct wined3d_context *
float
tex_right
=
src_rect
->
right
;
float
tex_bottom
=
src_rect
->
bottom
;
context2
=
context_acquire
(
This
->
device
,
This
->
backBuffer
[
0
],
CTXUSAGE_BLIT
);
context2
=
context_acquire
(
This
->
device
,
(
IWineD3DSurfaceImpl
*
)
This
->
backBuffer
[
0
],
CTXUSAGE_BLIT
);
if
(
backbuffer
->
Flags
&
SFLAG_NORMCOORD
)
{
...
...
@@ -220,7 +220,7 @@ static HRESULT WINAPI IWineD3DSwapChainImpl_Present(IWineD3DSwapChain *iface, CO
IWineD3DSwapChain_SetDestWindowOverride
(
iface
,
hDestWindowOverride
);
context
=
context_acquire
(
This
->
device
,
This
->
backBuffer
[
0
],
CTXUSAGE_RESOURCELOAD
);
context
=
context_acquire
(
This
->
device
,
(
IWineD3DSurfaceImpl
*
)
This
->
backBuffer
[
0
],
CTXUSAGE_RESOURCELOAD
);
if
(
!
context
->
valid
)
{
context_release
(
context
);
...
...
dlls/wined3d/wined3d_private.h
View file @
6b34b8e6
...
...
@@ -1205,7 +1205,7 @@ typedef enum ContextUsage {
}
ContextUsage
;
struct
wined3d_context
*
context_acquire
(
IWineD3DDeviceImpl
*
This
,
IWineD3DSurface
*
target
,
enum
ContextUsage
usage
)
DECLSPEC_HIDDEN
;
IWineD3DSurface
Impl
*
target
,
enum
ContextUsage
usage
)
DECLSPEC_HIDDEN
;
void
context_alloc_event_query
(
struct
wined3d_context
*
context
,
struct
wined3d_event_query
*
query
)
DECLSPEC_HIDDEN
;
void
context_alloc_occlusion_query
(
struct
wined3d_context
*
context
,
...
...
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