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
ba3d3487
Commit
ba3d3487
authored
Apr 05, 2011
by
Huw Davies
Committed by
Alexandre Julliard
Apr 05, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Add support for 32 bpp BI_BITFIELDS.
parent
0c5e7a6d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
57 additions
and
4 deletions
+57
-4
dc.c
dlls/gdi32/dibdrv/dc.c
+24
-4
dibdrv.h
dlls/gdi32/dibdrv/dibdrv.h
+1
-0
primitives.c
dlls/gdi32/dibdrv/primitives.c
+30
-0
gdi_private.h
dlls/gdi32/gdi_private.h
+2
-0
No files found.
dlls/gdi32/dibdrv/dc.c
View file @
ba3d3487
...
...
@@ -36,11 +36,34 @@ static BOOL CDECL dibdrv_DeleteDC( PHYSDEV dev )
return
0
;
}
static
void
calc_shift_and_len
(
DWORD
mask
,
int
*
shift
,
int
*
len
)
{
int
s
,
l
;
s
=
0
;
while
((
mask
&
1
)
==
0
)
{
mask
>>=
1
;
s
++
;
}
l
=
0
;
while
((
mask
&
1
)
==
1
)
{
mask
>>=
1
;
l
++
;
}
*
shift
=
s
;
*
len
=
l
;
}
static
void
init_bit_fields
(
dib_info
*
dib
,
const
DWORD
*
bit_fields
)
{
dib
->
red_mask
=
bit_fields
[
0
];
dib
->
green_mask
=
bit_fields
[
1
];
dib
->
blue_mask
=
bit_fields
[
2
];
calc_shift_and_len
(
dib
->
red_mask
,
&
dib
->
red_shift
,
&
dib
->
red_len
);
calc_shift_and_len
(
dib
->
green_mask
,
&
dib
->
green_shift
,
&
dib
->
green_len
);
calc_shift_and_len
(
dib
->
blue_mask
,
&
dib
->
blue_shift
,
&
dib
->
blue_len
);
}
static
BOOL
init_dib
(
dib_info
*
dib
,
const
BITMAPINFOHEADER
*
bi
,
const
DWORD
*
bit_fields
,
void
*
bits
)
...
...
@@ -71,10 +94,7 @@ static BOOL init_dib(dib_info *dib, const BITMAPINFOHEADER *bi, const DWORD *bit
if
(
dib
->
red_mask
==
0xff0000
&&
dib
->
green_mask
==
0x00ff00
&&
dib
->
blue_mask
==
0x0000ff
)
dib
->
funcs
=
&
funcs_8888
;
else
{
TRACE
(
"32 bpp bitmasks not supported, will forward to graphics driver.
\n
"
);
return
FALSE
;
}
dib
->
funcs
=
&
funcs_32
;
break
;
default:
...
...
dlls/gdi32/dibdrv/dibdrv.h
View file @
ba3d3487
...
...
@@ -29,4 +29,5 @@ typedef struct primitive_funcs
}
primitive_funcs
;
extern
const
primitive_funcs
funcs_8888
DECLSPEC_HIDDEN
;
extern
const
primitive_funcs
funcs_32
DECLSPEC_HIDDEN
;
extern
const
primitive_funcs
funcs_null
DECLSPEC_HIDDEN
;
dlls/gdi32/dibdrv/primitives.c
View file @
ba3d3487
...
...
@@ -26,6 +26,31 @@ static DWORD colorref_to_pixel_888(const dib_info *dib, COLORREF color)
return
(
((
color
>>
16
)
&
0xff
)
|
(
color
&
0xff00
)
|
((
color
<<
16
)
&
0xff0000
)
);
}
static
inline
DWORD
put_field
(
DWORD
field
,
int
shift
,
int
len
)
{
shift
=
shift
-
(
8
-
len
);
if
(
len
<=
8
)
field
&=
(((
1
<<
len
)
-
1
)
<<
(
8
-
len
));
if
(
shift
<
0
)
field
>>=
-
shift
;
else
field
<<=
shift
;
return
field
;
}
static
DWORD
colorref_to_pixel_masks
(
const
dib_info
*
dib
,
COLORREF
colour
)
{
DWORD
r
,
g
,
b
;
r
=
GetRValue
(
colour
);
g
=
GetGValue
(
colour
);
b
=
GetBValue
(
colour
);
return
put_field
(
r
,
dib
->
red_shift
,
dib
->
red_len
)
|
put_field
(
g
,
dib
->
green_shift
,
dib
->
green_len
)
|
put_field
(
b
,
dib
->
blue_shift
,
dib
->
blue_len
);
}
static
DWORD
colorref_to_pixel_null
(
const
dib_info
*
dib
,
COLORREF
color
)
{
return
0
;
...
...
@@ -36,6 +61,11 @@ const primitive_funcs funcs_8888 =
colorref_to_pixel_888
};
const
primitive_funcs
funcs_32
=
{
colorref_to_pixel_masks
};
const
primitive_funcs
funcs_null
=
{
colorref_to_pixel_null
...
...
dlls/gdi32/gdi_private.h
View file @
ba3d3487
...
...
@@ -86,6 +86,8 @@ typedef struct
void
*
bits
;
/* points to the top-left corner of the dib. */
DWORD
red_mask
,
green_mask
,
blue_mask
;
int
red_shift
,
green_shift
,
blue_shift
;
int
red_len
,
green_len
,
blue_len
;
const
struct
primitive_funcs
*
funcs
;
}
dib_info
;
...
...
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