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
98dd61e2
Commit
98dd61e2
authored
Jan 11, 2012
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11: Don't cache text and background pixel values to support PALETTEINDEX properly.
parent
aba9ddc4
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
43 deletions
+25
-43
bitblt.c
dlls/winex11.drv/bitblt.c
+12
-6
graphics.c
dlls/winex11.drv/graphics.c
+6
-29
init.c
dlls/winex11.drv/init.c
+2
-2
text.c
dlls/winex11.drv/text.c
+5
-2
x11drv.h
dlls/winex11.drv/x11drv.h
+0
-4
No files found.
dlls/winex11.drv/bitblt.c
View file @
98dd61e2
...
...
@@ -850,9 +850,12 @@ BOOL X11DRV_StretchBlt( PHYSDEV dst_dev, struct bitblt_coords *dst,
}
if
(
physDevSrc
->
depth
==
1
)
{
int
text_pixel
=
X11DRV_PALETTE_ToPhysical
(
physDevDst
,
GetTextColor
(
physDevDst
->
dev
.
hdc
)
);
int
bkgnd_pixel
=
X11DRV_PALETTE_ToPhysical
(
physDevDst
,
GetBkColor
(
physDevDst
->
dev
.
hdc
)
);
wine_tsx11_lock
();
XSetBackground
(
gdi_display
,
physDevDst
->
gc
,
physDevDst
->
textP
ixel
);
XSetForeground
(
gdi_display
,
physDevDst
->
gc
,
physDevDst
->
backgroundP
ixel
);
XSetBackground
(
gdi_display
,
physDevDst
->
gc
,
text_p
ixel
);
XSetForeground
(
gdi_display
,
physDevDst
->
gc
,
bkgnd_p
ixel
);
XSetFunction
(
gdi_display
,
physDevDst
->
gc
,
OP_ROP
(
*
opcode
)
);
XCopyPlane
(
gdi_display
,
physDevSrc
->
drawable
,
physDevDst
->
drawable
,
physDevDst
->
gc
,
...
...
@@ -881,15 +884,18 @@ BOOL X11DRV_StretchBlt( PHYSDEV dst_dev, struct bitblt_coords *dst,
to color or vice versa, the foreground and background color of
the device context are used. In fact, it also applies to the
case when it is converted from mono to mono. */
int
text_pixel
=
X11DRV_PALETTE_ToPhysical
(
physDevDst
,
GetTextColor
(
physDevDst
->
dev
.
hdc
)
);
int
bkgnd_pixel
=
X11DRV_PALETTE_ToPhysical
(
physDevDst
,
GetBkColor
(
physDevDst
->
dev
.
hdc
)
);
if
(
X11DRV_PALETTE_XPixelToPalette
&&
physDevDst
->
depth
!=
1
)
{
XSetBackground
(
gdi_display
,
gc
,
X11DRV_PALETTE_XPixelToPalette
[
physDevDst
->
textP
ixel
]
);
XSetForeground
(
gdi_display
,
gc
,
X11DRV_PALETTE_XPixelToPalette
[
physDevDst
->
backgroundP
ixel
]);
XSetBackground
(
gdi_display
,
gc
,
X11DRV_PALETTE_XPixelToPalette
[
text_p
ixel
]
);
XSetForeground
(
gdi_display
,
gc
,
X11DRV_PALETTE_XPixelToPalette
[
bkgnd_p
ixel
]);
}
else
{
XSetBackground
(
gdi_display
,
gc
,
physDevDst
->
textP
ixel
);
XSetForeground
(
gdi_display
,
gc
,
physDevDst
->
backgroundP
ixel
);
XSetBackground
(
gdi_display
,
gc
,
text_p
ixel
);
XSetForeground
(
gdi_display
,
gc
,
bkgnd_p
ixel
);
}
XCopyPlane
(
gdi_display
,
physDevSrc
->
drawable
,
src_pixmap
,
gc
,
physDevSrc
->
dc_rect
.
left
+
src
->
visrect
.
left
,
...
...
dlls/winex11.drv/graphics.c
View file @
98dd61e2
...
...
@@ -274,13 +274,13 @@ BOOL X11DRV_SetupGCForPatBlt( X11DRV_PDEVICE *physDev, GC gc, BOOL fMapColors )
* We need to swap foreground and background because
* Windows does it the wrong way...
*/
val
.
foreground
=
physDev
->
backgroundPixel
;
val
.
background
=
physDev
->
textPixel
;
val
.
foreground
=
X11DRV_PALETTE_ToPhysical
(
physDev
,
GetBkColor
(
physDev
->
dev
.
hdc
)
)
;
val
.
background
=
X11DRV_PALETTE_ToPhysical
(
physDev
,
GetTextColor
(
physDev
->
dev
.
hdc
)
)
;
}
else
{
val
.
foreground
=
physDev
->
brush
.
pixel
;
val
.
background
=
physDev
->
backgroundPixel
;
val
.
background
=
X11DRV_PALETTE_ToPhysical
(
physDev
,
GetBkColor
(
physDev
->
dev
.
hdc
)
)
;
}
if
(
fMapColors
&&
X11DRV_PALETTE_XPixelToPalette
)
{
...
...
@@ -399,7 +399,7 @@ static BOOL X11DRV_SetupGCForPen( X11DRV_PDEVICE *physDev )
val
.
foreground
=
physDev
->
pen
.
pixel
;
val
.
function
=
X11DRV_XROPfunction
[
rop2
-
1
];
}
val
.
background
=
physDev
->
backgroundPixel
;
val
.
background
=
X11DRV_PALETTE_ToPhysical
(
physDev
,
GetBkColor
(
physDev
->
dev
.
hdc
)
)
;
val
.
fill_style
=
FillSolid
;
val
.
line_width
=
physDev
->
pen
.
width
;
if
(
val
.
line_width
<=
1
)
{
...
...
@@ -463,8 +463,8 @@ BOOL X11DRV_SetupGCForText( X11DRV_PDEVICE *physDev )
XGCValues
val
;
val
.
function
=
GXcopy
;
/* Text is always GXcopy */
val
.
foreground
=
physDev
->
textPixel
;
val
.
background
=
physDev
->
backgroundPixel
;
val
.
foreground
=
X11DRV_PALETTE_ToPhysical
(
physDev
,
GetTextColor
(
physDev
->
dev
.
hdc
)
)
;
val
.
background
=
X11DRV_PALETTE_ToPhysical
(
physDev
,
GetBkColor
(
physDev
->
dev
.
hdc
)
)
;
val
.
fill_style
=
FillSolid
;
val
.
font
=
xfs
->
fid
;
...
...
@@ -1493,29 +1493,6 @@ fallback:
return
dev
->
funcs
->
pGradientFill
(
dev
,
vert_array
,
nvert
,
grad_array
,
ngrad
,
mode
);
}
/**********************************************************************
* X11DRV_SetBkColor
*/
COLORREF
X11DRV_SetBkColor
(
PHYSDEV
dev
,
COLORREF
color
)
{
X11DRV_PDEVICE
*
physDev
=
get_x11drv_dev
(
dev
);
physDev
->
backgroundPixel
=
X11DRV_PALETTE_ToPhysical
(
physDev
,
color
);
return
color
;
}
/**********************************************************************
* X11DRV_SetTextColor
*/
COLORREF
X11DRV_SetTextColor
(
PHYSDEV
dev
,
COLORREF
color
)
{
X11DRV_PDEVICE
*
physDev
=
get_x11drv_dev
(
dev
);
physDev
->
textPixel
=
X11DRV_PALETTE_ToPhysical
(
physDev
,
color
);
return
color
;
}
static
unsigned
char
*
get_icm_profile
(
unsigned
long
*
size
)
{
Atom
type
;
...
...
dlls/winex11.drv/init.c
View file @
98dd61e2
...
...
@@ -550,7 +550,7 @@ static const struct gdi_dc_funcs x11drv_funcs =
NULL
,
/* pSelectPalette */
X11DRV_SelectPen
,
/* pSelectPen */
NULL
,
/* pSetArcDirection */
X11DRV_SetBkColor
,
/* pSetBkColor */
NULL
,
/* pSetBkColor */
NULL
,
/* pSetBkMode */
X11DRV_SetDCBrushColor
,
/* pSetDCBrushColor */
X11DRV_SetDCPenColor
,
/* pSetDCPenColor */
...
...
@@ -568,7 +568,7 @@ static const struct gdi_dc_funcs x11drv_funcs =
NULL
,
/* pSetStretchBltMode */
NULL
,
/* pSetTextAlign */
NULL
,
/* pSetTextCharacterExtra */
X11DRV_SetTextColor
,
/* pSetTextColor */
NULL
,
/* pSetTextColor */
NULL
,
/* pSetTextJustification */
NULL
,
/* pSetViewportExt */
NULL
,
/* pSetViewportOrg */
...
...
dlls/winex11.drv/text.c
View file @
98dd61e2
...
...
@@ -43,6 +43,7 @@ BOOL X11DRV_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags,
X11DRV_PDEVICE
*
physDev
=
get_x11drv_dev
(
dev
);
BOOL
restore_region
=
FALSE
;
unsigned
int
i
;
int
pixel
;
fontObject
*
pfo
=
XFONT_GetFontObject
(
physDev
->
font
);
XFontStruct
*
font
;
BOOL
rotated
=
FALSE
;
...
...
@@ -70,8 +71,9 @@ BOOL X11DRV_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags,
if
(
flags
&
ETO_OPAQUE
)
{
pixel
=
X11DRV_PALETTE_ToPhysical
(
physDev
,
GetBkColor
(
physDev
->
dev
.
hdc
)
);
wine_tsx11_lock
();
XSetForeground
(
gdi_display
,
physDev
->
gc
,
p
hysDev
->
backgroundP
ixel
);
XSetForeground
(
gdi_display
,
physDev
->
gc
,
pixel
);
XFillRectangle
(
gdi_display
,
physDev
->
drawable
,
physDev
->
gc
,
physDev
->
dc_rect
.
left
+
lprect
->
left
,
physDev
->
dc_rect
.
top
+
lprect
->
top
,
lprect
->
right
-
lprect
->
left
,
lprect
->
bottom
-
lprect
->
top
);
...
...
@@ -97,8 +99,9 @@ BOOL X11DRV_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags,
goto
END
;
}
pixel
=
X11DRV_PALETTE_ToPhysical
(
physDev
,
GetTextColor
(
physDev
->
dev
.
hdc
)
);
wine_tsx11_lock
();
XSetForeground
(
gdi_display
,
physDev
->
gc
,
p
hysDev
->
textP
ixel
);
XSetForeground
(
gdi_display
,
physDev
->
gc
,
pixel
);
wine_tsx11_unlock
();
if
(
!
rotated
)
{
...
...
dlls/winex11.drv/x11drv.h
View file @
98dd61e2
...
...
@@ -141,8 +141,6 @@ typedef struct
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
;
int
depth
;
/* bit depth of the DC */
ColorShifts
*
color_shifts
;
/* color shifts of the DC */
int
exposures
;
/* count of graphics exposures operations */
...
...
@@ -210,14 +208,12 @@ extern HBITMAP X11DRV_SelectBitmap( PHYSDEV dev, HBITMAP hbitmap ) DECLSPEC_HIDD
extern
HBRUSH
X11DRV_SelectBrush
(
PHYSDEV
dev
,
HBRUSH
hbrush
,
const
struct
brush_pattern
*
pattern
)
DECLSPEC_HIDDEN
;
extern
HFONT
X11DRV_SelectFont
(
PHYSDEV
dev
,
HFONT
hfont
)
DECLSPEC_HIDDEN
;
extern
HPEN
X11DRV_SelectPen
(
PHYSDEV
dev
,
HPEN
hpen
,
const
struct
brush_pattern
*
pattern
)
DECLSPEC_HIDDEN
;
extern
COLORREF
X11DRV_SetBkColor
(
PHYSDEV
dev
,
COLORREF
color
)
DECLSPEC_HIDDEN
;
extern
COLORREF
X11DRV_SetDCBrushColor
(
PHYSDEV
dev
,
COLORREF
crColor
)
DECLSPEC_HIDDEN
;
extern
COLORREF
X11DRV_SetDCPenColor
(
PHYSDEV
dev
,
COLORREF
crColor
)
DECLSPEC_HIDDEN
;
extern
void
X11DRV_SetDeviceClipping
(
PHYSDEV
dev
,
HRGN
rgn
)
DECLSPEC_HIDDEN
;
extern
BOOL
X11DRV_SetDeviceGammaRamp
(
PHYSDEV
dev
,
LPVOID
ramp
)
DECLSPEC_HIDDEN
;
extern
COLORREF
X11DRV_SetPixel
(
PHYSDEV
dev
,
INT
x
,
INT
y
,
COLORREF
color
)
DECLSPEC_HIDDEN
;
extern
BOOL
X11DRV_SetPixelFormat
(
PHYSDEV
dev
,
int
iPixelFormat
,
const
PIXELFORMATDESCRIPTOR
*
ppfd
)
DECLSPEC_HIDDEN
;
extern
COLORREF
X11DRV_SetTextColor
(
PHYSDEV
dev
,
COLORREF
color
)
DECLSPEC_HIDDEN
;
extern
BOOL
X11DRV_StretchBlt
(
PHYSDEV
dst_dev
,
struct
bitblt_coords
*
dst
,
PHYSDEV
src_dev
,
struct
bitblt_coords
*
src
,
DWORD
rop
)
DECLSPEC_HIDDEN
;
extern
BOOL
X11DRV_UnrealizePalette
(
HPALETTE
hpal
)
DECLSPEC_HIDDEN
;
...
...
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