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
618b410a
Commit
618b410a
authored
Jul 09, 2009
by
Roderick Colenbrander
Committed by
Alexandre Julliard
Jul 16, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11: Add a function for retrieving the bitmap GC.
parent
9d14dcab
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
28 additions
and
16 deletions
+28
-16
bitmap.c
dlls/winex11.drv/bitmap.c
+16
-4
brush.c
dlls/winex11.drv/brush.c
+6
-5
dib.c
dlls/winex11.drv/dib.c
+3
-3
graphics.c
dlls/winex11.drv/graphics.c
+1
-1
x11drv.h
dlls/winex11.drv/x11drv.h
+2
-3
No files found.
dlls/winex11.drv/bitmap.c
View file @
618b410a
...
...
@@ -36,6 +36,17 @@ X_PHYSBITMAP BITMAP_stock_phys_bitmap = { 0 }; /* phys bitmap for the default s
static
XContext
bitmap_context
;
/* X context to associate a phys bitmap to a handle */
GC
get_bitmap_gc
(
int
depth
)
{
switch
(
depth
)
{
case
1
:
return
BITMAP_monoGC
;
default:
return
BITMAP_colorGC
;
}
}
/***********************************************************************
* X11DRV_BITMAP_Init
*/
...
...
@@ -157,11 +168,12 @@ BOOL CDECL X11DRV_CreateBitmap( X11DRV_PDEVICE *physDev, HBITMAP hbitmap, LPVOID
}
else
/* else clear the bitmap */
{
GC
gc
=
get_bitmap_gc
(
physBitmap
->
pixmap_depth
);
wine_tsx11_lock
();
XSetFunction
(
gdi_display
,
BITMAP_GC
(
physBitmap
)
,
GXclear
);
XFillRectangle
(
gdi_display
,
physBitmap
->
pixmap
,
BITMAP_GC
(
physBitmap
)
,
0
,
0
,
XSetFunction
(
gdi_display
,
gc
,
GXclear
);
XFillRectangle
(
gdi_display
,
physBitmap
->
pixmap
,
gc
,
0
,
0
,
bitmap
.
bmWidth
,
bitmap
.
bmHeight
);
XSetFunction
(
gdi_display
,
BITMAP_GC
(
physBitmap
)
,
GXcopy
);
XSetFunction
(
gdi_display
,
gc
,
GXcopy
);
wine_tsx11_unlock
();
}
return
TRUE
;
...
...
@@ -405,7 +417,7 @@ LONG CDECL X11DRV_SetBitmapBits( HBITMAP hbitmap, const void *bits, LONG count )
FIXME
(
"Unhandled bits:%d
\n
"
,
bitmap
.
bmBitsPixel
);
}
XPutImage
(
gdi_display
,
physBitmap
->
pixmap
,
BITMAP_GC
(
physBitmap
),
XPutImage
(
gdi_display
,
physBitmap
->
pixmap
,
get_bitmap_gc
(
physBitmap
->
pixmap_depth
),
image
,
0
,
0
,
0
,
0
,
bitmap
.
bmWidth
,
height
);
HeapFree
(
GetProcessHeap
(),
0
,
image
->
data
);
image
->
data
=
NULL
;
...
...
dlls/winex11.drv/brush.c
View file @
618b410a
...
...
@@ -103,13 +103,14 @@ static const COLORREF WHITE = RGB(0xff, 0xff, 0xff);
/***********************************************************************
* BRUSH_DitherColor
*/
static
Pixmap
BRUSH_DitherColor
(
COLORREF
color
)
static
Pixmap
BRUSH_DitherColor
(
COLORREF
color
,
int
depth
)
{
/* X image for building dithered pixmap */
static
XImage
*
ditherImage
=
NULL
;
static
COLORREF
prevColor
=
0xffffffff
;
unsigned
int
x
,
y
;
Pixmap
pixmap
;
GC
gc
=
get_bitmap_gc
(
depth
);
if
(
!
ditherImage
)
{
...
...
@@ -144,7 +145,7 @@ static Pixmap BRUSH_DitherColor( COLORREF color )
}
pixmap
=
XCreatePixmap
(
gdi_display
,
root_window
,
MATRIX_SIZE
,
MATRIX_SIZE
,
screen_depth
);
XPutImage
(
gdi_display
,
pixmap
,
BITMAP_colorGC
,
ditherImage
,
0
,
0
,
XPutImage
(
gdi_display
,
pixmap
,
gc
,
ditherImage
,
0
,
0
,
0
,
0
,
MATRIX_SIZE
,
MATRIX_SIZE
);
wine_tsx11_unlock
();
...
...
@@ -185,7 +186,7 @@ static void BRUSH_SelectSolidBrush( X11DRV_PDEVICE *physDev, COLORREF color )
if
((
physDev
->
depth
>
1
)
&&
(
screen_depth
<=
8
)
&&
!
X11DRV_IsSolidColor
(
color
))
{
/* Dithered brush */
physDev
->
brush
.
pixmap
=
BRUSH_DitherColor
(
color
);
physDev
->
brush
.
pixmap
=
BRUSH_DitherColor
(
color
,
physDev
->
depth
);
physDev
->
brush
.
fillStyle
=
FillTiled
;
physDev
->
brush
.
pixel
=
0
;
}
...
...
@@ -222,7 +223,7 @@ static BOOL BRUSH_SelectPatternBrush( X11DRV_PDEVICE *physDev, HBITMAP hbitmap )
bitmap
.
bmWidth
,
bitmap
.
bmHeight
,
1
);
/* FIXME: should probably convert to monochrome instead */
XCopyPlane
(
gdi_display
,
physBitmap
->
pixmap
,
physDev
->
brush
.
pixmap
,
BITMAP_monoGC
,
0
,
0
,
bitmap
.
bmWidth
,
bitmap
.
bmHeight
,
0
,
0
,
1
);
get_bitmap_gc
(
1
)
,
0
,
0
,
bitmap
.
bmWidth
,
bitmap
.
bmHeight
,
0
,
0
,
1
);
}
else
{
...
...
@@ -230,7 +231,7 @@ static BOOL BRUSH_SelectPatternBrush( X11DRV_PDEVICE *physDev, HBITMAP hbitmap )
bitmap
.
bmWidth
,
bitmap
.
bmHeight
,
physBitmap
->
pixmap_depth
);
XCopyArea
(
gdi_display
,
physBitmap
->
pixmap
,
physDev
->
brush
.
pixmap
,
BITMAP_GC
(
physBitmap
),
0
,
0
,
bitmap
.
bmWidth
,
bitmap
.
bmHeight
,
0
,
0
);
get_bitmap_gc
(
physBitmap
->
pixmap_depth
),
0
,
0
,
bitmap
.
bmWidth
,
bitmap
.
bmHeight
,
0
,
0
);
}
wine_tsx11_unlock
();
...
...
dlls/winex11.drv/dib.c
View file @
618b410a
...
...
@@ -3984,7 +3984,7 @@ INT CDECL X11DRV_SetDIBits( X11DRV_PDEVICE *physDev, HBITMAP hbitmap, UINT start
descr
.
lines
=
tmpheight
>=
0
?
lines
:
-
lines
;
descr
.
depth
=
physBitmap
->
pixmap_depth
;
descr
.
drawable
=
physBitmap
->
pixmap
;
descr
.
gc
=
BITMAP_GC
(
physBitmap
);
descr
.
gc
=
get_bitmap_gc
(
physBitmap
->
pixmap_depth
);
descr
.
xSrc
=
0
;
descr
.
ySrc
=
0
;
descr
.
xDest
=
0
;
...
...
@@ -4138,7 +4138,7 @@ INT CDECL X11DRV_GetDIBits( X11DRV_PDEVICE *physDev, HBITMAP hbitmap, UINT start
descr
.
lines
=
lines
;
descr
.
depth
=
physBitmap
->
pixmap_depth
;
descr
.
drawable
=
physBitmap
->
pixmap
;
descr
.
gc
=
BITMAP_GC
(
physBitmap
);
descr
.
gc
=
get_bitmap_gc
(
physBitmap
->
pixmap_depth
);
descr
.
width
=
dib
.
dsBm
.
bmWidth
;
descr
.
height
=
dib
.
dsBm
.
bmHeight
;
descr
.
xDest
=
0
;
...
...
@@ -4353,7 +4353,7 @@ static void X11DRV_DIB_DoUpdateDIBSection(X_PHYSBITMAP *physBitmap, BOOL toDIB)
GetObjectW
(
physBitmap
->
hbitmap
,
sizeof
(
bitmap
),
&
bitmap
);
X11DRV_DIB_DoCopyDIBSection
(
physBitmap
,
toDIB
,
physBitmap
->
colorMap
,
physBitmap
->
nColorMap
,
physBitmap
->
pixmap
,
BITMAP_GC
(
physBitmap
),
physBitmap
->
pixmap
,
get_bitmap_gc
(
physBitmap
->
pixmap_depth
),
0
,
0
,
0
,
0
,
bitmap
.
bmWidth
,
bitmap
.
bmHeight
);
}
...
...
dlls/winex11.drv/graphics.c
View file @
618b410a
...
...
@@ -1072,7 +1072,7 @@ X11DRV_GetPixel( X11DRV_PDEVICE *physDev, INT x, INT y )
/* to avoid a BadMatch error */
if
(
!
pixmap
)
pixmap
=
XCreatePixmap
(
gdi_display
,
root_window
,
1
,
1
,
physDev
->
depth
);
XCopyArea
(
gdi_display
,
physDev
->
drawable
,
pixmap
,
BITMAP_colorGC
,
XCopyArea
(
gdi_display
,
physDev
->
drawable
,
pixmap
,
get_bitmap_gc
(
physDev
->
depth
)
,
physDev
->
dc_rect
.
left
+
pt
.
x
,
physDev
->
dc_rect
.
top
+
pt
.
y
,
1
,
1
,
0
,
0
);
image
=
XGetImage
(
gdi_display
,
pixmap
,
0
,
0
,
1
,
1
,
AllPlanes
,
ZPixmap
);
}
...
...
dlls/winex11.drv/x11drv.h
View file @
618b410a
...
...
@@ -144,11 +144,10 @@ typedef struct
}
X11DRV_PDEVICE
;
/* GCs used for B&W and color bitmap operations */
extern
GC
BITMAP_monoGC
,
BITMAP_colorGC
;
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)
/* Retrieve the GC used for bitmap operations */
extern
GC
get_bitmap_gc
(
int
depth
);
/* Wine driver X11 functions */
...
...
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