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
e1ce79ec
Commit
e1ce79ec
authored
Aug 25, 2016
by
Huw Davies
Committed by
Alexandre Julliard
Aug 25, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Explicitly write out the rops for mask_rect_32().
Signed-off-by:
Huw Davies
<
huw@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
4b39c7b9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
71 additions
and
101 deletions
+71
-101
primitives.c
dlls/gdi32/dibdrv/primitives.c
+71
-101
No files found.
dlls/gdi32/dibdrv/primitives.c
View file @
e1ce79ec
...
...
@@ -125,6 +125,10 @@ case R2_MERGEPENNOT: LOOP( (_d) = (~(_d) | (_s)) ) break; \
case R2_MERGEPEN: LOOP( (_d) |= (_s) ) break; \
case R2_WHITE: LOOP( (_d) = ~0 ) break;
#define ROPS_ALL( _d, _s ) \
case R2_COPYPEN: LOOP( (_d) = (_s) ) break; \
ROPS_WITHOUT_COPY( (_d), (_s) )
static
inline
void
do_rop_32
(
DWORD
*
ptr
,
DWORD
and
,
DWORD
xor
)
{
*
ptr
=
(
*
ptr
&
and
)
^
xor
;
...
...
@@ -5312,13 +5316,10 @@ static void mask_rect_32( const dib_info *dst, const RECT *rc,
{
DWORD
*
dst_start
=
get_pixel_ptr_32
(
dst
,
rc
->
left
,
rc
->
top
),
dst_colors
[
256
];
DWORD
src_val
,
bit_val
,
i
,
full
,
pos
;
struct
rop_codes
codes
;
int
x
,
y
,
origin_end
=
origin
->
x
+
rc
->
right
-
rc
->
left
;
const
RGBQUAD
*
color_table
=
get_dib_color_table
(
src
);
BYTE
*
src_start
=
get_pixel_ptr_1
(
src
,
origin
->
x
,
origin
->
y
);
get_rop_codes
(
rop2
,
&
codes
);
if
(
dst
->
funcs
==
&
funcs_8888
)
for
(
i
=
0
;
i
<
2
;
i
++
)
dst_colors
[
i
]
=
color_table
[
i
].
rgbRed
<<
16
|
color_table
[
i
].
rgbGreen
<<
8
|
...
...
@@ -5336,6 +5337,10 @@ static void mask_rect_32( const dib_info *dst, const RECT *rc,
/* Special case starting and finishing in same byte, neither on byte boundary */
if
((
origin
->
x
&
7
)
&&
(
origin_end
&
7
)
&&
(
origin
->
x
&
~
7
)
==
(
origin_end
&
~
7
))
{
struct
rop_codes
codes
;
get_rop_codes
(
rop2
,
&
codes
);
for
(
y
=
rc
->
top
;
y
<
rc
->
bottom
;
y
++
)
{
pos
=
origin
->
x
&
7
;
...
...
@@ -5352,106 +5357,71 @@ static void mask_rect_32( const dib_info *dst, const RECT *rc,
full
=
((
rc
->
right
-
rc
->
left
)
-
((
8
-
(
origin
->
x
&
7
))
&
7
))
/
8
;
for
(
y
=
rc
->
top
;
y
<
rc
->
bottom
;
y
++
)
{
pos
=
origin
->
x
&
7
;
src_val
=
src_start
[
pos
/
8
];
x
=
0
;
switch
(
pos
&
7
)
{
case
1
:
bit_val
=
src_val
>>
6
;
do_rop_codes_32
(
dst_start
+
x
++
,
dst_colors
[
bit_val
],
&
codes
);
/* fall through */
case
2
:
bit_val
=
src_val
>>
5
;
do_rop_codes_32
(
dst_start
+
x
++
,
dst_colors
[
bit_val
],
&
codes
);
/* fall through */
case
3
:
bit_val
=
src_val
>>
4
;
do_rop_codes_32
(
dst_start
+
x
++
,
dst_colors
[
bit_val
],
&
codes
);
/* fall through */
case
4
:
bit_val
=
src_val
>>
3
;
do_rop_codes_32
(
dst_start
+
x
++
,
dst_colors
[
bit_val
],
&
codes
);
/* fall through */
case
5
:
bit_val
=
src_val
>>
2
;
do_rop_codes_32
(
dst_start
+
x
++
,
dst_colors
[
bit_val
],
&
codes
);
/* fall through */
case
6
:
bit_val
=
src_val
>>
1
;
do_rop_codes_32
(
dst_start
+
x
++
,
dst_colors
[
bit_val
],
&
codes
);
/* fall through */
case
7
:
bit_val
=
src_val
;
do_rop_codes_32
(
dst_start
+
x
++
,
dst_colors
[
bit_val
],
&
codes
);
pos
=
(
pos
+
7
)
&
~
7
;
}
for
(
i
=
0
;
i
<
full
;
i
++
,
pos
+=
8
)
{
src_val
=
src_start
[
pos
/
8
];
bit_val
=
src_val
>>
7
;
do_rop_codes_32
(
dst_start
+
x
++
,
dst_colors
[
bit_val
],
&
codes
);
bit_val
=
src_val
>>
6
;
do_rop_codes_32
(
dst_start
+
x
++
,
dst_colors
[
bit_val
],
&
codes
);
bit_val
=
src_val
>>
5
;
do_rop_codes_32
(
dst_start
+
x
++
,
dst_colors
[
bit_val
],
&
codes
);
bit_val
=
src_val
>>
4
;
do_rop_codes_32
(
dst_start
+
x
++
,
dst_colors
[
bit_val
],
&
codes
);
bit_val
=
src_val
>>
3
;
do_rop_codes_32
(
dst_start
+
x
++
,
dst_colors
[
bit_val
],
&
codes
);
bit_val
=
src_val
>>
2
;
do_rop_codes_32
(
dst_start
+
x
++
,
dst_colors
[
bit_val
],
&
codes
);
bit_val
=
src_val
>>
1
;
do_rop_codes_32
(
dst_start
+
x
++
,
dst_colors
[
bit_val
],
&
codes
);
bit_val
=
src_val
;
do_rop_codes_32
(
dst_start
+
x
++
,
dst_colors
[
bit_val
],
&
codes
);
}
if
(
origin_end
&
7
)
{
src_val
=
src_start
[
pos
/
8
];
x
+=
(
origin_end
&
7
)
-
1
;
switch
(
origin_end
&
7
)
{
case
7
:
bit_val
=
src_val
>>
1
;
do_rop_codes_32
(
dst_start
+
x
--
,
dst_colors
[
bit_val
],
&
codes
);
/* fall through */
case
6
:
bit_val
=
src_val
>>
2
;
do_rop_codes_32
(
dst_start
+
x
--
,
dst_colors
[
bit_val
],
&
codes
);
/* fall through */
case
5
:
bit_val
=
src_val
>>
3
;
do_rop_codes_32
(
dst_start
+
x
--
,
dst_colors
[
bit_val
],
&
codes
);
/* fall through */
case
4
:
bit_val
=
src_val
>>
4
;
do_rop_codes_32
(
dst_start
+
x
--
,
dst_colors
[
bit_val
],
&
codes
);
/* fall through */
case
3
:
bit_val
=
src_val
>>
5
;
do_rop_codes_32
(
dst_start
+
x
--
,
dst_colors
[
bit_val
],
&
codes
);
/* fall through */
case
2
:
bit_val
=
src_val
>>
6
;
do_rop_codes_32
(
dst_start
+
x
--
,
dst_colors
[
bit_val
],
&
codes
);
/* fall through */
case
1
:
bit_val
=
src_val
>>
7
;
do_rop_codes_32
(
dst_start
+
x
,
dst_colors
[
bit_val
],
&
codes
);
}
}
#define LOOP( op ) \
for (y = rc->top; y < rc->bottom; y++) \
{ \
pos = origin->x & 7; \
src_val = src_start[pos / 8]; \
x = 0; \
switch (pos & 7) \
{ \
case 1: bit_val = src_val >> 6; op; x++; \
/* fall through */
\
case 2: bit_val = src_val >> 5; op; x++; \
/* fall through */
\
case 3: bit_val = src_val >> 4; op; x++; \
/* fall through */
\
case 4: bit_val = src_val >> 3; op; x++; \
/* fall through */
\
case 5: bit_val = src_val >> 2; op; x++; \
/* fall through */
\
case 6: bit_val = src_val >> 1; op; x++; \
/* fall through */
\
case 7: bit_val = src_val; op; x++; \
pos = (pos + 7) & ~7; \
} \
for (i = 0; i < full; i++, pos += 8) \
{ \
src_val = src_start[pos / 8]; \
bit_val = src_val >> 7; op; x++; \
bit_val = src_val >> 6; op; x++; \
bit_val = src_val >> 5; op; x++; \
bit_val = src_val >> 4; op; x++; \
bit_val = src_val >> 3; op; x++; \
bit_val = src_val >> 2; op; x++; \
bit_val = src_val >> 1; op; x++; \
bit_val = src_val; op; x++; \
} \
if (origin_end & 7) \
{ \
src_val = src_start[pos / 8]; \
x += (origin_end & 7) - 1; \
switch (origin_end & 7) \
{ \
case 7: bit_val = src_val >> 1; op; x--; \
/* fall through */
\
case 6: bit_val = src_val >> 2; op; x--; \
/* fall through */
\
case 5: bit_val = src_val >> 3; op; x--; \
/* fall through */
\
case 4: bit_val = src_val >> 4; op; x--; \
/* fall through */
\
case 3: bit_val = src_val >> 5; op; x--; \
/* fall through */
\
case 2: bit_val = src_val >> 6; op; x--; \
/* fall through */
\
case 1: bit_val = src_val >> 7; op; \
} \
} \
dst_start += dst->stride / 4; \
src_start += src->stride; \
}
dst_start
+=
dst
->
stride
/
4
;
src_start
+=
src
->
stride
;
switch
(
rop2
)
{
ROPS_ALL
(
dst_start
[
x
],
dst_colors
[
bit_val
]
)
}
#undef LOOP
}
static
void
mask_rect_24
(
const
dib_info
*
dst
,
const
RECT
*
rc
,
...
...
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