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
6e5fa922
Commit
6e5fa922
authored
Feb 12, 2016
by
Henri Verbeet
Committed by
Alexandre Julliard
Feb 12, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw: Use wined3d_texture_get_pitch() in ddraw_surface_init().
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
f8c858c3
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
12 additions
and
30 deletions
+12
-30
ddraw.c
dlls/ddraw/ddraw.c
+1
-1
ddraw_private.h
dlls/ddraw/ddraw_private.h
+1
-1
surface.c
dlls/ddraw/surface.c
+6
-8
surface.c
dlls/wined3d/surface.c
+0
-13
texture.c
dlls/wined3d/texture.c
+1
-1
wined3d.spec
dlls/wined3d/wined3d.spec
+1
-2
wined3d_private.h
dlls/wined3d/wined3d_private.h
+0
-2
wined3d.h
include/wine/wined3d.h
+2
-2
No files found.
dlls/ddraw/ddraw.c
View file @
6e5fa922
...
...
@@ -4774,7 +4774,7 @@ static HRESULT CDECL device_parent_surface_created(struct wined3d_device_parent
return
DDERR_OUTOFVIDEOMEMORY
;
}
ddraw_surface_init
(
ddraw_surface
,
ddraw
,
wined3d_texture
,
sub_resource_idx
,
surface
,
parent_ops
);
ddraw_surface_init
(
ddraw_surface
,
ddraw
,
wined3d_texture
,
sub_resource_idx
,
parent_ops
);
*
parent
=
ddraw_surface
;
ddraw_update_lost_surfaces
(
ddraw
);
...
...
dlls/ddraw/ddraw_private.h
View file @
6e5fa922
...
...
@@ -213,7 +213,7 @@ HRESULT ddraw_surface_create(struct ddraw *ddraw, const DDSURFACEDESC2 *surface_
struct
wined3d_rendertarget_view
*
ddraw_surface_get_rendertarget_view
(
struct
ddraw_surface
*
surface
)
DECLSPEC_HIDDEN
;
void
ddraw_surface_init
(
struct
ddraw_surface
*
surface
,
struct
ddraw
*
ddraw
,
struct
wined3d_texture
*
wined3d_texture
,
unsigned
int
sub_resource_idx
,
struct
wined3d_surface
*
wined3d_surface
,
const
struct
wined3d_parent_ops
**
parent_ops
)
DECLSPEC_HIDDEN
;
const
struct
wined3d_parent_ops
**
parent_ops
)
DECLSPEC_HIDDEN
;
ULONG
ddraw_surface_release_iface
(
struct
ddraw_surface
*
This
)
DECLSPEC_HIDDEN
;
HRESULT
ddraw_surface_update_frontbuffer
(
struct
ddraw_surface
*
surface
,
const
RECT
*
rect
,
BOOL
read
)
DECLSPEC_HIDDEN
;
...
...
dlls/ddraw/surface.c
View file @
6e5fa922
...
...
@@ -6253,9 +6253,10 @@ fail:
void
ddraw_surface_init
(
struct
ddraw_surface
*
surface
,
struct
ddraw
*
ddraw
,
struct
wined3d_texture
*
wined3d_texture
,
unsigned
int
sub_resource_idx
,
struct
wined3d_surface
*
wined3d_surface
,
const
struct
wined3d_parent_ops
**
parent_ops
)
const
struct
wined3d_parent_ops
**
parent_ops
)
{
struct
ddraw_texture
*
texture
=
wined3d_texture_get_parent
(
wined3d_texture
);
unsigned
int
texture_level
,
row_pitch
,
slice_pitch
;
DDSURFACEDESC2
*
desc
=
&
surface
->
surface_desc
;
unsigned
int
version
=
texture
->
version
;
...
...
@@ -6290,24 +6291,21 @@ void ddraw_surface_init(struct ddraw_surface *surface, struct ddraw *ddraw,
*
desc
=
texture
->
surface_desc
;
surface
->
first_attached
=
surface
;
texture_level
=
desc
->
ddsCaps
.
dwCaps
&
DDSCAPS_MIPMAP
?
sub_resource_idx
%
desc
->
u2
.
dwMipMapCount
:
0
;
wined3d_texture_get_pitch
(
wined3d_texture
,
texture_level
,
&
row_pitch
,
&
slice_pitch
);
if
(
format_is_compressed
(
&
desc
->
u4
.
ddpfPixelFormat
))
{
unsigned
int
texture_level
,
row_pitch
;
texture_level
=
desc
->
ddsCaps
.
dwCaps
&
DDSCAPS_MIPMAP
?
sub_resource_idx
%
desc
->
u2
.
dwMipMapCount
:
0
;
row_pitch
=
wined3d_surface_get_pitch
(
wined3d_surface
);
if
(
desc
->
dwFlags
&
DDSD_LPSURFACE
)
desc
->
u1
.
dwLinearSize
=
~
0u
;
else
desc
->
u1
.
dwLinearSize
=
row_pitch
*
((
max
(
1
,
desc
->
dwHeight
>>
texture_level
)
+
3
)
/
4
)
;
desc
->
u1
.
dwLinearSize
=
slice_pitch
;
desc
->
dwFlags
|=
DDSD_LINEARSIZE
;
desc
->
dwFlags
&=
~
(
DDSD_LPSURFACE
|
DDSD_PITCH
);
}
else
{
if
(
!
(
desc
->
dwFlags
&
DDSD_LPSURFACE
))
desc
->
u1
.
lPitch
=
wined3d_surface_get_pitch
(
wined3d_surface
)
;
desc
->
u1
.
lPitch
=
row_pitch
;
desc
->
dwFlags
|=
DDSD_PITCH
;
desc
->
dwFlags
&=
~
(
DDSD_LPSURFACE
|
DDSD_LINEARSIZE
);
}
...
...
dlls/wined3d/surface.c
View file @
6e5fa922
...
...
@@ -1883,19 +1883,6 @@ static inline unsigned short float_32_to_16(const float *in)
return
ret
;
}
DWORD
CDECL
wined3d_surface_get_pitch
(
const
struct
wined3d_surface
*
surface
)
{
unsigned
int
row_pitch
,
slice_pitch
;
TRACE
(
"surface %p.
\n
"
,
surface
);
wined3d_texture_get_pitch
(
surface
->
container
,
surface
->
texture_level
,
&
row_pitch
,
&
slice_pitch
);
TRACE
(
"Returning %u.
\n
"
,
row_pitch
);
return
row_pitch
;
}
HRESULT
wined3d_surface_update_desc
(
struct
wined3d_surface
*
surface
,
const
struct
wined3d_gl_info
*
gl_info
)
{
struct
wined3d_resource
*
texture_resource
=
&
surface
->
container
->
resource
;
...
...
dlls/wined3d/texture.c
View file @
6e5fa922
...
...
@@ -499,7 +499,7 @@ void * CDECL wined3d_texture_get_parent(const struct wined3d_texture *texture)
return
texture
->
resource
.
parent
;
}
void
wined3d_texture_get_pitch
(
const
struct
wined3d_texture
*
texture
,
void
CDECL
wined3d_texture_get_pitch
(
const
struct
wined3d_texture
*
texture
,
unsigned
int
level
,
unsigned
int
*
row_pitch
,
unsigned
int
*
slice_pitch
)
{
const
struct
wined3d_resource
*
resource
=
&
texture
->
resource
;
...
...
dlls/wined3d/wined3d.spec
View file @
6e5fa922
...
...
@@ -220,8 +220,6 @@
@ cdecl wined3d_stateblock_decref(ptr)
@ cdecl wined3d_stateblock_incref(ptr)
@ cdecl wined3d_surface_get_pitch(ptr)
@ cdecl wined3d_swapchain_create(ptr ptr ptr ptr ptr)
@ cdecl wined3d_swapchain_decref(ptr)
@ cdecl wined3d_swapchain_get_back_buffer(ptr long)
...
...
@@ -250,6 +248,7 @@
@ cdecl wined3d_texture_get_lod(ptr)
@ cdecl wined3d_texture_get_overlay_position(ptr long ptr ptr)
@ cdecl wined3d_texture_get_parent(ptr)
@ cdecl wined3d_texture_get_pitch(ptr long ptr ptr)
@ cdecl wined3d_texture_get_resource(ptr)
@ cdecl wined3d_texture_get_sub_resource(ptr long)
@ cdecl wined3d_texture_incref(ptr)
...
...
dlls/wined3d/wined3d_private.h
View file @
6e5fa922
...
...
@@ -2402,8 +2402,6 @@ void wined3d_texture_bind(struct wined3d_texture *texture,
void
wined3d_texture_bind_and_dirtify
(
struct
wined3d_texture
*
texture
,
struct
wined3d_context
*
context
,
BOOL
srgb
)
DECLSPEC_HIDDEN
;
void
wined3d_texture_force_reload
(
struct
wined3d_texture
*
texture
)
DECLSPEC_HIDDEN
;
void
wined3d_texture_get_pitch
(
const
struct
wined3d_texture
*
texture
,
unsigned
int
level
,
unsigned
int
*
row_pitch
,
unsigned
int
*
slice_pitch
)
DECLSPEC_HIDDEN
;
void
wined3d_texture_load
(
struct
wined3d_texture
*
texture
,
struct
wined3d_context
*
context
,
BOOL
srgb
)
DECLSPEC_HIDDEN
;
void
wined3d_texture_prepare_texture
(
struct
wined3d_texture
*
texture
,
...
...
include/wine/wined3d.h
View file @
6e5fa922
...
...
@@ -2479,8 +2479,6 @@ HRESULT __cdecl wined3d_stateblock_create(struct wined3d_device *device,
ULONG
__cdecl
wined3d_stateblock_decref
(
struct
wined3d_stateblock
*
stateblock
);
ULONG
__cdecl
wined3d_stateblock_incref
(
struct
wined3d_stateblock
*
stateblock
);
DWORD
__cdecl
wined3d_surface_get_pitch
(
const
struct
wined3d_surface
*
surface
);
HRESULT
__cdecl
wined3d_swapchain_create
(
struct
wined3d_device
*
device
,
struct
wined3d_swapchain_desc
*
desc
,
void
*
parent
,
const
struct
wined3d_parent_ops
*
parent_ops
,
struct
wined3d_swapchain
**
swapchain
);
ULONG
__cdecl
wined3d_swapchain_decref
(
struct
wined3d_swapchain
*
swapchain
);
...
...
@@ -2527,6 +2525,8 @@ DWORD __cdecl wined3d_texture_get_lod(const struct wined3d_texture *texture);
HRESULT
__cdecl
wined3d_texture_get_overlay_position
(
const
struct
wined3d_texture
*
texture
,
unsigned
int
sub_resource_idx
,
LONG
*
x
,
LONG
*
y
);
void
*
__cdecl
wined3d_texture_get_parent
(
const
struct
wined3d_texture
*
texture
);
void
__cdecl
wined3d_texture_get_pitch
(
const
struct
wined3d_texture
*
texture
,
unsigned
int
level
,
unsigned
int
*
row_pitch
,
unsigned
int
*
slice_pitch
);
struct
wined3d_resource
*
__cdecl
wined3d_texture_get_resource
(
struct
wined3d_texture
*
texture
);
struct
wined3d_resource
*
__cdecl
wined3d_texture_get_sub_resource
(
const
struct
wined3d_texture
*
texture
,
UINT
sub_resource_idx
);
...
...
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