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
0a63a72f
Commit
0a63a72f
authored
Mar 31, 2005
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Introduced an X_PHYSBITMAP structure to allow storing more x11drv
information about a bitmap than just the pixmap id.
parent
7308f16b
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
115 additions
and
71 deletions
+115
-71
bitmap.c
dlls/x11drv/bitmap.c
+56
-36
dib.c
dlls/x11drv/dib.c
+51
-31
x11drv.h
dlls/x11drv/x11drv.h
+8
-4
No files found.
dlls/x11drv/bitmap.c
View file @
0a63a72f
...
...
@@ -109,7 +109,8 @@ HBITMAP X11DRV_SelectBitmap( X11DRV_PDEVICE *physDev, HBITMAP hbitmap )
*/
BOOL
X11DRV_CreateBitmap
(
X11DRV_PDEVICE
*
physDev
,
HBITMAP
hbitmap
)
{
Pixmap
pixmap
;
X_PHYSBITMAP
*
physBitmap
;
BOOL
ret
=
FALSE
;
BITMAPOBJ
*
bmp
=
(
BITMAPOBJ
*
)
GDI_GetObjPtr
(
hbitmap
,
BITMAP_MAGIC
);
if
(
!
bmp
)
{
...
...
@@ -118,47 +119,47 @@ BOOL X11DRV_CreateBitmap( X11DRV_PDEVICE *physDev, HBITMAP hbitmap )
}
/* Check parameters */
if
(
bmp
->
bitmap
.
bmPlanes
!=
1
)
{
GDI_ReleaseObj
(
hbitmap
);
return
0
;
}
if
(
bmp
->
bitmap
.
bmPlanes
!=
1
)
goto
done
;
if
((
bmp
->
bitmap
.
bmBitsPixel
!=
1
)
&&
(
bmp
->
bitmap
.
bmBitsPixel
!=
screen_depth
))
{
ERR
(
"Trying to make bitmap with planes=%d, bpp=%d
\n
"
,
bmp
->
bitmap
.
bmPlanes
,
bmp
->
bitmap
.
bmBitsPixel
);
GDI_ReleaseObj
(
hbitmap
);
return
FALSE
;
goto
done
;
}
if
(
hbitmap
==
BITMAP_stock_bitmap
)
{
ERR
(
"called for stock bitmap, please report
\n
"
);
GDI_ReleaseObj
(
hbitmap
);
return
FALSE
;
goto
done
;
}
TRACE
(
"(%p) %dx%d %d bpp
\n
"
,
hbitmap
,
bmp
->
bitmap
.
bmWidth
,
bmp
->
bitmap
.
bmHeight
,
bmp
->
bitmap
.
bmBitsPixel
);
if
(
!
(
physBitmap
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
physBitmap
)
)))
goto
done
;
/* Create the pixmap */
wine_tsx11_lock
();
pixmap
=
XCreatePixmap
(
gdi_display
,
root_window
,
bmp
->
bitmap
.
bmWidth
,
bmp
->
bitmap
.
bmHeight
,
bmp
->
bitmap
.
bmBitsPixel
);
physBitmap
->
pixmap
=
XCreatePixmap
(
gdi_display
,
root_window
,
bmp
->
bitmap
.
bmWidth
,
bmp
->
bitmap
.
bmHeight
,
bmp
->
bitmap
.
bmBitsPixel
);
wine_tsx11_unlock
();
if
(
!
pixmap
)
if
(
!
p
hysBitmap
->
p
ixmap
)
{
WARN
(
"Can't create Pixmap
\n
"
);
GDI_ReleaseObj
(
hb
itmap
);
return
FALSE
;
HeapFree
(
GetProcessHeap
(),
0
,
physB
itmap
);
goto
done
;
}
X11DRV_set_pixmap
(
hbitmap
,
pixmap
);
bmp
->
physBitmap
=
physBitmap
;
ret
=
TRUE
;
if
(
bmp
->
bitmap
.
bmBits
)
/* Set bitmap bits */
X11DRV_SetBitmapBits
(
hbitmap
,
bmp
->
bitmap
.
bmBits
,
bmp
->
bitmap
.
bmHeight
*
bmp
->
bitmap
.
bmWidthBytes
);
done:
GDI_ReleaseObj
(
hbitmap
);
return
TRUE
;
return
ret
;
}
...
...
@@ -422,12 +423,17 @@ BOOL X11DRV_DeleteBitmap( HBITMAP hbitmap )
BITMAPOBJ
*
bmp
=
(
BITMAPOBJ
*
)
GDI_GetObjPtr
(
hbitmap
,
BITMAP_MAGIC
);
if
(
bmp
)
{
Pixmap
pixmap
;
if
(
bmp
->
dib
)
X11DRV_DIB_DeleteDIBSection
(
bmp
);
pixmap
=
X11DRV_set_pixmap
(
hbitmap
,
0
);
wine_tsx11_lock
();
if
(
pixmap
)
XFreePixmap
(
gdi_display
,
pixmap
);
wine_tsx11_unlock
();
X_PHYSBITMAP
*
physBitmap
=
bmp
->
physBitmap
;
if
(
physBitmap
)
{
if
(
bmp
->
dib
)
X11DRV_DIB_DeleteDIBSection
(
physBitmap
,
bmp
);
wine_tsx11_lock
();
if
(
physBitmap
->
pixmap
)
XFreePixmap
(
gdi_display
,
physBitmap
->
pixmap
);
wine_tsx11_unlock
();
HeapFree
(
GetProcessHeap
(),
0
,
physBitmap
);
bmp
->
physBitmap
=
NULL
;
}
GDI_ReleaseObj
(
hbitmap
);
}
return
TRUE
;
...
...
@@ -435,6 +441,24 @@ BOOL X11DRV_DeleteBitmap( HBITMAP hbitmap )
/***********************************************************************
* X11DRV_get_phys_bitmap
*
* Retrieve the X physical bitmap info.
*/
X_PHYSBITMAP
*
X11DRV_get_phys_bitmap
(
HBITMAP
hbitmap
)
{
X_PHYSBITMAP
*
ret
=
NULL
;
BITMAPOBJ
*
bmp
=
GDI_GetObjPtr
(
hbitmap
,
BITMAP_MAGIC
);
if
(
bmp
)
{
ret
=
bmp
->
physBitmap
;
GDI_ReleaseObj
(
hbitmap
);
}
return
ret
;
}
/***********************************************************************
* X11DRV_set_pixmap
*
* Set the pixmap associated to a bitmap, and return the previous one.
...
...
@@ -442,12 +466,12 @@ BOOL X11DRV_DeleteBitmap( HBITMAP hbitmap )
Pixmap
X11DRV_set_pixmap
(
HBITMAP
hbitmap
,
Pixmap
pixmap
)
{
Pixmap
ret
=
0
;
BITMAPOBJ
*
bmp
=
(
BITMAPOBJ
*
)
GDI_GetObjPtr
(
hbitmap
,
BITMAP_MAGIC
);
if
(
bmp
)
X_PHYSBITMAP
*
physBitmap
=
X11DRV_get_phys_bitmap
(
hbitmap
);
if
(
physBitmap
)
{
ret
=
(
Pixmap
)
bmp
->
physBitmap
;
bmp
->
physBitmap
=
(
void
*
)
pixmap
;
GDI_ReleaseObj
(
hbitmap
);
ret
=
physBitmap
->
pixmap
;
physBitmap
->
pixmap
=
pixmap
;
}
return
ret
;
}
...
...
@@ -460,12 +484,8 @@ Pixmap X11DRV_set_pixmap( HBITMAP hbitmap, Pixmap pixmap )
*/
Pixmap
X11DRV_get_pixmap
(
HBITMAP
hbitmap
)
{
Pixmap
pixmap
=
0
;
BITMAPOBJ
*
bmp
=
(
BITMAPOBJ
*
)
GDI_GetObjPtr
(
hbitmap
,
BITMAP_MAGIC
);
if
(
bmp
)
{
pixmap
=
(
Pixmap
)
bmp
->
physBitmap
;
GDI_ReleaseObj
(
hbitmap
);
}
return
pixmap
;
X_PHYSBITMAP
*
physBitmap
=
X11DRV_get_phys_bitmap
(
hbitmap
);
if
(
!
physBitmap
)
return
0
;
return
physBitmap
->
pixmap
;
}
dlls/x11drv/dib.c
View file @
0a63a72f
This diff is collapsed.
Click to expand it.
dlls/x11drv/x11drv.h
View file @
0a63a72f
...
...
@@ -79,6 +79,12 @@ typedef struct
Pixmap
pixmap
;
}
X_PHYSBRUSH
;
/* X physical bitmap */
typedef
struct
{
Pixmap
pixmap
;
}
X_PHYSBITMAP
;
/* X physical font */
typedef
UINT
X_PHYSFONT
;
...
...
@@ -206,6 +212,7 @@ extern XImage *X11DRV_DIB_CreateXImage( int width, int height, int depth );
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
);
extern
X_PHYSBITMAP
*
X11DRV_get_phys_bitmap
(
HBITMAP
hbitmap
);
extern
Pixmap
X11DRV_set_pixmap
(
HBITMAP
hbitmap
,
Pixmap
pixmap
);
extern
Pixmap
X11DRV_get_pixmap
(
HBITMAP
hbitmap
);
...
...
@@ -431,10 +438,7 @@ extern void X11DRV_UnlockDIBSection2(HBITMAP bmp,BOOL);
extern
HBITMAP
X11DRV_DIB_CreateDIBSection
(
X11DRV_PDEVICE
*
physDev
,
const
BITMAPINFO
*
bmi
,
UINT
usage
,
VOID
**
bits
,
HANDLE
section
,
DWORD
offset
,
DWORD
ovr_pitch
);
extern
void
X11DRV_DIB_DeleteDIBSection
(
struct
tagBITMAPOBJ
*
bmp
);
extern
INT
X11DRV_DIB_Coerce
(
struct
tagBITMAPOBJ
*
,
INT
,
BOOL
);
extern
INT
X11DRV_DIB_Lock
(
struct
tagBITMAPOBJ
*
,
INT
,
BOOL
);
extern
void
X11DRV_DIB_Unlock
(
struct
tagBITMAPOBJ
*
,
BOOL
);
extern
void
X11DRV_DIB_DeleteDIBSection
(
X_PHYSBITMAP
*
physBitmap
,
struct
tagBITMAPOBJ
*
bmp
);
void
X11DRV_DIB_CopyDIBSection
(
X11DRV_PDEVICE
*
physDevSrc
,
X11DRV_PDEVICE
*
physDevDst
,
DWORD
xSrc
,
DWORD
ySrc
,
DWORD
xDest
,
DWORD
yDest
,
DWORD
width
,
DWORD
height
);
...
...
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