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
3afa6576
Commit
3afa6576
authored
Feb 16, 2010
by
Roderick Colenbrander
Committed by
Alexandre Julliard
Feb 16, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11: Fix palette conversion bug.
The LookupPixel code assumed we want to convert pixels to the format corresponding the default color shifts.
parent
f9756519
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
6 deletions
+8
-6
dib.c
dlls/winex11.drv/dib.c
+2
-2
palette.c
dlls/winex11.drv/palette.c
+5
-3
x11drv.h
dlls/winex11.drv/x11drv.h
+1
-1
No files found.
dlls/winex11.drv/dib.c
View file @
3afa6576
...
...
@@ -371,7 +371,7 @@ static int *X11DRV_DIB_GenColorMap( X11DRV_PDEVICE *physDev, int *colorMapping,
}
else
for
(
i
=
start
;
i
<
end
;
i
++
,
rgb
++
)
colorMapping
[
i
]
=
X11DRV_PALETTE_LookupPixel
(
RGB
(
rgb
->
rgbRed
,
colorMapping
[
i
]
=
X11DRV_PALETTE_LookupPixel
(
physDev
->
color_shifts
,
RGB
(
rgb
->
rgbRed
,
rgb
->
rgbGreen
,
rgb
->
rgbBlue
));
}
...
...
@@ -395,7 +395,7 @@ static int *X11DRV_DIB_GenColorMap( X11DRV_PDEVICE *physDev, int *colorMapping,
}
else
for
(
i
=
start
;
i
<
end
;
i
++
,
rgb
++
)
colorMapping
[
i
]
=
X11DRV_PALETTE_LookupPixel
(
RGB
(
rgb
->
rgbtRed
,
colorMapping
[
i
]
=
X11DRV_PALETTE_LookupPixel
(
physDev
->
color_shifts
,
RGB
(
rgb
->
rgbtRed
,
rgb
->
rgbtGreen
,
rgb
->
rgbtBlue
));
}
...
...
dlls/winex11.drv/palette.c
View file @
3afa6576
...
...
@@ -1026,7 +1026,7 @@ int X11DRV_PALETTE_ToPhysical( X11DRV_PDEVICE *physDev, COLORREF color )
/***********************************************************************
* X11DRV_PALETTE_LookupPixel
*/
int
X11DRV_PALETTE_LookupPixel
(
COLORREF
color
)
int
X11DRV_PALETTE_LookupPixel
(
C
olorShifts
*
shifts
,
C
OLORREF
color
)
{
unsigned
char
spec_type
=
color
>>
24
;
...
...
@@ -1048,7 +1048,9 @@ int X11DRV_PALETTE_LookupPixel(COLORREF color )
}
else
{
ColorShifts
*
shifts
=
&
X11DRV_PALETTE_default_shifts
;
/* No shifts are set in case of 1-bit */
if
(
!
shifts
)
shifts
=
&
X11DRV_PALETTE_default_shifts
;
/* scale each individually and construct the TrueColor pixel value */
if
(
shifts
->
physicalRed
.
scale
<
8
)
red
=
red
>>
(
8
-
shifts
->
physicalRed
.
scale
);
...
...
@@ -1265,7 +1267,7 @@ UINT X11DRV_RealizePalette( X11DRV_PDEVICE *physDev, HPALETTE hpal, BOOL primary
}
else
if
(
X11DRV_PALETTE_PaletteFlags
&
X11DRV_PALETTE_VIRTUAL
)
{
index
=
X11DRV_PALETTE_LookupPixel
(
RGB
(
entries
[
i
].
peRed
,
entries
[
i
].
peGreen
,
entries
[
i
].
peBlue
));
index
=
X11DRV_PALETTE_LookupPixel
(
physDev
->
color_shifts
,
RGB
(
entries
[
i
].
peRed
,
entries
[
i
].
peGreen
,
entries
[
i
].
peBlue
));
}
/* we have to map to existing entry in the system palette */
...
...
dlls/winex11.drv/x11drv.h
View file @
3afa6576
...
...
@@ -491,7 +491,7 @@ extern BOOL X11DRV_IsSolidColor(COLORREF color);
extern
COLORREF
X11DRV_PALETTE_ToLogical
(
X11DRV_PDEVICE
*
physDev
,
int
pixel
);
extern
int
X11DRV_PALETTE_ToPhysical
(
X11DRV_PDEVICE
*
physDev
,
COLORREF
color
);
extern
int
X11DRV_PALETTE_LookupPixel
(
COLORREF
color
);
extern
int
X11DRV_PALETTE_LookupPixel
(
C
olorShifts
*
shifts
,
C
OLORREF
color
);
extern
void
X11DRV_PALETTE_ComputeColorShifts
(
ColorShifts
*
shifts
,
unsigned
long
redMask
,
unsigned
long
greenMask
,
unsigned
long
blueMask
);
extern
unsigned
int
depth_to_bpp
(
unsigned
int
depth
);
...
...
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