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
90ef43ab
Commit
90ef43ab
authored
Aug 29, 2008
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11: Allocate image data from the process heap where possible.
parent
816f57cb
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
18 deletions
+33
-18
bitblt.c
dlls/winex11.drv/bitblt.c
+2
-2
bitmap.c
dlls/winex11.drv/bitmap.c
+4
-2
dib.c
dlls/winex11.drv/dib.c
+26
-14
x11drv.h
dlls/winex11.drv/x11drv.h
+1
-0
No files found.
dlls/winex11.drv/bitblt.c
View file @
90ef43ab
...
...
@@ -896,7 +896,7 @@ static int BITBLT_GetSrcAreaStretch( X11DRV_PDEVICE *physDevSrc, X11DRV_PDEVICE
XPutImage
(
gdi_display
,
pixmap
,
gc
,
imageDst
,
0
,
0
,
0
,
0
,
rectDst
.
right
-
rectDst
.
left
,
rectDst
.
bottom
-
rectDst
.
top
);
XDestroyImage
(
imageSrc
);
X
Destroy
Image
(
imageDst
);
X
11DRV_DIB_DestroyX
Image
(
imageDst
);
wine_tsx11_unlock
();
return
0
;
/* no exposure events generated */
}
...
...
@@ -1026,7 +1026,7 @@ static int BITBLT_GetSrcArea( X11DRV_PDEVICE *physDevSrc, X11DRV_PDEVICE *physDe
XPutImage
(
gdi_display
,
pixmap
,
gc
,
imageDst
,
0
,
0
,
0
,
0
,
width
,
height
);
XDestroyImage
(
imageSrc
);
X
Destroy
Image
(
imageDst
);
X
11DRV_DIB_DestroyX
Image
(
imageDst
);
wine_tsx11_unlock
();
}
}
...
...
dlls/winex11.drv/bitmap.c
View file @
90ef43ab
...
...
@@ -316,7 +316,7 @@ LONG X11DRV_SetBitmapBits( HBITMAP hbitmap, const void *bits, LONG count )
wine_tsx11_lock
();
image
=
XCreateImage
(
gdi_display
,
visual
,
physBitmap
->
pixmap_depth
,
ZPixmap
,
0
,
NULL
,
bitmap
.
bmWidth
,
height
,
32
,
0
);
if
(
!
(
image
->
data
=
malloc
(
image
->
bytes_per_line
*
height
)))
if
(
!
(
image
->
data
=
HeapAlloc
(
GetProcessHeap
(),
0
,
image
->
bytes_per_line
*
height
)))
{
WARN
(
"No memory to create image data.
\n
"
);
XDestroyImage
(
image
);
...
...
@@ -407,7 +407,9 @@ LONG X11DRV_SetBitmapBits( HBITMAP hbitmap, const void *bits, LONG count )
}
XPutImage
(
gdi_display
,
physBitmap
->
pixmap
,
BITMAP_GC
(
physBitmap
),
image
,
0
,
0
,
0
,
0
,
bitmap
.
bmWidth
,
height
);
XDestroyImage
(
image
);
/* frees image->data too */
HeapFree
(
GetProcessHeap
(),
0
,
image
->
data
);
image
->
data
=
NULL
;
XDestroyImage
(
image
);
wine_tsx11_unlock
();
return
count
;
}
...
...
dlls/winex11.drv/dib.c
View file @
90ef43ab
...
...
@@ -221,19 +221,36 @@ int bitmap_info_size( const BITMAPINFO * info, WORD coloruse )
XImage
*
X11DRV_DIB_CreateXImage
(
int
width
,
int
height
,
int
depth
)
{
int
width_bytes
;
XImage
*
image
;
XImage
*
image
=
NULL
;
void
*
data
;
wine_tsx11_lock
();
width_bytes
=
X11DRV_DIB_GetXImageWidthBytes
(
width
,
depth
);
image
=
XCreateImage
(
gdi_display
,
visual
,
depth
,
ZPixmap
,
0
,
calloc
(
height
,
width_bytes
),
width
,
height
,
32
,
width_bytes
);
data
=
HeapAlloc
(
GetProcessHeap
(),
0
,
height
*
width_bytes
);
if
(
data
)
image
=
XCreateImage
(
gdi_display
,
visual
,
depth
,
ZPixmap
,
0
,
data
,
width
,
height
,
32
,
width_bytes
);
if
(
!
image
)
HeapFree
(
GetProcessHeap
(),
0
,
data
);
wine_tsx11_unlock
();
return
image
;
}
/***********************************************************************
* X11DRV_DIB_DestroyXImage
*
* Destroy an X image created with X11DRV_DIB_CreateXImage.
*/
void
X11DRV_DIB_DestroyXImage
(
XImage
*
image
)
{
HeapFree
(
GetProcessHeap
(),
0
,
image
->
data
);
image
->
data
=
NULL
;
wine_tsx11_lock
();
XDestroyImage
(
image
);
wine_tsx11_unlock
();
}
/***********************************************************************
* DIB_GetBitmapInfoEx
*
* Get the info from a bitmap header.
...
...
@@ -3520,7 +3537,7 @@ static int X11DRV_DIB_SetImageBits( const X11DRV_DIB_IMAGEBITS_DESCR *descr )
else
{
bmpImage
=
XCreateImage
(
gdi_display
,
visual
,
descr
->
depth
,
ZPixmap
,
0
,
NULL
,
descr
->
infoWidth
,
lines
,
32
,
0
);
bmpImage
->
data
=
calloc
(
lines
,
bmpImage
->
bytes_per_line
);
bmpImage
->
data
=
HeapAlloc
(
GetProcessHeap
(),
0
,
lines
*
bmpImage
->
bytes_per_line
);
if
(
bmpImage
->
data
==
NULL
)
{
ERR
(
"Out of memory!
\n
"
);
XDestroyImage
(
bmpImage
);
...
...
@@ -3628,7 +3645,7 @@ static int X11DRV_DIB_SetImageBits( const X11DRV_DIB_IMAGEBITS_DESCR *descr )
descr
->
xSrc
,
descr
->
ySrc
,
descr
->
xDest
,
descr
->
yDest
,
descr
->
width
,
descr
->
height
);
}
if
(
!
descr
->
image
)
X
Destroy
Image
(
bmpImage
);
if
(
!
descr
->
image
)
X
11DRV_DIB_DestroyX
Image
(
bmpImage
);
wine_tsx11_unlock
();
return
lines
;
}
...
...
@@ -3649,7 +3666,7 @@ static int X11DRV_DIB_GetImageBits( const X11DRV_DIB_IMAGEBITS_DESCR *descr )
else
{
bmpImage
=
XCreateImage
(
gdi_display
,
visual
,
descr
->
depth
,
ZPixmap
,
0
,
NULL
,
descr
->
infoWidth
,
lines
,
32
,
0
);
bmpImage
->
data
=
calloc
(
lines
,
bmpImage
->
bytes_per_line
);
bmpImage
->
data
=
HeapAlloc
(
GetProcessHeap
(),
0
,
lines
*
bmpImage
->
bytes_per_line
);
if
(
bmpImage
->
data
==
NULL
)
{
ERR
(
"Out of memory!
\n
"
);
XDestroyImage
(
bmpImage
);
...
...
@@ -3766,12 +3783,7 @@ static int X11DRV_DIB_GetImageBits( const X11DRV_DIB_IMAGEBITS_DESCR *descr )
break
;
}
if
(
!
descr
->
image
)
{
wine_tsx11_lock
();
XDestroyImage
(
bmpImage
);
wine_tsx11_unlock
();
}
if
(
!
descr
->
image
)
X11DRV_DIB_DestroyXImage
(
bmpImage
);
return
lines
;
}
...
...
@@ -4751,7 +4763,7 @@ void X11DRV_DIB_DeleteDIBSection(X_PHYSBITMAP *physBitmap, DIBSECTION *dib)
}
else
#endif
X
Destroy
Image
(
physBitmap
->
image
);
X
11DRV_DIB_DestroyX
Image
(
physBitmap
->
image
);
wine_tsx11_unlock
();
}
...
...
dlls/winex11.drv/x11drv.h
View file @
90ef43ab
...
...
@@ -237,6 +237,7 @@ extern void X11DRV_FONT_Init( int log_pixels_x, int log_pixels_y );
extern
int
bitmap_info_size
(
const
BITMAPINFO
*
info
,
WORD
coloruse
);
extern
XImage
*
X11DRV_DIB_CreateXImage
(
int
width
,
int
height
,
int
depth
);
extern
void
X11DRV_DIB_DestroyXImage
(
XImage
*
image
);
extern
HGLOBAL
X11DRV_DIB_CreateDIBFromBitmap
(
HDC
hdc
,
HBITMAP
hBmp
);
extern
HGLOBAL
X11DRV_DIB_CreateDIBFromPixmap
(
Pixmap
pixmap
,
HDC
hdc
);
extern
Pixmap
X11DRV_DIB_CreatePixmapFromDIB
(
HGLOBAL
hPackedDIB
,
HDC
hdc
);
...
...
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