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
9c34f04e
Commit
9c34f04e
authored
May 13, 2003
by
Jason Edmeades
Committed by
Alexandre Julliard
May 13, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CopyRects needs to lock the area it is copying to (esp. if that area
is the back buffer, as locking/unlocking causes glread/draw pixels).
parent
6e0703d1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
1 deletion
+24
-1
device.c
dlls/d3d8/device.c
+24
-1
No files found.
dlls/d3d8/device.c
View file @
9c34f04e
...
...
@@ -1670,9 +1670,18 @@ HRESULT WINAPI IDirect3DDevice8Impl_CopyRects(LPDIRECT3DDEVICE8 iface, IDirect
if
(
rc
==
D3D_OK
&&
(
cRects
==
0
&&
pSourceRectsArray
==
NULL
&&
pDestPointsArray
==
NULL
&&
src
->
myDesc
.
Width
==
dst
->
myDesc
.
Width
&&
src
->
myDesc
.
Height
==
dst
->
myDesc
.
Height
))
{
TRACE
(
"Direct copy as surfaces are equal, w=%d, h=%d
\n
"
,
dst
->
myDesc
.
Width
,
dst
->
myDesc
.
Height
);
D3DLOCKED_RECT
lr
;
IDirect3DSurface8Impl_LockRect
((
LPDIRECT3DSURFACE8
)
src
,
&
lr
,
NULL
,
D3DLOCK_READONLY
);
IDirect3DSurface8Impl_LockRect
((
LPDIRECT3DSURFACE8
)
dst
,
&
lr
,
NULL
,
D3DLOCK_DISCARD
);
TRACE
(
"Locked src and dst, Direct copy as surfaces are equal, w=%d, h=%d
\n
"
,
dst
->
myDesc
.
Width
,
dst
->
myDesc
.
Height
);
memcpy
(
dst
->
allocatedMemory
,
src
->
allocatedMemory
,
src
->
myDesc
.
Size
);
IDirect3DSurface8Impl_UnlockRect
((
LPDIRECT3DSURFACE8
)
src
);
IDirect3DSurface8Impl_UnlockRect
((
LPDIRECT3DSURFACE8
)
dst
);
TRACE
(
"Unlocked src and dst
\n
"
);
}
else
{
int
i
;
int
bytesPerPixel
=
((
IDirect3DSurface8Impl
*
)
pSourceSurface
)
->
bytesPerPixel
;
...
...
@@ -1690,10 +1699,20 @@ HRESULT WINAPI IDirect3DDevice8Impl_CopyRects(LPDIRECT3DDEVICE8 iface, IDirect
char
*
to
;
int
copyperline
=
(
r
->
right
-
r
->
left
)
*
bytesPerPixel
;
int
j
;
D3DLOCKED_RECT
lr
;
RECT
dest_rect
;
TRACE
(
"Copying rect %d (%ld,%ld),(%ld,%ld) -> (%ld,%ld)
\n
"
,
i
,
r
->
left
,
r
->
top
,
r
->
right
,
r
->
bottom
,
p
->
x
,
p
->
y
);
IDirect3DSurface8Impl_LockRect
((
LPDIRECT3DSURFACE8
)
src
,
&
lr
,
r
,
D3DLOCK_READONLY
);
dest_rect
.
left
=
p
->
x
;
dest_rect
.
top
=
p
->
y
;
dest_rect
.
right
=
p
->
x
+
(
r
->
right
-
r
->
left
);
dest_rect
.
left
=
p
->
y
+
(
r
->
bottom
-
r
->
top
);
IDirect3DSurface8Impl_LockRect
((
LPDIRECT3DSURFACE8
)
dst
,
&
lr
,
&
dest_rect
,
0L
);
TRACE
(
"Locked src and dst
\n
"
);
/* Find where to start */
from
=
copyfrom
+
(
r
->
top
*
pitchFrom
)
+
(
r
->
left
*
bytesPerPixel
);
to
=
copyto
+
(
p
->
y
*
pitchTo
)
+
(
p
->
x
*
bytesPerPixel
);
...
...
@@ -1702,6 +1721,10 @@ HRESULT WINAPI IDirect3DDevice8Impl_CopyRects(LPDIRECT3DDEVICE8 iface, IDirect
for
(
j
=
0
;
j
<
(
r
->
bottom
-
r
->
top
);
j
++
)
{
memcpy
(
to
+
(
j
*
pitchTo
),
from
+
(
j
*
pitchFrom
),
copyperline
);
}
IDirect3DSurface8Impl_UnlockRect
((
LPDIRECT3DSURFACE8
)
src
);
IDirect3DSurface8Impl_UnlockRect
((
LPDIRECT3DSURFACE8
)
dst
);
TRACE
(
"Unlocked src and dst
\n
"
);
}
}
...
...
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