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
dddc079d
Commit
dddc079d
authored
Jul 13, 2011
by
Huw Davies
Committed by
Alexandre Julliard
Jul 13, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Implement the conversion between two identical bitfield dibs.
parent
ebebee5b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
0 deletions
+37
-0
primitives.c
dlls/gdi32/dibdrv/primitives.c
+37
-0
No files found.
dlls/gdi32/dibdrv/primitives.c
View file @
dddc079d
...
...
@@ -719,6 +719,15 @@ static DWORD colorref_to_pixel_null(const dib_info *dib, COLORREF color)
return
0
;
}
static
inline
BOOL
bit_fields_match
(
const
dib_info
*
d1
,
const
dib_info
*
d2
)
{
assert
(
d1
->
bit_count
>
8
&&
d1
->
bit_count
==
d2
->
bit_count
);
return
d1
->
red_mask
==
d2
->
red_mask
&&
d1
->
green_mask
==
d2
->
green_mask
&&
d1
->
blue_mask
==
d2
->
blue_mask
;
}
static
BOOL
convert_to_8888
(
dib_info
*
dst
,
const
dib_info
*
src
,
const
RECT
*
src_rect
)
{
DWORD
*
dst_start
=
dst
->
bits
,
*
dst_pixel
,
src_val
;
...
...
@@ -904,6 +913,20 @@ static BOOL convert_to_32(dib_info *dst, const dib_info *src, const RECT *src_re
src_start
+=
src
->
stride
/
4
;
}
}
else
if
(
bit_fields_match
(
src
,
dst
))
{
if
(
src
->
stride
>
0
&&
dst
->
stride
>
0
&&
src_rect
->
left
==
0
&&
src_rect
->
right
==
src
->
width
)
memcpy
(
dst
->
bits
,
src_start
,
(
src_rect
->
bottom
-
src_rect
->
top
)
*
src
->
stride
);
else
{
for
(
y
=
src_rect
->
top
;
y
<
src_rect
->
bottom
;
y
++
)
{
memcpy
(
dst_start
,
src_start
,
(
src_rect
->
right
-
src_rect
->
left
)
*
4
);
dst_start
+=
dst
->
stride
/
4
;
src_start
+=
src
->
stride
/
4
;
}
}
}
else
{
FIXME
(
"Unsupported conversion: 32 -> 32
\n
"
);
...
...
@@ -1456,6 +1479,20 @@ static BOOL convert_to_16(dib_info *dst, const dib_info *src, const RECT *src_re
src_start
+=
src
->
stride
/
2
;
}
}
else
if
(
bit_fields_match
(
src
,
dst
))
{
if
(
src
->
stride
>
0
&&
dst
->
stride
>
0
&&
src_rect
->
left
==
0
&&
src_rect
->
right
==
src
->
width
)
memcpy
(
dst
->
bits
,
src_start
,
(
src_rect
->
bottom
-
src_rect
->
top
)
*
src
->
stride
);
else
{
for
(
y
=
src_rect
->
top
;
y
<
src_rect
->
bottom
;
y
++
)
{
memcpy
(
dst_start
,
src_start
,
(
src_rect
->
right
-
src_rect
->
left
)
*
2
);
dst_start
+=
dst
->
stride
/
2
;
src_start
+=
src
->
stride
/
2
;
}
}
}
else
{
FIXME
(
"Unsupported conversion: 16 -> 16
\n
"
);
...
...
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