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
0e49a5b0
Commit
0e49a5b0
authored
Apr 12, 2005
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Store a pointer to the currently selected phys bitmap in the device
structure. Create a phys bitmap for the default stock bitmap too.
parent
3f379d96
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
69 additions
and
102 deletions
+69
-102
bitblt.c
dlls/x11drv/bitblt.c
+2
-2
bitmap.c
dlls/x11drv/bitmap.c
+13
-20
dib.c
dlls/x11drv/dib.c
+45
-37
init.c
dlls/x11drv/init.c
+5
-2
x11drv.h
dlls/x11drv/x11drv.h
+2
-36
xrender.c
dlls/x11drv/xrender.c
+2
-5
No files found.
dlls/x11drv/bitblt.c
View file @
0e49a5b0
...
...
@@ -1177,10 +1177,10 @@ static BOOL BITBLT_GetVisRectangles( X11DRV_PDEVICE *physDevDst, INT xDst, INT y
if
(
heightSrc
<
0
)
SWAP_INT32
(
&
rect
.
top
,
&
rect
.
bottom
);
/* Apparently the clipping and visible regions are only for output,
so just check against dc extent here to avoid BadMatch errors */
if
(
GetObjectType
(
physDevSrc
->
hdc
)
==
OBJ_MEMDC
)
if
(
physDevSrc
->
bitmap
)
{
BITMAP
bm
;
GetObjectW
(
GetCurrentObject
(
physDevSrc
->
hdc
,
OBJ_BITMAP
)
,
sizeof
(
bm
),
&
bm
);
GetObjectW
(
physDevSrc
->
bitmap
->
hbitmap
,
sizeof
(
bm
),
&
bm
);
SetRect
(
&
clipRect
,
0
,
0
,
bm
.
bmWidth
,
bm
.
bmHeight
);
}
else
SetRect
(
&
clipRect
,
0
,
0
,
screen_width
,
screen_height
);
...
...
dlls/x11drv/bitmap.c
View file @
0e49a5b0
...
...
@@ -34,8 +34,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(x11drv);
/* GCs used for B&W and color bitmap operations */
GC
BITMAP_monoGC
=
0
,
BITMAP_colorGC
=
0
;
HBITMAP
BITMAP_stock_bitmap
=
0
;
/* default stock bitmap */
Pixmap
BITMAP_stock_pixmap
=
0
;
/* pixmap for the default stock bitmap */
X_PHYSBITMAP
BITMAP_stock_phys_bitmap
=
{
0
};
/* phys bitmap for the default stock bitmap */
/***********************************************************************
* X11DRV_BITMAP_Init
...
...
@@ -47,8 +46,9 @@ void X11DRV_BITMAP_Init(void)
/* Create the necessary GCs */
wine_tsx11_lock
();
BITMAP_stock_pixmap
=
XCreatePixmap
(
gdi_display
,
root_window
,
1
,
1
,
1
);
BITMAP_monoGC
=
XCreateGC
(
gdi_display
,
BITMAP_stock_pixmap
,
0
,
NULL
);
BITMAP_stock_phys_bitmap
.
pixmap_depth
=
1
;
BITMAP_stock_phys_bitmap
.
pixmap
=
XCreatePixmap
(
gdi_display
,
root_window
,
1
,
1
,
1
);
BITMAP_monoGC
=
XCreateGC
(
gdi_display
,
BITMAP_stock_phys_bitmap
.
pixmap
,
0
,
NULL
);
XSetGraphicsExposures
(
gdi_display
,
BITMAP_monoGC
,
False
);
XSetSubwindowMode
(
gdi_display
,
BITMAP_monoGC
,
IncludeInferiors
);
...
...
@@ -70,29 +70,22 @@ void X11DRV_BITMAP_Init(void)
*/
HBITMAP
X11DRV_SelectBitmap
(
X11DRV_PDEVICE
*
physDev
,
HBITMAP
hbitmap
)
{
int
depth
;
X_PHYSBITMAP
*
physBitmap
;
if
(
physDev
->
xrender
)
X11DRV_XRender_UpdateDrawable
(
physDev
);
if
(
hbitmap
==
BITMAP_stock_bitmap
)
{
physDev
->
drawable
=
BITMAP_stock_pixmap
;
depth
=
1
;
}
else
{
X_PHYSBITMAP
*
physBitmap
=
X11DRV_get_phys_bitmap
(
hbitmap
);
if
(
!
physBitmap
)
return
0
;
physDev
->
drawable
=
physBitmap
->
pixmap
;
depth
=
physBitmap
->
pixmap_depth
;
}
if
(
hbitmap
==
BITMAP_stock_phys_bitmap
.
hbitmap
)
physBitmap
=
&
BITMAP_stock_phys_bitmap
;
else
if
(
!
(
physBitmap
=
X11DRV_get_phys_bitmap
(
hbitmap
)))
return
0
;
physDev
->
bitmap
=
physBitmap
;
physDev
->
drawable
=
physBitmap
->
pixmap
;
/* Change GC depth if needed */
if
(
physDev
->
depth
!=
depth
)
if
(
physDev
->
depth
!=
physBitmap
->
pixmap_
depth
)
{
physDev
->
depth
=
depth
;
physDev
->
depth
=
physBitmap
->
pixmap_
depth
;
wine_tsx11_lock
();
XFreeGC
(
gdi_display
,
physDev
->
gc
);
physDev
->
gc
=
XCreateGC
(
gdi_display
,
physDev
->
drawable
,
0
,
NULL
);
...
...
@@ -132,7 +125,7 @@ BOOL X11DRV_CreateBitmap( X11DRV_PDEVICE *physDev, HBITMAP hbitmap )
bmp
->
bitmap
.
bmPlanes
,
bmp
->
bitmap
.
bmBitsPixel
);
goto
done
;
}
if
(
hbitmap
==
BITMAP_stock_bitmap
)
if
(
hbitmap
==
BITMAP_stock_
phys_bitmap
.
h
bitmap
)
{
ERR
(
"called for stock bitmap, please report
\n
"
);
goto
done
;
...
...
dlls/x11drv/dib.c
View file @
0e49a5b0
...
...
@@ -43,6 +43,41 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
bitmap
);
WINE_DECLARE_DEBUG_CHANNEL
(
x11drv
);
/* Additional info for DIB section objects */
typedef
struct
_X11DRV_DIBSECTION
{
/* Windows DIB section */
DIBSECTION
dibSection
;
/* Mapping status */
int
status
,
p_status
;
/* Color map info */
int
nColorMap
;
int
*
colorMap
;
/* Original dib color table converted to
rgb values if usage was DIB_PAL_COLORS */
RGBQUAD
*
colorTable
;
/* Cached XImage */
XImage
*
image
;
#ifdef HAVE_LIBXXSHM
/* Shared memory segment info */
XShmSegmentInfo
shminfo
;
#endif
/* Aux buffer access function */
void
(
*
copy_aux
)(
void
*
ctx
,
int
req
);
void
*
aux_ctx
;
/* GDI access lock */
CRITICAL_SECTION
lock
;
}
X11DRV_DIBSECTION
;
static
int
ximageDepthTable
[
32
];
/* This structure holds the arguments for DIB_SetImageBits() */
...
...
@@ -4182,7 +4217,6 @@ void X11DRV_DIB_CopyDIBSection(X11DRV_PDEVICE *physDevSrc, X11DRV_PDEVICE *physD
DWORD
width
,
DWORD
height
)
{
DIBSECTION
dib
;
HBITMAP
hBitmap
;
X_PHYSBITMAP
*
physBitmap
;
int
nColorMap
=
0
,
*
colorMap
=
NULL
,
aColorMap
=
FALSE
;
...
...
@@ -4190,14 +4224,8 @@ void X11DRV_DIB_CopyDIBSection(X11DRV_PDEVICE *physDevSrc, X11DRV_PDEVICE *physD
xSrc
,
ySrc
,
xDest
,
yDest
,
width
,
height
);
/* this function is meant as an optimization for BitBlt,
* not to be called otherwise */
if
(
GetObjectType
(
physDevSrc
->
hdc
)
!=
OBJ_MEMDC
)
{
ERR
(
"called for non-memory source DC!?
\n
"
);
return
;
}
hBitmap
=
GetCurrentObject
(
physDevSrc
->
hdc
,
OBJ_BITMAP
);
physBitmap
=
X11DRV_get_phys_bitmap
(
hBitmap
);
if
(
!
physBitmap
||
GetObjectW
(
hBitmap
,
sizeof
(
dib
),
&
dib
)
!=
sizeof
(
dib
))
physBitmap
=
physDevSrc
->
bitmap
;
if
(
!
physBitmap
||
GetObjectW
(
physBitmap
->
hbitmap
,
sizeof
(
dib
),
&
dib
)
!=
sizeof
(
dib
))
{
ERR
(
"called for non-DIBSection!?
\n
"
);
return
;
...
...
@@ -4547,14 +4575,8 @@ static void X11DRV_DIB_Unlock(X_PHYSBITMAP *physBitmap, BOOL commit)
*/
INT
X11DRV_CoerceDIBSection
(
X11DRV_PDEVICE
*
physDev
,
INT
req
,
BOOL
lossy
)
{
HBITMAP
hbitmap
;
X_PHYSBITMAP
*
physBitmap
;
if
(
!
physDev
)
return
DIB_Status_None
;
hbitmap
=
GetCurrentObject
(
physDev
->
hdc
,
OBJ_BITMAP
);
physBitmap
=
X11DRV_get_phys_bitmap
(
hbitmap
);
if
(
!
physBitmap
)
return
DIB_Status_None
;
return
X11DRV_DIB_Coerce
(
physBitmap
,
req
,
lossy
);
if
(
!
physDev
||
!
physDev
->
bitmap
)
return
DIB_Status_None
;
return
X11DRV_DIB_Coerce
(
physDev
->
bitmap
,
req
,
lossy
);
}
/***********************************************************************
...
...
@@ -4562,14 +4584,8 @@ INT X11DRV_CoerceDIBSection(X11DRV_PDEVICE *physDev, INT req, BOOL lossy)
*/
INT
X11DRV_LockDIBSection
(
X11DRV_PDEVICE
*
physDev
,
INT
req
,
BOOL
lossy
)
{
HBITMAP
hbitmap
;
X_PHYSBITMAP
*
physBitmap
;
if
(
!
physDev
)
return
DIB_Status_None
;
if
(
GetObjectType
(
physDev
->
hdc
)
!=
OBJ_MEMDC
)
return
DIB_Status_None
;
hbitmap
=
GetCurrentObject
(
physDev
->
hdc
,
OBJ_BITMAP
);
if
(
!
(
physBitmap
=
X11DRV_get_phys_bitmap
(
hbitmap
)))
return
DIB_Status_None
;
return
X11DRV_DIB_Lock
(
physBitmap
,
req
,
lossy
);
if
(
!
physDev
||
!
physDev
->
bitmap
)
return
DIB_Status_None
;
return
X11DRV_DIB_Lock
(
physDev
->
bitmap
,
req
,
lossy
);
}
/***********************************************************************
...
...
@@ -4577,14 +4593,8 @@ INT X11DRV_LockDIBSection(X11DRV_PDEVICE *physDev, INT req, BOOL lossy)
*/
void
X11DRV_UnlockDIBSection
(
X11DRV_PDEVICE
*
physDev
,
BOOL
commit
)
{
HBITMAP
hbitmap
;
X_PHYSBITMAP
*
physBitmap
;
if
(
!
physDev
)
return
;
if
(
GetObjectType
(
physDev
->
hdc
)
!=
OBJ_MEMDC
)
return
;
hbitmap
=
GetCurrentObject
(
physDev
->
hdc
,
OBJ_BITMAP
);
if
(
!
(
physBitmap
=
X11DRV_get_phys_bitmap
(
hbitmap
)))
return
;
X11DRV_DIB_Unlock
(
physBitmap
,
commit
);
if
(
!
physDev
||
!
physDev
->
bitmap
)
return
;
X11DRV_DIB_Unlock
(
physDev
->
bitmap
,
commit
);
}
...
...
@@ -4898,8 +4908,7 @@ UINT X11DRV_SetDIBColorTable( X11DRV_PDEVICE *physDev, UINT start, UINT count, c
{
X11DRV_DIBSECTION
*
dib
;
UINT
ret
=
0
;
HBITMAP
hBitmap
=
GetCurrentObject
(
physDev
->
hdc
,
OBJ_BITMAP
);
X_PHYSBITMAP
*
physBitmap
=
X11DRV_get_phys_bitmap
(
hBitmap
);
X_PHYSBITMAP
*
physBitmap
=
physDev
->
bitmap
;
if
(
!
physBitmap
)
return
0
;
dib
=
physBitmap
->
dib
;
...
...
@@ -4930,8 +4939,7 @@ UINT X11DRV_GetDIBColorTable( X11DRV_PDEVICE *physDev, UINT start, UINT count, R
{
X11DRV_DIBSECTION
*
dib
;
UINT
ret
=
0
;
HBITMAP
hBitmap
=
GetCurrentObject
(
physDev
->
hdc
,
OBJ_BITMAP
);
X_PHYSBITMAP
*
physBitmap
=
X11DRV_get_phys_bitmap
(
hBitmap
);
X_PHYSBITMAP
*
physBitmap
=
physDev
->
bitmap
;
if
(
!
physBitmap
)
return
0
;
dib
=
physBitmap
->
dib
;
...
...
dlls/x11drv/init.c
View file @
0e49a5b0
...
...
@@ -139,12 +139,15 @@ BOOL X11DRV_CreateDC( HDC hdc, X11DRV_PDEVICE **pdev, LPCWSTR driver, LPCWSTR de
if
(
GetObjectType
(
hdc
)
==
OBJ_MEMDC
)
{
if
(
!
BITMAP_stock_bitmap
)
BITMAP_stock_bitmap
=
GetCurrentObject
(
hdc
,
OBJ_BITMAP
);
physDev
->
drawable
=
BITMAP_stock_pixmap
;
if
(
!
BITMAP_stock_phys_bitmap
.
hbitmap
)
BITMAP_stock_phys_bitmap
.
hbitmap
=
GetCurrentObject
(
hdc
,
OBJ_BITMAP
);
physDev
->
bitmap
=
&
BITMAP_stock_phys_bitmap
;
physDev
->
drawable
=
BITMAP_stock_phys_bitmap
.
pixmap
;
physDev
->
depth
=
1
;
}
else
{
physDev
->
bitmap
=
NULL
;
physDev
->
drawable
=
root_window
;
physDev
->
depth
=
screen_depth
;
}
...
...
dlls/x11drv/x11drv.h
View file @
0e49a5b0
...
...
@@ -104,6 +104,7 @@ typedef struct
X_PHYSFONT
font
;
X_PHYSPEN
pen
;
X_PHYSBRUSH
brush
;
X_PHYSBITMAP
*
bitmap
;
/* currently selected bitmap for memory DCs */
BOOL
has_gdi_font
;
/* is current font a GDI font? */
int
backgroundPixel
;
int
textPixel
;
...
...
@@ -119,8 +120,7 @@ typedef struct
/* GCs used for B&W and color bitmap operations */
extern
GC
BITMAP_monoGC
,
BITMAP_colorGC
;
extern
HBITMAP
BITMAP_stock_bitmap
;
/* default stock bitmap */
extern
Pixmap
BITMAP_stock_pixmap
;
/* pixmap for the default stock bitmap */
extern
X_PHYSBITMAP
BITMAP_stock_phys_bitmap
;
/* phys bitmap for the default stock bitmap */
#define BITMAP_GC(physBitmap) (((physBitmap)->pixmap_depth == 1) ? BITMAP_monoGC : BITMAP_colorGC)
...
...
@@ -260,40 +260,6 @@ extern void X11DRV_XDND_LeaveEvent( HWND hWnd, XClientMessageEvent *event );
/* exported dib functions for now */
/* Additional info for DIB section objects */
typedef
struct
_X11DRV_DIBSECTION
{
/* Windows DIB section */
DIBSECTION
dibSection
;
/* Mapping status */
int
status
,
p_status
;
/* Color map info */
int
nColorMap
;
int
*
colorMap
;
/* Original dib color table converted to
rgb values if usage was DIB_PAL_COLORS */
RGBQUAD
*
colorTable
;
/* Cached XImage */
XImage
*
image
;
#ifdef HAVE_LIBXXSHM
/* Shared memory segment info */
XShmSegmentInfo
shminfo
;
#endif
/* Aux buffer access function */
void
(
*
copy_aux
)(
void
*
ctx
,
int
req
);
void
*
aux_ctx
;
/* GDI access lock */
CRITICAL_SECTION
lock
;
}
X11DRV_DIBSECTION
;
/* DIB Section sync state */
enum
{
DIB_Status_None
,
DIB_Status_InSync
,
DIB_Status_GdiMod
,
DIB_Status_AppMod
,
DIB_Status_AuxMod
};
...
...
dlls/x11drv/xrender.c
View file @
0e49a5b0
...
...
@@ -1033,8 +1033,7 @@ BOOL X11DRV_XRender_ExtTextOut( X11DRV_PDEVICE *physDev, INT x, INT y, UINT flag
DIBSECTION
bmp
;
/* Do we need to disable antialiasing because of palette mode? */
HBITMAP
hBitmap
=
GetCurrentObject
(
physDev
->
hdc
,
OBJ_BITMAP
);
if
(
GetObjectW
(
hBitmap
,
sizeof
(
bmp
),
&
bmp
)
!=
sizeof
(
bmp
)
)
{
if
(
!
physDev
->
bitmap
||
GetObjectW
(
physDev
->
bitmap
->
hbitmap
,
sizeof
(
bmp
),
&
bmp
)
!=
sizeof
(
bmp
)
)
{
TRACE
(
"bitmap is not a DIB
\n
"
);
}
else
if
(
bmp
.
dsBmih
.
biBitCount
<=
8
)
{
...
...
@@ -1622,7 +1621,6 @@ BOOL X11DRV_AlphaBlend(X11DRV_PDEVICE *devDst, INT xDst, INT yDst, INT widthDst,
XRenderPictFormat
*
src_format
;
Picture
dst_pict
,
src_pict
;
Pixmap
xpm
;
HBITMAP
hBitmap
;
DIBSECTION
dib
;
XImage
*
image
;
GC
gc
;
...
...
@@ -1666,8 +1664,7 @@ BOOL X11DRV_AlphaBlend(X11DRV_PDEVICE *devDst, INT xDst, INT yDst, INT widthDst,
return
FALSE
;
}
hBitmap
=
GetCurrentObject
(
devSrc
->
hdc
,
OBJ_BITMAP
);
if
(
GetObjectW
(
hBitmap
,
sizeof
(
dib
),
&
dib
)
!=
sizeof
(
dib
))
if
(
!
devSrc
->
bitmap
||
GetObjectW
(
devSrc
->
bitmap
->
hbitmap
,
sizeof
(
dib
),
&
dib
)
!=
sizeof
(
dib
))
{
FIXME
(
"not a dibsection
\n
"
);
return
FALSE
;
...
...
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