Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
c9eb05e5
Commit
c9eb05e5
authored
Jul 12, 2004
by
Lionel Ulmer
Committed by
Alexandre Julliard
Jul 12, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Better handle the frame-buffer locking case.
parent
907f85bb
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
0 deletions
+32
-0
mesa.c
dlls/ddraw/d3ddevice/mesa.c
+32
-0
No files found.
dlls/ddraw/d3ddevice/mesa.c
View file @
c9eb05e5
...
...
@@ -3607,6 +3607,11 @@ static void d3ddevice_lock_update(IDirectDrawSurfaceImpl* This, LPCRECT pRect, D
dst
=
((
char
*
)
This
->
surface_desc
.
lpSurface
)
+
(
pRect
->
top
*
This
->
surface_desc
.
u1
.
lPitch
)
+
(
pRect
->
left
*
GET_BPP
(
This
->
surface_desc
));
if
(
This
->
surface_desc
.
u1
.
lPitch
!=
(
GET_BPP
(
This
->
surface_desc
)
*
This
->
surface_desc
.
dwWidth
))
{
/* Slow-path in case of 'odd' surfaces. This could be fixed using some GL options, but I
* could not be bothered considering the rare cases where it may be useful :-)
*/
for
(
y
=
(
This
->
surface_desc
.
dwHeight
-
pRect
->
top
-
1
);
y
>=
((
int
)
This
->
surface_desc
.
dwHeight
-
(
int
)
pRect
->
bottom
);
y
--
)
{
...
...
@@ -3615,6 +3620,33 @@ static void d3ddevice_lock_update(IDirectDrawSurfaceImpl* This, LPCRECT pRect, D
buffer_color
,
buffer_format
,
dst
);
dst
+=
This
->
surface_desc
.
u1
.
lPitch
;
}
}
else
{
/* Faster path for surface copy. Note that I can use static variables here as I am
* protected by the OpenGL critical section so this function won't be called by
* two threads at the same time.
*/
static
char
*
buffer
=
NULL
;
static
int
buffer_width
=
0
;
char
*
dst2
=
dst
+
((
pRect
->
bottom
-
pRect
->
top
)
-
1
)
*
This
->
surface_desc
.
u1
.
lPitch
;
int
current_width
=
(
pRect
->
right
-
pRect
->
left
)
*
GET_BPP
(
This
->
surface_desc
);
glReadPixels
(
pRect
->
left
,
((
int
)
This
->
surface_desc
.
dwHeight
-
(
int
)
pRect
->
bottom
),
pRect
->
right
-
pRect
->
left
,
pRect
->
bottom
-
pRect
->
top
,
buffer_color
,
buffer_format
,
dst
);
if
(
current_width
>
buffer_width
)
{
if
(
buffer
!=
NULL
)
HeapFree
(
GetProcessHeap
(),
0
,
buffer
);
buffer_width
=
current_width
;
buffer
=
HeapAlloc
(
GetProcessHeap
(),
0
,
buffer_width
);
}
for
(
y
=
0
;
y
<
((
pRect
->
bottom
-
pRect
->
top
)
/
2
);
y
++
)
{
memcpy
(
buffer
,
dst
,
current_width
);
memcpy
(
dst
,
dst2
,
current_width
);
memcpy
(
dst2
,
buffer
,
current_width
);
dst
+=
This
->
surface_desc
.
u1
.
lPitch
;
dst2
-=
This
->
surface_desc
.
u1
.
lPitch
;
}
}
gl_d3d_dev
->
state
[
buffer_type
]
=
SURFACE_MEMORY
;
...
...
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