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
d3936190
Commit
d3936190
authored
Feb 12, 2016
by
Henri Verbeet
Committed by
Alexandre Julliard
Feb 12, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Use wined3d_texture_get_pitch() in read_from_framebuffer().
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
6509f90e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
12 deletions
+13
-12
surface.c
dlls/wined3d/surface.c
+13
-12
No files found.
dlls/wined3d/surface.c
View file @
d3936190
...
...
@@ -2467,6 +2467,7 @@ static void read_from_framebuffer(struct wined3d_surface *surface,
const
struct
wined3d_gl_info
*
gl_info
;
struct
wined3d_context
*
context
=
old_ctx
;
struct
wined3d_surface
*
restore_rt
=
NULL
;
unsigned
int
row_pitch
,
slice_pitch
;
BYTE
*
mem
;
BYTE
*
row
,
*
top
,
*
bottom
;
int
i
;
...
...
@@ -2512,9 +2513,10 @@ static void read_from_framebuffer(struct wined3d_surface *surface,
checkGLcall
(
"glBindBuffer"
);
}
wined3d_texture_get_pitch
(
surface
->
container
,
surface
->
texture_level
,
&
row_pitch
,
&
slice_pitch
);
/* Setup pixel store pack state -- to glReadPixels into the correct place */
gl_info
->
gl_ops
.
gl
.
p_glPixelStorei
(
GL_PACK_ROW_LENGTH
,
wined3d_surface_get_pitch
(
surface
)
/
surface
->
resource
.
format
->
byte_count
);
gl_info
->
gl_ops
.
gl
.
p_glPixelStorei
(
GL_PACK_ROW_LENGTH
,
row_pitch
/
surface
->
resource
.
format
->
byte_count
);
checkGLcall
(
"glPixelStorei"
);
gl_info
->
gl_ops
.
gl
.
p_glReadPixels
(
0
,
0
,
...
...
@@ -2529,11 +2531,10 @@ static void read_from_framebuffer(struct wined3d_surface *surface,
if
(
!
srcIsUpsideDown
)
{
/* glReadPixels returns the image upside down, and there is no way to prevent this.
* Flip the lines in software. */
UINT
pitch
=
wined3d_surface_get_pitch
(
surface
);
/* glReadPixels returns the image upside down, and there is no way to
* prevent this. Flip the lines in software. */
if
(
!
(
row
=
HeapAlloc
(
GetProcessHeap
(),
0
,
pitch
)))
if
(
!
(
row
=
HeapAlloc
(
GetProcessHeap
(),
0
,
row_
pitch
)))
goto
error
;
if
(
data
.
buffer_object
)
...
...
@@ -2545,14 +2546,14 @@ static void read_from_framebuffer(struct wined3d_surface *surface,
mem
=
data
.
addr
;
top
=
mem
;
bottom
=
mem
+
pitch
*
(
surface
->
resource
.
height
-
1
);
bottom
=
mem
+
row_
pitch
*
(
surface
->
resource
.
height
-
1
);
for
(
i
=
0
;
i
<
surface
->
resource
.
height
/
2
;
i
++
)
{
memcpy
(
row
,
top
,
pitch
);
memcpy
(
top
,
bottom
,
pitch
);
memcpy
(
bottom
,
row
,
pitch
);
top
+=
pitch
;
bottom
-=
pitch
;
memcpy
(
row
,
top
,
row_
pitch
);
memcpy
(
top
,
bottom
,
row_
pitch
);
memcpy
(
bottom
,
row
,
row_
pitch
);
top
+=
row_
pitch
;
bottom
-=
row_
pitch
;
}
HeapFree
(
GetProcessHeap
(),
0
,
row
);
...
...
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