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
9968f308
Commit
9968f308
authored
May 23, 2012
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Use the default color table when mapping colors in bitmaps that don't have one.
parent
b8e4cd81
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
6 deletions
+12
-6
dibdrv.h
dlls/gdi32/dibdrv/dibdrv.h
+5
-0
objects.c
dlls/gdi32/dibdrv/objects.c
+7
-6
primitives.c
dlls/gdi32/dibdrv/primitives.c
+0
-0
No files found.
dlls/gdi32/dibdrv/dibdrv.h
View file @
9968f308
...
...
@@ -270,3 +270,8 @@ static inline int edge_coord( int y, int x1, int y1, int x2, int y2 )
else
return
x1
+
(
y
-
y1
)
*
(
x2
-
x1
)
/
(
y2
-
y1
);
}
static
inline
const
RGBQUAD
*
get_dib_color_table
(
const
dib_info
*
dib
)
{
return
dib
->
color_table
?
dib
->
color_table
:
get_default_color_table
(
dib
->
bit_count
);
}
dlls/gdi32/dibdrv/objects.c
View file @
9968f308
...
...
@@ -145,13 +145,12 @@ COLORREF make_rgb_colorref( HDC hdc, dib_info *dib, COLORREF color, BOOL *got_pi
if
(
color
>>
16
==
0x10ff
)
/* DIBINDEX */
{
const
RGBQUAD
*
color_table
=
get_dib_color_table
(
dib
);
WORD
index
=
LOWORD
(
color
);
*
got_pixel
=
TRUE
;
if
(
!
dib
->
color_table
||
index
>=
(
1
<<
dib
->
bit_count
))
return
0
;
if
(
!
color_table
||
index
>=
(
1
<<
dib
->
bit_count
))
return
0
;
*
pixel
=
index
;
return
RGB
(
dib
->
color_table
[
index
].
rgbRed
,
dib
->
color_table
[
index
].
rgbGreen
,
dib
->
color_table
[
index
].
rgbBlue
);
return
RGB
(
color_table
[
index
].
rgbRed
,
color_table
[
index
].
rgbGreen
,
color_table
[
index
].
rgbBlue
);
}
return
color
&
0xffffff
;
...
...
@@ -172,6 +171,7 @@ DWORD get_pixel_color( dibdrv_physdev *pdev, COLORREF color, BOOL mono_fixup )
BOOL
got_pixel
;
DWORD
pixel
;
COLORREF
rgb_ref
;
const
RGBQUAD
*
color_table
;
rgb_ref
=
make_rgb_colorref
(
pdev
->
dev
.
hdc
,
&
pdev
->
dib
,
color
,
&
got_pixel
,
&
pixel
);
if
(
got_pixel
)
return
pixel
;
...
...
@@ -179,10 +179,11 @@ DWORD get_pixel_color( dibdrv_physdev *pdev, COLORREF color, BOOL mono_fixup )
if
(
pdev
->
dib
.
bit_count
!=
1
||
!
mono_fixup
)
return
pdev
->
dib
.
funcs
->
colorref_to_pixel
(
&
pdev
->
dib
,
rgb_ref
);
color_table
=
get_dib_color_table
(
&
pdev
->
dib
);
fg_quad
=
rgbquad_from_colorref
(
rgb_ref
);
if
(
rgbquad_equal
(
&
fg_quad
,
pdev
->
dib
.
color_table
))
if
(
rgbquad_equal
(
&
fg_quad
,
color_table
))
return
0
;
if
(
rgbquad_equal
(
&
fg_quad
,
pdev
->
dib
.
color_table
+
1
))
if
(
rgbquad_equal
(
&
fg_quad
,
color_table
+
1
))
return
1
;
pixel
=
get_pixel_color
(
pdev
,
GetBkColor
(
pdev
->
dev
.
hdc
),
FALSE
);
...
...
dlls/gdi32/dibdrv/primitives.c
View file @
9968f308
This diff is collapsed.
Click to expand it.
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