Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Fotios Valasiadis
wine
Commits
7d70fe5a
Commit
7d70fe5a
authored
26 years ago
by
Lionel Ulmer
Committed by
Alexandre Julliard
26 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Corrected bug in DirectDrawSurface creation and handling for driver
based upon Xlilb.
parent
9f984ce7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
AUTHORS
+1
-0
1 addition, 0 deletions
AUTHORS
graphics/ddraw.c
+79
-45
79 additions, 45 deletions
graphics/ddraw.c
include/authors.h
+1
-0
1 addition, 0 deletions
include/authors.h
include/ddraw.h
+1
-0
1 addition, 0 deletions
include/ddraw.h
with
82 additions
and
45 deletions
AUTHORS
+
1
−
0
View file @
7d70fe5a
...
...
@@ -132,6 +132,7 @@ Jon Tombs,
Linus Torvalds,
Gregory Trubetskoy,
Petri Tuomola,
Lionel Ulmer,
Michael Veksler,
Sven Verdoolaege,
Ronan Waide,
...
...
This diff is collapsed.
Click to expand it.
graphics/ddraw.c
+
79
−
45
View file @
7d70fe5a
...
...
@@ -337,23 +337,23 @@ static HRESULT WINAPI DGA_IDirectDrawSurface3_Unlock(
}
static
HRESULT
WINAPI
Xlib_IDirectDrawSurface3_Unlock
(
LPDIRECTDRAWSURFACE3
this
,
LPVOID
surface
)
{
LPDIRECTDRAWSURFACE3
this
,
LPVOID
surface
)
{
TRACE
(
ddraw
,
"(%p)->Unlock(%p)
\n
"
,
this
,
surface
);
if
(
!
this
->
s
.
ddraw
->
e
.
xlib
.
paintable
)
{
return
DD_OK
;
}
/* Only redraw the screen when unlocking the buffer that is on screen */
if
((
this
->
t
.
xlib
.
image
!=
NULL
)
&&
(
this
->
t
.
xlib
.
on_screen
))
TSXPutImage
(
display
,
this
->
s
.
ddraw
->
e
.
xlib
.
drawable
,
DefaultGCOfScreen
(
screen
),
this
->
t
.
xlib
.
image
,
0
,
0
,
0
,
0
,
this
->
t
.
xlib
.
image
->
width
,
this
->
t
.
xlib
.
image
->
height
);
this
->
t
.
xlib
.
image
->
height
);
if
(
this
->
s
.
palette
&&
this
->
s
.
palette
->
cm
)
TSXSetWindowColormap
(
display
,
this
->
s
.
ddraw
->
e
.
xlib
.
drawable
,
this
->
s
.
palette
->
cm
);
...
...
@@ -427,6 +427,9 @@ static HRESULT WINAPI Xlib_IDirectDrawSurface3_Flip(
surf
=
this
->
s
.
surface
;
this
->
s
.
surface
=
flipto
->
s
.
surface
;
flipto
->
s
.
surface
=
surf
;
flipto
->
t
.
xlib
.
on_screen
=
TRUE
;
this
->
t
.
xlib
.
on_screen
=
FALSE
;
}
return
0
;
}
...
...
@@ -506,6 +509,15 @@ static HRESULT WINAPI IDirectDrawSurface3_Blt(
RECT32
xdst
,
xsrc
;
int
i
,
j
;
TRACE
(
ddraw
,
"(%p)->(%p,%p,%p,%08lx,%p)
\n
"
,
this
,
rdst
,
src
,
rsrc
,
dwFlags
,
lpbltfx
);
if
(
rdst
)
TRACE
(
ddraw
,
" destrect :%dx%d-%dx%d
\n
"
,
rdst
->
left
,
rdst
->
top
,
rdst
->
right
,
rdst
->
bottom
);
if
(
rsrc
)
TRACE
(
ddraw
,
" srcrect :%dx%d-%dx%d
\n
"
,
rsrc
->
left
,
rsrc
->
top
,
rsrc
->
right
,
rsrc
->
bottom
);
TRACE
(
ddraw
,
"
\t
flags: "
);
_dump_DDBLT
(
dwFlags
);
fprintf
(
stderr
,
"
\n
"
);
if
(
dwFlags
&
DDBLT_DDFX
)
{
TRACE
(
ddraw
,
" blitfx:
\n
"
);
_dump_DDBLTFX
(
lpbltfx
->
dwDDFX
);
}
if
(
rdst
)
{
memcpy
(
&
xdst
,
rdst
,
sizeof
(
xdst
));
}
else
{
...
...
@@ -570,20 +582,38 @@ static HRESULT WINAPI IDirectDrawSurface3_Blt(
}
if
(
dwFlags
)
{
FIXME
(
ddraw
,
"(%p)->(%p,%p,%p,%08lx,%p),stub!
\n
"
,
this
,
rdst
,
src
,
rsrc
,
dwFlags
,
lpbltfx
);
if
(
rdst
)
TRACE
(
ddraw
,
" destrect :%dx%d-%dx%d
\n
"
,
rdst
->
left
,
rdst
->
top
,
rdst
->
right
,
rdst
->
bottom
);
if
(
rsrc
)
TRACE
(
ddraw
,
" srcrect :%dx%d-%dx%d
\n
"
,
rsrc
->
left
,
rsrc
->
top
,
rsrc
->
right
,
rsrc
->
bottom
);
TRACE
(
ddraw
,
"
\t
flags: "
);
_dump_DDBLT
(
dwFlags
);
fprintf
(
stderr
,
"
\n
"
);
}
if
(
dwFlags
&
DDBLT_DDFX
)
{
TRACE
(
ddraw
,
" blitfx:
\n
"
);
_dump_DDBLTFX
(
lpbltfx
->
dwDDFX
);
TRACE
(
ddraw
,
"
\t
Unsupported flags: "
);
_dump_DDBLT
(
dwFlags
);
fprintf
(
stderr
,
"
\n
"
);
}
return
0
;
}
static
HRESULT
WINAPI
Xlib_IDirectDrawSurface3_Blt
(
LPDIRECTDRAWSURFACE3
this
,
LPRECT32
rdst
,
LPDIRECTDRAWSURFACE3
src
,
LPRECT32
rsrc
,
DWORD
dwFlags
,
LPDDBLTFX
lpbltfx
)
{
HRESULT
ret
;
/* First, call the "common" blit function */
ret
=
IDirectDrawSurface3_Blt
(
this
,
rdst
,
src
,
rsrc
,
dwFlags
,
lpbltfx
);
/* Then put the result on screen if blited on main screen buffer */
if
(
!
this
->
s
.
ddraw
->
e
.
xlib
.
paintable
)
return
ret
;
if
((
this
->
t
.
xlib
.
image
!=
NULL
)
&&
(
this
->
t
.
xlib
.
on_screen
))
TSXPutImage
(
display
,
this
->
s
.
ddraw
->
e
.
xlib
.
drawable
,
DefaultGCOfScreen
(
screen
),
this
->
t
.
xlib
.
image
,
0
,
0
,
0
,
0
,
this
->
t
.
xlib
.
image
->
width
,
this
->
t
.
xlib
.
image
->
height
);
if
(
this
->
s
.
palette
&&
this
->
s
.
palette
->
cm
)
TSXSetWindowColormap
(
display
,
this
->
s
.
ddraw
->
e
.
xlib
.
drawable
,
this
->
s
.
palette
->
cm
);
return
ret
;
}
static
HRESULT
WINAPI
IDirectDrawSurface3_BltFast
(
LPDIRECTDRAWSURFACE3
this
,
DWORD
dstx
,
DWORD
dsty
,
LPDIRECTDRAWSURFACE3
src
,
LPRECT32
rsrc
,
DWORD
trans
)
{
...
...
@@ -683,9 +713,11 @@ static ULONG WINAPI Xlib_IDirectDrawSurface3_Release(LPDIRECTDRAWSURFACE3 this)
this
->
s
.
backbuffer
->
lpvtbl
->
fnRelease
(
this
->
s
.
backbuffer
);
}
if
(
this
->
t
.
xlib
.
image
!=
NULL
)
{
this
->
t
.
xlib
.
image
->
data
=
NULL
;
TSXDestroyImage
(
this
->
t
.
xlib
.
image
);
this
->
t
.
xlib
.
image
=
0
;
}
if
(
this
->
s
.
palette
)
this
->
s
.
palette
->
lpvtbl
->
fnRelease
(
this
->
s
.
palette
);
...
...
@@ -1023,7 +1055,7 @@ static struct IDirectDrawSurface3_VTable xlib_dds3vt = {
Xlib_IDirectDrawSurface3_Release
,
IDirectDrawSurface3_AddAttachedSurface
,
IDirectDrawSurface3_AddOverlayDirtyRect
,
IDirectDrawSurface3_Blt
,
Xlib_
IDirectDrawSurface3_Blt
,
IDirectDrawSurface3_BltBatch
,
IDirectDrawSurface3_BltFast
,
IDirectDrawSurface3_DeleteAttachedSurface
,
...
...
@@ -1482,8 +1514,6 @@ static HRESULT WINAPI DGA_IDirectDraw2_CreateSurface(
static
HRESULT
WINAPI
Xlib_IDirectDraw2_CreateSurface
(
LPDIRECTDRAW2
this
,
LPDDSURFACEDESC
lpddsd
,
LPDIRECTDRAWSURFACE
*
lpdsf
,
IUnknown
*
lpunk
)
{
XImage
*
img
;
TRACE
(
ddraw
,
"(%p)->CreateSurface(%p,%p,%p)
\n
"
,
this
,
lpddsd
,
lpdsf
,
lpunk
);
...
...
@@ -1502,44 +1532,47 @@ static HRESULT WINAPI Xlib_IDirectDraw2_CreateSurface(
(
*
lpdsf
)
->
ref
=
1
;
(
*
lpdsf
)
->
lpvtbl
=
(
LPDIRECTDRAWSURFACE_VTABLE
)
&
xlib_dds3vt
;
if
(
(
lpddsd
->
dwFlags
&
DDSD_CAPS
)
&&
(
lpddsd
->
ddsCaps
.
dwCaps
&
DDSCAPS_OFFSCREENPLAIN
)
)
{
if
(
!
(
lpddsd
->
dwFlags
&
DDSD_WIDTH
))
lpddsd
->
dwWidth
=
this
->
e
.
dga
.
fb_width
;
if
(
!
(
lpddsd
->
dwFlags
&
DDSD_HEIGHT
))
lpddsd
->
dwHeight
=
this
->
e
.
dga
.
fb_height
;
(
*
lpdsf
)
->
s
.
surface
=
(
LPBYTE
)
HeapAlloc
(
GetProcessHeap
(),
0
,
lpddsd
->
dwWidth
*
lpddsd
->
dwHeight
*
this
->
d
.
depth
/
8
);
TRACE
(
ddraw
,
"using system memory for a primary surface
\n
"
);
}
else
{
TRACE
(
ddraw
,
"using standard XImage for a primary surface
\n
"
);
/* FIXME: !8 bit images */
if
(
!
(
lpddsd
->
dwFlags
&
DDSD_WIDTH
))
lpddsd
->
dwWidth
=
this
->
d
.
width
;
if
(
!
(
lpddsd
->
dwFlags
&
DDSD_HEIGHT
))
lpddsd
->
dwHeight
=
this
->
d
.
height
;
}
(
*
lpdsf
)
->
s
.
surface
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
lpddsd
->
dwHeight
*
lpddsd
->
dwWidth
*
this
->
d
.
depth
/
8
);
(
*
lpdsf
)
->
s
.
surface
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
lpddsd
->
dwWidth
*
lpddsd
->
dwHeight
*
this
->
d
.
depth
/
8
);
(
*
lpdsf
)
->
s
.
width
=
lpddsd
->
dwWidth
;
(
*
lpdsf
)
->
s
.
height
=
lpddsd
->
dwHeight
;
{
(
*
lpdsf
)
->
t
.
xlib
.
image
=
img
=
if
((
lpddsd
->
dwFlags
&
DDSD_CAPS
)
&&
(
lpddsd
->
ddsCaps
.
dwCaps
&
DDSCAPS_OFFSCREENPLAIN
))
{
/* No XImage for a offscreen buffer */
(
*
lpdsf
)
->
t
.
xlib
.
image
=
NULL
;
(
*
lpdsf
)
->
t
.
xlib
.
on_screen
=
FALSE
;
(
*
lpdsf
)
->
s
.
lpitch
=
lpddsd
->
dwWidth
*
(
this
->
d
.
depth
/
8
);
TRACE
(
ddraw
,
"using system memory for a primary surface
\n
"
);
}
else
{
XImage
*
img
;
TRACE
(
ddraw
,
"using standard XImage for a primary surface
\n
"
);
/* In this case, create an XImage */
img
=
TSXCreateImage
(
display
,
DefaultVisualOfScreen
(
screen
),
/*FIXME:
depth
*/
8
,
this
->
d
.
depth
,
ZPixmap
,
0
,
(
*
lpdsf
)
->
s
.
surface
,
(
*
lpdsf
)
->
s
.
width
,
(
*
lpdsf
)
->
s
.
height
,
32
,
(
*
lpdsf
)
->
s
.
width
*
1
/* FIXME: !8 bit images */
(
*
lpdsf
)
->
s
.
width
*
(
this
->
d
.
depth
/
8
)
);
/* END FIXME: Xlib */
}
(
*
lpdsf
)
->
t
.
xlib
.
image
=
img
;
(
*
lpdsf
)
->
t
.
xlib
.
on_screen
=
TRUE
;
(
*
lpdsf
)
->
s
.
lpitch
=
img
->
bytes_per_line
;
/* Check for backbuffers */
if
(
lpddsd
->
dwFlags
&
DDSD_BACKBUFFERCOUNT
)
{
LPDIRECTDRAWSURFACE3
back
;
...
...
@@ -1555,27 +1588,28 @@ static HRESULT WINAPI Xlib_IDirectDraw2_CreateSurface(
back
->
lpvtbl
=
(
LPDIRECTDRAWSURFACE3_VTABLE
)
&
xlib_dds3vt
;
/* FIXME: !8 bit images */
back
->
s
.
surface
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
img
->
width
*
img
->
height
img
->
width
*
img
->
height
*
(
this
->
d
.
depth
/
8
)
);
back
->
t
.
xlib
.
image
=
TSXCreateImage
(
display
,
back
->
t
.
xlib
.
image
=
TSXCreateImage
(
display
,
DefaultVisualOfScreen
(
screen
),
/*FIXME:
depth
*/
8
,
this
->
d
.
depth
,
ZPixmap
,
0
,
back
->
s
.
surface
,
this
->
d
.
width
,
this
->
d
.
height
,
32
,
this
->
d
.
width
*
1
/* FIXME: !8 bit images */
this
->
d
.
width
*
(
this
->
d
.
depth
/
8
)
);
back
->
t
.
xlib
.
on_screen
=
FALSE
;
back
->
s
.
width
=
this
->
d
.
width
;
back
->
s
.
height
=
this
->
d
.
height
;
back
->
s
.
lpitch
=
back
->
t
.
xlib
.
image
->
bytes_per_line
;
back
->
s
.
backbuffer
=
NULL
;
/* does not have a backbuffer, it is
* one! */
}
}
return
0
;
}
...
...
This diff is collapsed.
Click to expand it.
include/authors.h
+
1
−
0
View file @
7d70fe5a
...
...
@@ -130,6 +130,7 @@ static const char * const SHELL_People[] =
"Linus Torvalds"
,
"Gregory Trubetskoy"
,
"Petri Tuomola"
,
"Lionel Ulmer"
,
"Michael Veksler"
,
"Sven Verdoolaege"
,
"Ronan Waide"
,
...
...
This diff is collapsed.
Click to expand it.
include/ddraw.h
+
1
−
0
View file @
7d70fe5a
...
...
@@ -987,6 +987,7 @@ struct _dga_directdrawsurface {
struct
_xlib_directdrawsurface
{
XImage
*
image
;
int
on_screen
;
#ifdef HAVE_LIBXXSHM
XShmSegmentInfo
shminfo
;
#endif
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment