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
1da138ce
Commit
1da138ce
authored
Aug 02, 2011
by
Huw Davies
Committed by
Alexandre Julliard
Aug 02, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Move the colour setting to a separate function.
parent
2521bf3c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
33 deletions
+42
-33
dc.c
dlls/gdi32/dibdrv/dc.c
+42
-33
No files found.
dlls/gdi32/dibdrv/dc.c
View file @
1da138ce
...
...
@@ -306,6 +306,46 @@ static BOOL dibdrv_DeleteDC( PHYSDEV dev )
return
0
;
}
static
void
set_color_info
(
const
dib_info
*
dib
,
BITMAPINFO
*
info
)
{
info
->
bmiHeader
.
biCompression
=
BI_RGB
;
info
->
bmiHeader
.
biClrUsed
=
0
;
switch
(
info
->
bmiHeader
.
biBitCount
)
{
case
1
:
case
4
:
case
8
:
if
(
dib
->
color_table
)
{
info
->
bmiHeader
.
biClrUsed
=
min
(
dib
->
color_table_size
,
1
<<
dib
->
bit_count
);
memcpy
(
info
->
bmiColors
,
dib
->
color_table
,
info
->
bmiHeader
.
biClrUsed
*
sizeof
(
RGBQUAD
)
);
}
break
;
case
16
:
if
(
dib
->
funcs
!=
&
funcs_555
)
{
DWORD
*
masks
=
(
DWORD
*
)
info
->
bmiColors
;
masks
[
0
]
=
dib
->
red_mask
;
masks
[
1
]
=
dib
->
green_mask
;
masks
[
2
]
=
dib
->
blue_mask
;
info
->
bmiHeader
.
biCompression
=
BI_BITFIELDS
;
}
break
;
case
32
:
if
(
dib
->
funcs
!=
&
funcs_8888
)
{
DWORD
*
masks
=
(
DWORD
*
)
info
->
bmiColors
;
masks
[
0
]
=
dib
->
red_mask
;
masks
[
1
]
=
dib
->
green_mask
;
masks
[
2
]
=
dib
->
blue_mask
;
info
->
bmiHeader
.
biCompression
=
BI_BITFIELDS
;
}
break
;
}
}
/***********************************************************************
* dibdrv_GetImage
*/
...
...
@@ -379,39 +419,8 @@ static DWORD dibdrv_GetImage( PHYSDEV dev, HBITMAP hbitmap, BITMAPINFO *info,
info
->
bmiHeader
.
biBitCount
=
pdev
->
dib
.
bit_count
;
info
->
bmiHeader
.
biSizeImage
=
pdev
->
dib
.
height
*
abs
(
pdev
->
dib
.
stride
);
switch
(
info
->
bmiHeader
.
biBitCount
)
{
case
1
:
case
4
:
case
8
:
if
(
pdev
->
dib
.
color_table
)
{
info
->
bmiHeader
.
biClrUsed
=
min
(
pdev
->
dib
.
color_table_size
,
1
<<
pdev
->
dib
.
bit_count
);
memcpy
(
info
->
bmiColors
,
pdev
->
dib
.
color_table
,
info
->
bmiHeader
.
biClrUsed
*
sizeof
(
RGBQUAD
)
);
}
break
;
case
16
:
if
(
pdev
->
dib
.
funcs
!=
&
funcs_555
)
{
DWORD
*
masks
=
(
DWORD
*
)
info
->
bmiColors
;
masks
[
0
]
=
pdev
->
dib
.
red_mask
;
masks
[
1
]
=
pdev
->
dib
.
green_mask
;
masks
[
2
]
=
pdev
->
dib
.
blue_mask
;
info
->
bmiHeader
.
biCompression
=
BI_BITFIELDS
;
}
break
;
case
32
:
if
(
pdev
->
dib
.
funcs
!=
&
funcs_8888
)
{
DWORD
*
masks
=
(
DWORD
*
)
info
->
bmiColors
;
masks
[
0
]
=
pdev
->
dib
.
red_mask
;
masks
[
1
]
=
pdev
->
dib
.
green_mask
;
masks
[
2
]
=
pdev
->
dib
.
blue_mask
;
info
->
bmiHeader
.
biCompression
=
BI_BITFIELDS
;
}
break
;
}
set_color_info
(
&
pdev
->
dib
,
info
);
if
(
bits
)
{
bits
->
ptr
=
pdev
->
dib
.
bits
;
...
...
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