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
a95524b8
Commit
a95524b8
authored
Feb 09, 2016
by
Henri Verbeet
Committed by
Alexandre Julliard
Feb 10, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Use wined3d_format_calculate_pitch() in surface_download_data().
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
a0beaa40
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
9 deletions
+7
-9
surface.c
dlls/wined3d/surface.c
+7
-9
No files found.
dlls/wined3d/surface.c
View file @
a95524b8
...
...
@@ -1329,19 +1329,17 @@ static void surface_download_data(struct wined3d_surface *surface, const struct
}
else
{
void
*
mem
;
unsigned
int
src_row_pitch
,
src_slice_pitch
,
dst_pitch
=
0
;
GLenum
gl_format
=
format
->
glFormat
;
GLenum
gl_type
=
format
->
glType
;
int
src_pitch
=
0
;
int
dst_pitch
=
0
;
void
*
mem
;
if
(
surface
->
flags
&
SFLAG_NONPOW2
)
{
unsigned
char
alignment
=
surface
->
resource
.
device
->
surface_alignment
;
src_pitch
=
format
->
byte_count
*
surface
->
pow2Width
;
dst_pitch
=
wined3d_surface_get_pitch
(
surface
);
src_pitch
=
(
src_pitch
+
alignment
-
1
)
&
~
(
alignment
-
1
);
mem
=
HeapAlloc
(
GetProcessHeap
(),
0
,
src_pitch
*
surface
->
pow2Height
);
wined3d_format_calculate_pitch
(
format
,
surface
->
resource
.
device
->
surface_alignment
,
surface
->
pow2Width
,
surface
->
pow2Height
,
&
src_row_pitch
,
&
src_slice_pitch
);
mem
=
HeapAlloc
(
GetProcessHeap
(),
0
,
src_slice_pitch
);
}
else
{
...
...
@@ -1426,11 +1424,11 @@ static void surface_download_data(struct wined3d_surface *surface, const struct
* won't be released, and doesn't have to be re-read. */
src_data
=
mem
;
dst_data
=
data
.
addr
;
TRACE
(
"
(%p) : Repacking the surface data from pitch %d to pitch %d
\n
"
,
surface
,
src
_pitch
,
dst_pitch
);
TRACE
(
"
Repacking the surface data from pitch %u to pitch %u.
\n
"
,
src_row
_pitch
,
dst_pitch
);
for
(
y
=
0
;
y
<
surface
->
resource
.
height
;
++
y
)
{
memcpy
(
dst_data
,
src_data
,
dst_pitch
);
src_data
+=
src_pitch
;
src_data
+=
src_
row_
pitch
;
dst_data
+=
dst_pitch
;
}
...
...
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