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
d21dde71
Commit
d21dde71
authored
Oct 13, 1999
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Authors: Chris Morgan <cmorgan@wpi.edu>, James Abbatiello <abbeyj@wpi.edu>
Fixes problems with color drift when switching to/from logical/physical colors.
parent
30eaa59c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
palette.c
graphics/x11drv/palette.c
+9
-6
No files found.
graphics/x11drv/palette.c
View file @
d21dde71
...
@@ -631,9 +631,9 @@ COLORREF X11DRV_PALETTE_ToLogical(int pixel)
...
@@ -631,9 +631,9 @@ COLORREF X11DRV_PALETTE_ToLogical(int pixel)
color
.
red
=
(
pixel
>>
X11DRV_PALETTE_Redshift
)
&
X11DRV_PALETTE_Redmax
;
color
.
red
=
(
pixel
>>
X11DRV_PALETTE_Redshift
)
&
X11DRV_PALETTE_Redmax
;
color
.
green
=
(
pixel
>>
X11DRV_PALETTE_Greenshift
)
&
X11DRV_PALETTE_Greenmax
;
color
.
green
=
(
pixel
>>
X11DRV_PALETTE_Greenshift
)
&
X11DRV_PALETTE_Greenmax
;
color
.
blue
=
(
pixel
>>
X11DRV_PALETTE_Blueshift
)
&
X11DRV_PALETTE_Bluemax
;
color
.
blue
=
(
pixel
>>
X11DRV_PALETTE_Blueshift
)
&
X11DRV_PALETTE_Bluemax
;
return
RGB
(
(
color
.
red
*
255
)
/
X11DRV_PALETTE_Redmax
,
return
RGB
(
MulDiv
(
color
.
red
,
255
,
X11DRV_PALETTE_Redmax
)
,
(
color
.
green
*
255
)
/
X11DRV_PALETTE_Greenmax
,
MulDiv
(
color
.
green
,
255
,
X11DRV_PALETTE_Greenmax
)
,
(
color
.
blue
*
255
)
/
X11DRV_PALETTE_Bluemax
);
MulDiv
(
color
.
blue
,
255
,
X11DRV_PALETTE_Bluemax
)
);
}
}
/* check if we can bypass X */
/* check if we can bypass X */
...
@@ -716,9 +716,12 @@ int X11DRV_PALETTE_ToPhysical( DC *dc, COLORREF color )
...
@@ -716,9 +716,12 @@ int X11DRV_PALETTE_ToPhysical( DC *dc, COLORREF color )
else
else
{
{
/* scale each individually and construct the TrueColor pixel value */
/* scale each individually and construct the TrueColor pixel value */
if
(
X11DRV_PALETTE_Redmax
!=
255
)
red
=
(
red
*
X11DRV_PALETTE_Redmax
)
/
255
;
if
(
X11DRV_PALETTE_Redmax
!=
255
)
if
(
X11DRV_PALETTE_Greenmax
!=
255
)
green
=
(
green
*
X11DRV_PALETTE_Greenmax
)
/
255
;
red
=
MulDiv
(
red
,
X11DRV_PALETTE_Redmax
,
255
);
if
(
X11DRV_PALETTE_Bluemax
!=
255
)
blue
=
(
blue
*
X11DRV_PALETTE_Bluemax
)
/
255
;
if
(
X11DRV_PALETTE_Greenmax
!=
255
)
green
=
MulDiv
(
green
,
X11DRV_PALETTE_Greenmax
,
255
);
if
(
X11DRV_PALETTE_Bluemax
!=
255
)
blue
=
MulDiv
(
blue
,
X11DRV_PALETTE_Bluemax
,
255
);
GDI_HEAP_UNLOCK
(
hPal
);
GDI_HEAP_UNLOCK
(
hPal
);
return
(
red
<<
X11DRV_PALETTE_Redshift
)
|
(
green
<<
X11DRV_PALETTE_Greenshift
)
|
(
blue
<<
X11DRV_PALETTE_Blueshift
);
return
(
red
<<
X11DRV_PALETTE_Redshift
)
|
(
green
<<
X11DRV_PALETTE_Greenshift
)
|
(
blue
<<
X11DRV_PALETTE_Blueshift
);
...
...
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