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
4de77fa2
Commit
4de77fa2
authored
Jun 14, 2013
by
Henri Verbeet
Committed by
Alexandre Julliard
Jun 14, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Allow a custom pitch to be specified in wined3d_surface_set_mem().
parent
aa0cc00b
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
26 additions
and
12 deletions
+26
-12
device.c
dlls/d3d9/device.c
+1
-1
surface.c
dlls/ddraw/surface.c
+13
-5
surface.c
dlls/wined3d/surface.c
+7
-2
wined3d.spec
dlls/wined3d/wined3d.spec
+1
-1
wined3d_private.h
dlls/wined3d/wined3d_private.h
+3
-2
wined3d.h
include/wine/wined3d.h
+1
-1
No files found.
dlls/d3d9/device.c
View file @
4de77fa2
...
...
@@ -766,7 +766,7 @@ static HRESULT WINAPI d3d9_device_CreateTexture(IDirect3DDevice9Ex *iface,
resource
=
wined3d_texture_get_sub_resource
(
object
->
wined3d_texture
,
0
);
surface
=
wined3d_resource_get_parent
(
resource
);
wined3d_surface_set_mem
(
surface
->
wined3d_surface
,
*
shared_handle
);
wined3d_surface_set_mem
(
surface
->
wined3d_surface
,
*
shared_handle
,
0
);
}
TRACE
(
"Created texture %p.
\n
"
,
object
);
...
...
dlls/ddraw/surface.c
View file @
4de77fa2
...
...
@@ -4233,7 +4233,7 @@ static HRESULT WINAPI ddraw_surface7_SetSurfaceDesc(IDirectDrawSurface7 *iface,
|
DDSD_HEIGHT
|
DDSD_PITCH
|
DDSD_CAPS
;
enum
wined3d_format_id
format_id
;
BOOL
update_wined3d
=
FALSE
;
UINT
width
,
height
;
UINT
pitch
,
width
,
height
;
TRACE
(
"iface %p, surface_desc %p, flags %#x.
\n
"
,
iface
,
DDSD
,
Flags
);
...
...
@@ -4293,6 +4293,7 @@ static HRESULT WINAPI ddraw_surface7_SetSurfaceDesc(IDirectDrawSurface7 *iface,
TRACE
(
"Surface pitch changed from %u to %u.
\n
"
,
This
->
surface_desc
.
u1
.
lPitch
,
DDSD
->
u1
.
lPitch
);
update_wined3d
=
TRUE
;
}
pitch
=
DDSD
->
u1
.
lPitch
;
width
=
DDSD
->
dwWidth
;
}
else
if
(
DDSD
->
dwFlags
&
DDSD_PITCH
)
...
...
@@ -4302,6 +4303,7 @@ static HRESULT WINAPI ddraw_surface7_SetSurfaceDesc(IDirectDrawSurface7 *iface,
}
else
{
pitch
=
This
->
surface_desc
.
u1
.
lPitch
;
width
=
This
->
surface_desc
.
dwWidth
;
}
...
...
@@ -4370,8 +4372,7 @@ static HRESULT WINAPI ddraw_surface7_SetSurfaceDesc(IDirectDrawSurface7 *iface,
if
(
DDSD
->
dwFlags
&
DDSD_LPSURFACE
&&
DDSD
->
lpSurface
)
{
hr
=
wined3d_surface_set_mem
(
This
->
wined3d_surface
,
DDSD
->
lpSurface
);
if
(
FAILED
(
hr
))
if
(
FAILED
(
hr
=
wined3d_surface_set_mem
(
This
->
wined3d_surface
,
DDSD
->
lpSurface
,
pitch
)))
{
/* No need for a trace here, wined3d does that for us */
switch
(
hr
)
...
...
@@ -5843,8 +5844,15 @@ HRESULT ddraw_surface_init(struct ddraw_surface *surface, struct ddraw *ddraw,
}
if
(
desc
->
dwFlags
&
DDSD_LPSURFACE
)
{
hr
=
wined3d_surface_set_mem
(
surface
->
wined3d_surface
,
desc
->
lpSurface
);
if
(
FAILED
(
hr
))
UINT
pitch
=
0
;
if
(
desc
->
dwFlags
&
DDSD_PITCH
)
{
pitch
=
desc
->
u1
.
lPitch
;
surface
->
surface_desc
.
u1
.
lPitch
=
pitch
;
}
if
(
FAILED
(
hr
=
wined3d_surface_set_mem
(
surface
->
wined3d_surface
,
desc
->
lpSurface
,
pitch
)))
{
ERR
(
"Failed to set surface memory, hr %#x.
\n
"
,
hr
);
wined3d_surface_decref
(
surface
->
wined3d_surface
);
...
...
dlls/wined3d/surface.c
View file @
4de77fa2
...
...
@@ -101,7 +101,7 @@ static void surface_cleanup(struct wined3d_surface *surface)
}
if
(
surface
->
flags
&
SFLAG_USERPTR
)
wined3d_surface_set_mem
(
surface
,
NULL
);
wined3d_surface_set_mem
(
surface
,
NULL
,
0
);
if
(
surface
->
overlay_dest
)
list_remove
(
&
surface
->
overlay_entry
);
...
...
@@ -3202,6 +3202,9 @@ DWORD CDECL wined3d_surface_get_pitch(const struct wined3d_surface *surface)
TRACE
(
"surface %p.
\n
"
,
surface
);
if
(
surface
->
pitch
)
return
surface
->
pitch
;
if
(
format
->
flags
&
WINED3DFMT_FLAG_BLOCKS
)
{
/* Since compressed formats are block based, pitch means the amount of
...
...
@@ -3221,7 +3224,7 @@ DWORD CDECL wined3d_surface_get_pitch(const struct wined3d_surface *surface)
return
pitch
;
}
HRESULT
CDECL
wined3d_surface_set_mem
(
struct
wined3d_surface
*
surface
,
void
*
mem
)
HRESULT
CDECL
wined3d_surface_set_mem
(
struct
wined3d_surface
*
surface
,
void
*
mem
,
UINT
pitch
)
{
TRACE
(
"surface %p, mem %p.
\n
"
,
surface
,
mem
);
...
...
@@ -3290,6 +3293,8 @@ HRESULT CDECL wined3d_surface_set_mem(struct wined3d_surface *surface, void *mem
surface_modify_location
(
surface
,
SFLAG_INSYSMEM
,
TRUE
);
}
surface
->
pitch
=
pitch
;
return
WINED3D_OK
;
}
...
...
dlls/wined3d/wined3d.spec
View file @
4de77fa2
...
...
@@ -226,7 +226,7 @@
@ cdecl wined3d_surface_releasedc(ptr ptr)
@ cdecl wined3d_surface_restore(ptr)
@ cdecl wined3d_surface_set_color_key(ptr long ptr)
@ cdecl wined3d_surface_set_mem(ptr ptr)
@ cdecl wined3d_surface_set_mem(ptr ptr
long
)
@ cdecl wined3d_surface_set_overlay_position(ptr long long)
@ cdecl wined3d_surface_set_palette(ptr ptr)
@ cdecl wined3d_surface_set_priority(ptr long)
...
...
dlls/wined3d/wined3d_private.h
View file @
4de77fa2
...
...
@@ -2095,8 +2095,9 @@ struct wined3d_surface
DWORD
flags
;
UINT
pow2Width
;
UINT
pow2Height
;
UINT
pitch
;
UINT
pow2Width
;
UINT
pow2Height
;
/* A method to retrieve the drawable size. Not in the Vtable to make it changeable */
void
(
*
get_drawable_size
)(
const
struct
wined3d_context
*
context
,
UINT
*
width
,
UINT
*
height
);
...
...
include/wine/wined3d.h
View file @
4de77fa2
...
...
@@ -2332,7 +2332,7 @@ HRESULT __cdecl wined3d_surface_releasedc(struct wined3d_surface *surface, HDC d
HRESULT
__cdecl
wined3d_surface_restore
(
struct
wined3d_surface
*
surface
);
HRESULT
__cdecl
wined3d_surface_set_color_key
(
struct
wined3d_surface
*
surface
,
DWORD
flags
,
const
struct
wined3d_color_key
*
color_key
);
HRESULT
__cdecl
wined3d_surface_set_mem
(
struct
wined3d_surface
*
surface
,
void
*
mem
);
HRESULT
__cdecl
wined3d_surface_set_mem
(
struct
wined3d_surface
*
surface
,
void
*
mem
,
UINT
pitch
);
HRESULT
__cdecl
wined3d_surface_set_overlay_position
(
struct
wined3d_surface
*
surface
,
LONG
x
,
LONG
y
);
void
__cdecl
wined3d_surface_set_palette
(
struct
wined3d_surface
*
surface
,
struct
wined3d_palette
*
palette
);
DWORD
__cdecl
wined3d_surface_set_priority
(
struct
wined3d_surface
*
surface
,
DWORD
new_priority
);
...
...
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