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
146ad997
Commit
146ad997
authored
Jun 01, 2011
by
Huw Davies
Committed by
Alexandre Julliard
Jun 01, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Add support for 24 bpp brushes.
parent
ce2c593d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
174 additions
and
0 deletions
+174
-0
primitives.c
dlls/gdi32/dibdrv/primitives.c
+174
-0
No files found.
dlls/gdi32/dibdrv/primitives.c
View file @
146ad997
...
...
@@ -626,6 +626,29 @@ static BOOL convert_to_8888(dib_info *dst, const dib_info *src, const RECT *src_
break
;
}
case
24
:
{
BYTE
*
src_start
=
get_pixel_ptr_24
(
src
,
src_rect
->
left
,
src_rect
->
top
),
*
src_pixel
;
for
(
y
=
src_rect
->
top
;
y
<
src_rect
->
bottom
;
y
++
)
{
dst_pixel
=
dst_start
;
src_pixel
=
src_start
;
for
(
x
=
src_rect
->
left
;
x
<
src_rect
->
right
;
x
++
)
{
RGBQUAD
rgb
;
rgb
.
rgbBlue
=
*
src_pixel
++
;
rgb
.
rgbGreen
=
*
src_pixel
++
;
rgb
.
rgbRed
=
*
src_pixel
++
;
*
dst_pixel
++
=
((
rgb
.
rgbRed
<<
16
)
&
0xff0000
)
|
((
rgb
.
rgbGreen
<<
8
)
&
0x00ff00
)
|
(
rgb
.
rgbBlue
&
0x0000ff
);
}
dst_start
+=
dst
->
stride
/
4
;
src_start
+=
src
->
stride
;
}
break
;
}
case
16
:
{
WORD
*
src_start
=
get_pixel_ptr_16
(
src
,
src_rect
->
left
,
src_rect
->
top
),
*
src_pixel
;
...
...
@@ -743,6 +766,31 @@ static BOOL convert_to_32(dib_info *dst, const dib_info *src, const RECT *src_re
break
;
}
case
24
:
{
BYTE
*
src_start
=
get_pixel_ptr_24
(
src
,
src_rect
->
left
,
src_rect
->
top
),
*
src_pixel
;
for
(
y
=
src_rect
->
top
;
y
<
src_rect
->
bottom
;
y
++
)
{
dst_pixel
=
dst_start
;
src_pixel
=
src_start
;
for
(
x
=
src_rect
->
left
;
x
<
src_rect
->
right
;
x
++
)
{
RGBQUAD
rgb
;
rgb
.
rgbBlue
=
*
src_pixel
++
;
rgb
.
rgbGreen
=
*
src_pixel
++
;
rgb
.
rgbRed
=
*
src_pixel
++
;
*
dst_pixel
++
=
put_field
(
rgb
.
rgbRed
,
dst
->
red_shift
,
dst
->
red_len
)
|
put_field
(
rgb
.
rgbGreen
,
dst
->
green_shift
,
dst
->
green_len
)
|
put_field
(
rgb
.
rgbBlue
,
dst
->
blue_shift
,
dst
->
blue_len
);
}
dst_start
+=
dst
->
stride
/
4
;
src_start
+=
src
->
stride
;
}
break
;
}
case
16
:
{
WORD
*
src_start
=
get_pixel_ptr_16
(
src
,
src_rect
->
left
,
src_rect
->
top
),
*
src_pixel
;
...
...
@@ -864,6 +912,24 @@ static BOOL convert_to_24(dib_info *dst, const dib_info *src, const RECT *src_re
break
;
}
case
24
:
{
BYTE
*
src_start
=
get_pixel_ptr_24
(
src
,
src_rect
->
left
,
src_rect
->
top
);
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
)
*
3
);
dst_start
+=
dst
->
stride
;
src_start
+=
src
->
stride
;
}
}
break
;
}
case
16
:
{
WORD
*
src_start
=
get_pixel_ptr_16
(
src
,
src_rect
->
left
,
src_rect
->
top
),
*
src_pixel
;
...
...
@@ -986,6 +1052,31 @@ static BOOL convert_to_555(dib_info *dst, const dib_info *src, const RECT *src_r
break
;
}
case
24
:
{
BYTE
*
src_start
=
get_pixel_ptr_24
(
src
,
src_rect
->
left
,
src_rect
->
top
),
*
src_pixel
;
for
(
y
=
src_rect
->
top
;
y
<
src_rect
->
bottom
;
y
++
)
{
dst_pixel
=
dst_start
;
src_pixel
=
src_start
;
for
(
x
=
src_rect
->
left
;
x
<
src_rect
->
right
;
x
++
)
{
RGBQUAD
rgb
;
rgb
.
rgbBlue
=
*
src_pixel
++
;
rgb
.
rgbGreen
=
*
src_pixel
++
;
rgb
.
rgbRed
=
*
src_pixel
++
;
*
dst_pixel
++
=
((
rgb
.
rgbRed
<<
7
)
&
0x7c00
)
|
((
rgb
.
rgbGreen
<<
2
)
&
0x03e0
)
|
((
rgb
.
rgbBlue
>>
3
)
&
0x001f
);
}
dst_start
+=
dst
->
stride
/
2
;
src_start
+=
src
->
stride
;
}
break
;
}
case
16
:
{
WORD
*
src_start
=
get_pixel_ptr_16
(
src
,
src_rect
->
left
,
src_rect
->
top
);
...
...
@@ -1105,6 +1196,31 @@ static BOOL convert_to_16(dib_info *dst, const dib_info *src, const RECT *src_re
break
;
}
case
24
:
{
BYTE
*
src_start
=
get_pixel_ptr_24
(
src
,
src_rect
->
left
,
src_rect
->
top
),
*
src_pixel
;
for
(
y
=
src_rect
->
top
;
y
<
src_rect
->
bottom
;
y
++
)
{
dst_pixel
=
dst_start
;
src_pixel
=
src_start
;
for
(
x
=
src_rect
->
left
;
x
<
src_rect
->
right
;
x
++
)
{
RGBQUAD
rgb
;
rgb
.
rgbBlue
=
*
src_pixel
++
;
rgb
.
rgbGreen
=
*
src_pixel
++
;
rgb
.
rgbRed
=
*
src_pixel
++
;
*
dst_pixel
++
=
put_field
(
rgb
.
rgbRed
,
dst
->
red_shift
,
dst
->
red_len
)
|
put_field
(
rgb
.
rgbGreen
,
dst
->
green_shift
,
dst
->
green_len
)
|
put_field
(
rgb
.
rgbBlue
,
dst
->
blue_shift
,
dst
->
blue_len
);
}
dst_start
+=
dst
->
stride
/
2
;
src_start
+=
src
->
stride
;
}
break
;
}
case
16
:
{
WORD
*
src_start
=
get_pixel_ptr_16
(
src
,
src_rect
->
left
,
src_rect
->
top
),
*
src_pixel
;
...
...
@@ -1235,6 +1351,31 @@ static BOOL convert_to_8(dib_info *dst, const dib_info *src, const RECT *src_rec
break
;
}
case
24
:
{
BYTE
*
src_start
=
get_pixel_ptr_24
(
src
,
src_rect
->
left
,
src_rect
->
top
),
*
src_pixel
;
for
(
y
=
src_rect
->
top
;
y
<
src_rect
->
bottom
;
y
++
)
{
dst_pixel
=
dst_start
;
src_pixel
=
src_start
;
for
(
x
=
src_rect
->
left
;
x
<
src_rect
->
right
;
x
++
)
{
RGBQUAD
rgb
;
rgb
.
rgbBlue
=
*
src_pixel
++
;
rgb
.
rgbGreen
=
*
src_pixel
++
;
rgb
.
rgbRed
=
*
src_pixel
++
;
*
dst_pixel
++
=
colorref_to_pixel_colortable
(
dst
,
(
rgb
.
rgbRed
&
0x0000ff
)
|
((
rgb
.
rgbGreen
<<
8
)
&
0x00ff00
)
|
((
rgb
.
rgbBlue
<<
16
)
&
0xff0000
));
}
dst_start
+=
dst
->
stride
;
src_start
+=
src
->
stride
;
}
break
;
}
case
16
:
{
WORD
*
src_start
=
get_pixel_ptr_16
(
src
,
src_rect
->
left
,
src_rect
->
top
),
*
src_pixel
;
...
...
@@ -1378,6 +1519,39 @@ static BOOL convert_to_4(dib_info *dst, const dib_info *src, const RECT *src_rec
break
;
}
case
24
:
{
BYTE
*
src_start
=
get_pixel_ptr_24
(
src
,
src_rect
->
left
,
src_rect
->
top
),
*
src_pixel
;
for
(
y
=
src_rect
->
top
;
y
<
src_rect
->
bottom
;
y
++
)
{
dst_pixel
=
dst_start
;
src_pixel
=
src_start
;
for
(
x
=
src_rect
->
left
;
x
<
src_rect
->
right
;
x
++
)
{
RGBQUAD
rgb
;
rgb
.
rgbBlue
=
*
src_pixel
++
;
rgb
.
rgbGreen
=
*
src_pixel
++
;
rgb
.
rgbRed
=
*
src_pixel
++
;
dst_val
=
colorref_to_pixel_colortable
(
dst
,
(
rgb
.
rgbRed
&
0x0000ff
)
|
((
rgb
.
rgbGreen
<<
8
)
&
0x00ff00
)
|
((
rgb
.
rgbBlue
<<
16
)
&
0xff0000
));
if
((
x
-
src_rect
->
left
)
&
1
)
{
*
dst_pixel
=
(
dst_val
&
0x0f
)
|
(
*
dst_pixel
&
0xf0
);
dst_pixel
++
;
}
else
*
dst_pixel
=
(
dst_val
<<
4
)
&
0xf0
;
}
dst_start
+=
dst
->
stride
;
src_start
+=
src
->
stride
;
}
break
;
}
case
16
:
{
WORD
*
src_start
=
get_pixel_ptr_16
(
src
,
src_rect
->
left
,
src_rect
->
top
),
*
src_pixel
;
...
...
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