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
36187987
Commit
36187987
authored
Feb 02, 2016
by
Henri Verbeet
Committed by
Alexandre Julliard
Feb 03, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw: Use wined3d_resource_map() in surface_lock().
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
b922b551
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
32 additions
and
34 deletions
+32
-34
surface.c
dlls/ddraw/surface.c
+28
-29
surface.c
dlls/wined3d/surface.c
+2
-2
wined3d.spec
dlls/wined3d/wined3d.spec
+0
-1
wined3d_private.h
dlls/wined3d/wined3d_private.h
+2
-0
wined3d.h
include/wine/wined3d.h
+0
-2
No files found.
dlls/ddraw/surface.c
View file @
36187987
...
...
@@ -941,17 +941,17 @@ static HRESULT WINAPI ddraw_surface1_GetAttachedSurface(IDirectDrawSurface *ifac
* For more details, see IWineD3DSurface::LockRect
*
*****************************************************************************/
static
HRESULT
surface_lock
(
struct
ddraw_surface
*
This
,
RECT
*
Rect
,
DDSURFACEDESC2
*
DDSD
,
DWORD
F
lags
,
HANDLE
h
)
static
HRESULT
surface_lock
(
struct
ddraw_surface
*
surface
,
RECT
*
rect
,
DDSURFACEDESC2
*
surface_desc
,
DWORD
f
lags
,
HANDLE
h
)
{
struct
wined3d_box
box
;
struct
wined3d_map_desc
map_desc
;
HRESULT
hr
=
DD_OK
;
TRACE
(
"
This
%p, rect %s, surface_desc %p, flags %#x, h %p.
\n
"
,
This
,
wine_dbgstr_rect
(
Rect
),
DDSD
,
F
lags
,
h
);
TRACE
(
"
surface
%p, rect %s, surface_desc %p, flags %#x, h %p.
\n
"
,
surface
,
wine_dbgstr_rect
(
rect
),
surface_desc
,
f
lags
,
h
);
/*
This
->surface_desc.dwWidth and dwHeight are changeable, thus lock */
/*
surface
->surface_desc.dwWidth and dwHeight are changeable, thus lock */
wined3d_mutex_lock
();
/* Should I check for the handle to be NULL?
...
...
@@ -961,33 +961,31 @@ static HRESULT surface_lock(struct ddraw_surface *This,
*/
/* Windows zeroes this if the rect is invalid */
DDSD
->
lpSurface
=
0
;
surface_desc
->
lpSurface
=
NULL
;
if
(
R
ect
)
if
(
r
ect
)
{
if
((
Rect
->
left
<
0
)
||
(
Rect
->
top
<
0
)
||
(
Rect
->
left
>
Rect
->
right
)
||
(
Rect
->
top
>
Rect
->
bottom
)
||
(
Rect
->
right
>
This
->
surface_desc
.
dwWidth
)
||
(
Rect
->
bottom
>
This
->
surface_desc
.
dwHeight
))
if
((
rect
->
left
<
0
)
||
(
rect
->
top
<
0
)
||
(
rect
->
left
>
rect
->
right
)
||
(
rect
->
right
>
surface
->
surface_desc
.
dwWidth
)
||
(
rect
->
top
>
rect
->
bottom
)
||
(
rect
->
bottom
>
surface
->
surface_desc
.
dwHeight
))
{
WARN
(
"Trying to lock an invalid rectangle, returning DDERR_INVALIDPARAMS
\n
"
);
wined3d_mutex_unlock
();
return
DDERR_INVALIDPARAMS
;
}
box
.
left
=
R
ect
->
left
;
box
.
top
=
R
ect
->
top
;
box
.
right
=
R
ect
->
right
;
box
.
bottom
=
R
ect
->
bottom
;
box
.
left
=
r
ect
->
left
;
box
.
top
=
r
ect
->
top
;
box
.
right
=
r
ect
->
right
;
box
.
bottom
=
r
ect
->
bottom
;
box
.
front
=
0
;
box
.
back
=
1
;
}
if
(
This
->
surface_desc
.
ddsCaps
.
dwCaps
&
DDSCAPS_PRIMARYSURFACE
)
hr
=
ddraw_surface_update_frontbuffer
(
This
,
R
ect
,
TRUE
);
if
(
surface
->
surface_desc
.
ddsCaps
.
dwCaps
&
DDSCAPS_PRIMARYSURFACE
)
hr
=
ddraw_surface_update_frontbuffer
(
surface
,
r
ect
,
TRUE
);
if
(
SUCCEEDED
(
hr
))
hr
=
wined3d_surface_map
(
This
->
wined3d_surface
,
&
map_desc
,
Rect
?
&
box
:
NULL
,
Flags
);
hr
=
wined3d_resource_map
(
wined3d_texture_get_resource
(
surface
->
wined3d_texture
),
surface
->
sub_resource_idx
,
&
map_desc
,
rect
?
&
box
:
NULL
,
flags
);
if
(
FAILED
(
hr
))
{
wined3d_mutex_unlock
();
...
...
@@ -1004,22 +1002,23 @@ static HRESULT surface_lock(struct ddraw_surface *This,
}
}
if
(
This
->
surface_desc
.
ddsCaps
.
dwCaps
&
DDSCAPS_PRIMARYSURFACE
)
if
(
surface
->
surface_desc
.
ddsCaps
.
dwCaps
&
DDSCAPS_PRIMARYSURFACE
)
{
if
(
F
lags
&
DDLOCK_READONLY
)
memset
(
&
This
->
ddraw
->
primary_lock
,
0
,
sizeof
(
This
->
ddraw
->
primary_lock
));
else
if
(
R
ect
)
This
->
ddraw
->
primary_lock
=
*
R
ect
;
if
(
f
lags
&
DDLOCK_READONLY
)
memset
(
&
surface
->
ddraw
->
primary_lock
,
0
,
sizeof
(
surface
->
ddraw
->
primary_lock
));
else
if
(
r
ect
)
surface
->
ddraw
->
primary_lock
=
*
r
ect
;
else
SetRect
(
&
This
->
ddraw
->
primary_lock
,
0
,
0
,
This
->
surface_desc
.
dwWidth
,
This
->
surface_desc
.
dwHeight
);
SetRect
(
&
surface
->
ddraw
->
primary_lock
,
0
,
0
,
surface
->
surface_desc
.
dwWidth
,
surface
->
surface_desc
.
dwHeight
);
}
/* Windows does not set DDSD_LPSURFACE on locked surfaces. */
DD_STRUCT_COPY_BYSIZE
(
DDSD
,
&
(
This
->
surface_desc
)
);
DDSD
->
lpSurface
=
map_desc
.
data
;
DD_STRUCT_COPY_BYSIZE
(
surface_desc
,
&
surface
->
surface_desc
);
surface_desc
->
lpSurface
=
map_desc
.
data
;
TRACE
(
"locked surface returning description :
\n
"
);
if
(
TRACE_ON
(
ddraw
))
DDRAW_dump_surface_desc
(
DDSD
);
if
(
TRACE_ON
(
ddraw
))
DDRAW_dump_surface_desc
(
surface_desc
);
wined3d_mutex_unlock
();
...
...
dlls/wined3d/surface.c
View file @
36187987
...
...
@@ -2434,8 +2434,8 @@ HRESULT CDECL wined3d_surface_unmap(struct wined3d_surface *surface)
return
WINED3D_OK
;
}
HRESULT
CDECL
wined3d_surface_map
(
struct
wined3d_surface
*
surface
,
struct
wined3d_map_desc
*
map_desc
,
const
struct
wined3d_box
*
box
,
DWORD
flags
)
HRESULT
wined3d_surface_map
(
struct
wined3d_surface
*
surface
,
struct
wined3d_map_desc
*
map_desc
,
const
struct
wined3d_box
*
box
,
DWORD
flags
)
{
const
struct
wined3d_format
*
format
=
surface
->
resource
.
format
;
unsigned
int
fmt_flags
=
surface
->
container
->
resource
.
format_flags
;
...
...
dlls/wined3d/wined3d.spec
View file @
36187987
...
...
@@ -226,7 +226,6 @@
@ cdecl wined3d_surface_get_parent(ptr)
@ cdecl wined3d_surface_get_pitch(ptr)
@ cdecl wined3d_surface_get_resource(ptr)
@ cdecl wined3d_surface_map(ptr ptr ptr long)
@ cdecl wined3d_surface_set_overlay_position(ptr long long)
@ cdecl wined3d_surface_unmap(ptr)
@ cdecl wined3d_surface_update_overlay(ptr ptr ptr ptr long ptr)
...
...
dlls/wined3d/wined3d_private.h
View file @
36187987
...
...
@@ -2550,6 +2550,8 @@ void surface_load_fb_texture(struct wined3d_surface *surface, BOOL srgb,
struct
wined3d_context
*
context
)
DECLSPEC_HIDDEN
;
HRESULT
surface_load_location
(
struct
wined3d_surface
*
surface
,
struct
wined3d_context
*
context
,
DWORD
location
)
DECLSPEC_HIDDEN
;
HRESULT
wined3d_surface_map
(
struct
wined3d_surface
*
surface
,
struct
wined3d_map_desc
*
map_desc
,
const
struct
wined3d_box
*
box
,
DWORD
flags
)
DECLSPEC_HIDDEN
;
void
surface_modify_ds_location
(
struct
wined3d_surface
*
surface
,
DWORD
location
,
UINT
w
,
UINT
h
)
DECLSPEC_HIDDEN
;
void
wined3d_surface_prepare
(
struct
wined3d_surface
*
surface
,
struct
wined3d_context
*
context
,
DWORD
location
)
DECLSPEC_HIDDEN
;
...
...
include/wine/wined3d.h
View file @
36187987
...
...
@@ -2479,8 +2479,6 @@ HRESULT __cdecl wined3d_surface_get_overlay_position(const struct wined3d_surfac
void
*
__cdecl
wined3d_surface_get_parent
(
const
struct
wined3d_surface
*
surface
);
DWORD
__cdecl
wined3d_surface_get_pitch
(
const
struct
wined3d_surface
*
surface
);
struct
wined3d_resource
*
__cdecl
wined3d_surface_get_resource
(
struct
wined3d_surface
*
surface
);
HRESULT
__cdecl
wined3d_surface_map
(
struct
wined3d_surface
*
surface
,
struct
wined3d_map_desc
*
map_desc
,
const
struct
wined3d_box
*
box
,
DWORD
flags
);
HRESULT
__cdecl
wined3d_surface_set_overlay_position
(
struct
wined3d_surface
*
surface
,
LONG
x
,
LONG
y
);
HRESULT
__cdecl
wined3d_surface_unmap
(
struct
wined3d_surface
*
surface
);
HRESULT
__cdecl
wined3d_surface_update_overlay
(
struct
wined3d_surface
*
surface
,
const
RECT
*
src_rect
,
...
...
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