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
c429c595
Commit
c429c595
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 copy_rect_1().
Signed-off-by:
Huw Davies
<
huw@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
efd6292f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
201 additions
and
183 deletions
+201
-183
primitives.c
dlls/gdi32/dibdrv/primitives.c
+201
-183
No files found.
dlls/gdi32/dibdrv/primitives.c
View file @
c429c595
...
...
@@ -1619,36 +1619,55 @@ static inline void copy_rect_bits_align_1( BYTE *dst_start, int dst_x, const BYT
dst_start
+=
dst_x
/
8
;
full_bytes
=
(
dst_end
-
((
dst_x
+
7
)
&
~
7
))
/
8
;
for
(
y
=
0
;
y
<
size
->
cy
;
y
++
,
dst_start
+=
dst_stride
,
src_start
+=
src_stride
)
switch
(
rop2
)
{
dst
=
dst_start
;
src
=
src_start
;
if
(
dst_x
&
7
)
{
mask
=
edge_masks_1
[
dst_x
&
7
];
do_rop_codes_mask_8
(
dst
,
src
[
0
],
&
codes
,
mask
);
src
++
;
dst
++
;
}
if
(
rop2
==
R2_COPYPEN
)
case
R2_COPYPEN
:
for
(
y
=
0
;
y
<
size
->
cy
;
y
++
,
dst_start
+=
dst_stride
,
src_start
+=
src_stride
)
{
dst
=
dst_start
;
src
=
src_start
;
if
(
dst_x
&
7
)
{
mask
=
edge_masks_1
[
dst_x
&
7
];
do_rop_codes_mask_8
(
dst
,
src
[
0
],
&
codes
,
mask
);
src
++
;
dst
++
;
}
memmove
(
dst
,
src
,
full_bytes
);
src
+=
full_bytes
;
dst
+=
full_bytes
;
if
(
dst_end
&
7
)
{
mask
=
~
edge_masks_1
[
dst_end
&
7
];
do_rop_codes_mask_8
(
dst
,
src
[
0
],
&
codes
,
mask
);
}
}
else
{
for
(
i
=
0
;
i
<
full_bytes
;
i
++
,
src
++
,
dst
++
)
do_rop_codes_8
(
dst
,
src
[
0
],
&
codes
);
}
break
;
if
(
dst_end
&
7
)
{
mask
=
~
edge_masks_1
[
dst_end
&
7
];
do_rop_codes_mask_8
(
dst
,
src
[
0
],
&
codes
,
mask
);
#define LOOP( op ) \
for (y = 0; y < size->cy; y++, dst_start += dst_stride, src_start += src_stride) \
{ \
dst = dst_start; \
src = src_start; \
if (dst_x & 7) \
{ \
mask = edge_masks_1[dst_x & 7]; \
do_rop_codes_mask_8( dst, src[0], &codes, mask ); \
src++; \
dst++; \
} \
for (i = 0; i < full_bytes; i++, src++, dst++) \
op; \
if (dst_end & 7) \
{ \
mask = ~edge_masks_1[dst_end & 7]; \
do_rop_codes_mask_8( dst, src[0], &codes, mask ); \
} \
}
ROPS_WITHOUT_COPY
(
dst
[
0
],
src
[
0
]
);
}
#undef LOOP
}
static
inline
void
copy_rect_bits_shl_1
(
BYTE
*
dst_start
,
int
dst_x
,
const
BYTE
*
src_start
,
int
src_x
,
...
...
@@ -1666,39 +1685,36 @@ static inline void copy_rect_bits_shl_1( BYTE *dst_start, int dst_x, const BYTE
dst_start
+=
dst_x
/
8
;
full_bytes
=
(
dst_end
-
((
dst_x
+
7
)
&
~
7
))
/
8
;
for
(
y
=
0
;
y
<
size
->
cy
;
y
++
,
dst_start
+=
dst_stride
,
src_start
+=
src_stride
)
{
dst
=
dst_start
;
src
=
src_start
;
if
(
dst_x
&
7
)
{
src_val
=
(
src
[
0
]
<<
off
)
|
(
src
[
1
]
>>
(
8
-
off
));
mask
=
edge_masks_1
[
dst_x
&
7
];
do_rop_codes_mask_8
(
dst
,
src_val
,
&
codes
,
mask
);
src
++
;
dst
++
;
}
if
(
rop2
==
R2_COPYPEN
)
{
for
(
i
=
0
;
i
<
full_bytes
;
i
++
,
src
++
,
dst
++
)
dst
[
0
]
=
(
src
[
0
]
<<
off
)
|
(
src
[
1
]
>>
(
8
-
off
));
}
else
{
for
(
i
=
0
;
i
<
full_bytes
;
i
++
,
src
++
,
dst
++
)
do_rop_codes_8
(
dst
,
(
src
[
0
]
<<
off
)
|
(
src
[
1
]
>>
(
8
-
off
)),
&
codes
);
}
#define LOOP( op ) \
for (y = 0; y < size->cy; y++, dst_start += dst_stride, src_start += src_stride) \
{ \
dst = dst_start; \
src = src_start; \
if (dst_x & 7) \
{ \
src_val = (src[0] << off) | (src[1] >> (8 - off)); \
mask = edge_masks_1[dst_x & 7]; \
do_rop_codes_mask_8( dst, src_val, &codes, mask ); \
src++; \
dst++; \
} \
for (i = 0; i < full_bytes; i++, src++, dst++) \
op; \
if (dst_end & 7) \
{ \
src_val = src[0] << off; \
if ((dst_end & 7) + off > 8) \
src_val |= (src[1] >> (8 - off)); \
mask = ~edge_masks_1[dst_end & 7]; \
do_rop_codes_mask_8( dst, src_val, &codes, mask ); \
} \
}
if
(
dst_end
&
7
)
{
src_val
=
src
[
0
]
<<
off
;
if
((
dst_end
&
7
)
+
off
>
8
)
src_val
|=
(
src
[
1
]
>>
(
8
-
off
));
mask
=
~
edge_masks_1
[
dst_end
&
7
];
do_rop_codes_mask_8
(
dst
,
src_val
,
&
codes
,
mask
);
}
switch
(
rop2
)
{
ROPS_ALL
(
dst
[
0
],
((
src
[
0
]
<<
off
)
|
(
src
[
1
]
>>
(
8
-
off
)))
);
}
#undef LOOP
}
static
inline
void
copy_rect_bits_shr_1
(
BYTE
*
dst_start
,
int
dst_x
,
const
BYTE
*
src_start
,
int
src_x
,
...
...
@@ -1716,48 +1732,41 @@ static inline void copy_rect_bits_shr_1( BYTE *dst_start, int dst_x, const BYTE
dst_start
+=
dst_x
/
8
;
full_bytes
=
(
dst_end
-
((
dst_x
+
7
)
&
~
7
))
/
8
;
for
(
y
=
0
;
y
<
size
->
cy
;
y
++
,
dst_start
+=
dst_stride
,
src_start
+=
src_stride
)
{
dst
=
dst_start
;
src
=
src_start
;
last_src
=
0
;
if
(
dst_x
&
7
)
{
last_src
=
src
[
0
];
mask
=
edge_masks_1
[
dst_x
&
7
];
do_rop_codes_mask_8
(
dst
,
src
[
0
]
>>
-
off
,
&
codes
,
mask
);
src
++
;
dst
++
;
}
if
(
rop2
==
R2_COPYPEN
)
{
for
(
i
=
0
;
i
<
full_bytes
;
i
++
,
src
++
,
dst
++
)
{
src_val
=
(
last_src
<<
(
8
+
off
))
|
(
src
[
0
]
>>
-
off
);
last_src
=
src
[
0
];
dst
[
0
]
=
src_val
;
}
}
else
{
for
(
i
=
0
;
i
<
full_bytes
;
i
++
,
src
++
,
dst
++
)
{
src_val
=
(
last_src
<<
(
8
+
off
))
|
(
src
[
0
]
>>
-
off
);
last_src
=
src
[
0
];
do_rop_codes_8
(
dst
,
src_val
,
&
codes
);
}
}
#define LOOP( op ) \
for (y = 0; y < size->cy; y++, dst_start += dst_stride, src_start += src_stride) \
{ \
dst = dst_start; \
src = src_start; \
last_src = 0; \
if (dst_x & 7) \
{ \
last_src = src[0]; \
mask = edge_masks_1[dst_x & 7]; \
do_rop_codes_mask_8( dst, src[0] >> -off, &codes, mask ); \
src++; \
dst++; \
} \
for (i = 0; i < full_bytes; i++, src++, dst++) \
{ \
src_val = (last_src << (8 + off)) | (src[0] >> -off); \
last_src = src[0]; \
op; \
} \
if (dst_end & 7) \
{ \
src_val = last_src << (8 + off); \
if ((dst_end & 7) + off > 0) \
src_val |= (src[0] >> -off); \
mask = ~edge_masks_1[dst_end & 7]; \
do_rop_codes_mask_8( dst, src_val, &codes, mask ); \
} \
}
if
(
dst_end
&
7
)
{
src_val
=
last_src
<<
(
8
+
off
);
if
((
dst_end
&
7
)
+
off
>
0
)
src_val
|=
(
src
[
0
]
>>
-
off
);
mask
=
~
edge_masks_1
[
dst_end
&
7
];
do_rop_codes_mask_8
(
dst
,
src_val
,
&
codes
,
mask
);
}
switch
(
rop2
)
{
ROPS_ALL
(
dst
[
0
],
src_val
)
}
#undef LOOP
}
static
inline
void
copy_rect_bits_rev_align_1
(
BYTE
*
dst_start
,
int
dst_x
,
const
BYTE
*
src_start
,
int
src_x
,
...
...
@@ -1774,36 +1783,55 @@ static inline void copy_rect_bits_rev_align_1( BYTE *dst_start, int dst_x, const
dst_start
+=
(
dst_end
-
1
)
/
8
;
full_bytes
=
(
dst_end
-
((
dst_x
+
7
)
&
~
7
))
/
8
;
for
(
y
=
0
;
y
<
size
->
cy
;
y
++
,
dst_start
+=
dst_stride
,
src_start
+=
src_stride
)
switch
(
rop2
)
{
dst
=
dst_start
;
src
=
src_start
;
if
(
dst_end
&
7
)
{
mask
=
~
edge_masks_1
[
dst_end
&
7
];
do_rop_codes_mask_8
(
dst
,
src
[
0
],
&
codes
,
mask
);
src
--
;
dst
--
;
}
if
(
rop2
==
R2_COPYPEN
)
case
R2_COPYPEN
:
for
(
y
=
0
;
y
<
size
->
cy
;
y
++
,
dst_start
+=
dst_stride
,
src_start
+=
src_stride
)
{
dst
=
dst_start
;
src
=
src_start
;
if
(
dst_end
&
7
)
{
mask
=
~
edge_masks_1
[
dst_end
&
7
];
do_rop_codes_mask_8
(
dst
,
src
[
0
],
&
codes
,
mask
);
src
--
;
dst
--
;
}
memmove
(
dst
,
src
,
full_bytes
);
src
-=
full_bytes
;
dst
-=
full_bytes
;
if
(
dst_x
&
7
)
{
mask
=
edge_masks_1
[
dst_x
&
7
];
do_rop_codes_mask_8
(
dst
,
src
[
0
],
&
codes
,
mask
);
}
}
else
{
for
(
i
=
0
;
i
<
full_bytes
;
i
++
,
src
--
,
dst
--
)
do_rop_codes_8
(
dst
,
src
[
0
],
&
codes
);
}
break
;
if
(
dst_x
&
7
)
{
mask
=
edge_masks_1
[
dst_x
&
7
];
do_rop_codes_mask_8
(
dst
,
src
[
0
],
&
codes
,
mask
);
#define LOOP( op ) \
for (y = 0; y < size->cy; y++, dst_start += dst_stride, src_start += src_stride) \
{ \
dst = dst_start; \
src = src_start; \
if (dst_end & 7) \
{ \
mask = ~edge_masks_1[dst_end & 7]; \
do_rop_codes_mask_8( dst, src[0], &codes, mask ); \
src--; \
dst--; \
} \
for (i = 0; i < full_bytes; i++, src--, dst--) \
op; \
if (dst_x & 7) \
{ \
mask = edge_masks_1[dst_x & 7]; \
do_rop_codes_mask_8( dst, src[0], &codes, mask ); \
} \
}
ROPS_WITHOUT_COPY
(
dst
[
0
],
src
[
0
]
);
}
#undef LOOP
}
static
inline
void
copy_rect_bits_rev_shl_1
(
BYTE
*
dst_start
,
int
dst_x
,
const
BYTE
*
src_start
,
int
src_x
,
...
...
@@ -1821,48 +1849,41 @@ static inline void copy_rect_bits_rev_shl_1( BYTE *dst_start, int dst_x, const B
dst_start
+=
(
dst_end
-
1
)
/
8
;
full_bytes
=
(
dst_end
-
((
dst_x
+
7
)
&
~
7
))
/
8
;
for
(
y
=
0
;
y
<
size
->
cy
;
y
++
,
dst_start
+=
dst_stride
,
src_start
+=
src_stride
)
{
dst
=
dst_start
;
src
=
src_start
;
last_src
=
0
;
if
(
dst_end
&
7
)
{
last_src
=
src
[
0
];
mask
=
~
edge_masks_1
[
dst_end
&
7
];
do_rop_codes_mask_8
(
dst
,
src
[
0
]
<<
off
,
&
codes
,
mask
);
src
--
;
dst
--
;
}
if
(
rop2
==
R2_COPYPEN
)
{
for
(
i
=
0
;
i
<
full_bytes
;
i
++
,
src
--
,
dst
--
)
{
src_val
=
(
src
[
0
]
<<
off
)
|
(
last_src
>>
(
8
-
off
));
last_src
=
src
[
0
];
dst
[
0
]
=
src_val
;
}
}
else
{
for
(
i
=
0
;
i
<
full_bytes
;
i
++
,
src
--
,
dst
--
)
{
src_val
=
(
src
[
0
]
<<
off
)
|
(
last_src
>>
(
8
-
off
));
last_src
=
src
[
0
];
do_rop_codes_8
(
dst
,
src_val
,
&
codes
);
}
}
#define LOOP( op ) \
for (y = 0; y < size->cy; y++, dst_start += dst_stride, src_start += src_stride) \
{ \
dst = dst_start; \
src = src_start; \
last_src = 0; \
if (dst_end & 7) \
{ \
last_src = src[0]; \
mask = ~edge_masks_1[dst_end & 7]; \
do_rop_codes_mask_8( dst, src[0] << off, &codes, mask ); \
src--; \
dst--; \
} \
for (i = 0; i < full_bytes; i++, src--, dst--) \
{ \
src_val = (src[0] << off) | (last_src >> (8 - off)); \
last_src = src[0]; \
op; \
} \
if (dst_x & 7) \
{ \
src_val = last_src >> (8 - off); \
if ((dst_x & 7) + off < 8) \
src_val |= (src[0] << off); \
mask = edge_masks_1[dst_x & 7]; \
do_rop_codes_mask_8( dst, src_val, &codes, mask ); \
} \
}
if
(
dst_x
&
7
)
{
src_val
=
last_src
>>
(
8
-
off
);
if
((
dst_x
&
7
)
+
off
<
8
)
src_val
|=
(
src
[
0
]
<<
off
);
mask
=
edge_masks_1
[
dst_x
&
7
];
do_rop_codes_mask_8
(
dst
,
src_val
,
&
codes
,
mask
);
}
switch
(
rop2
)
{
ROPS_ALL
(
dst
[
0
],
src_val
);
}
#undef LOOP
}
static
inline
void
copy_rect_bits_rev_shr_1
(
BYTE
*
dst_start
,
int
dst_x
,
const
BYTE
*
src_start
,
int
src_x
,
...
...
@@ -1880,38 +1901,35 @@ static inline void copy_rect_bits_rev_shr_1( BYTE *dst_start, int dst_x, const B
dst_start
+=
(
dst_end
-
1
)
/
8
;
full_bytes
=
(
dst_end
-
((
dst_x
+
7
)
&
~
7
))
/
8
;
for
(
y
=
0
;
y
<
size
->
cy
;
y
++
,
dst_start
+=
dst_stride
,
src_start
+=
src_stride
)
{
dst
=
dst_start
;
src
=
src_start
;
if
(
dst_end
&
7
)
{
mask
=
edge_masks_1
[
dst_x
&
7
];
do_rop_codes_mask_8
(
dst
,
(
src
[
-
1
]
<<
(
8
+
off
))
|
(
src
[
0
]
>>
-
off
),
&
codes
,
mask
);
src
--
;
dst
--
;
}
if
(
rop2
==
R2_COPYPEN
)
{
for
(
i
=
0
;
i
<
full_bytes
;
i
++
,
src
--
,
dst
--
)
dst
[
0
]
=
(
src
[
-
1
]
<<
(
8
+
off
))
|
(
src
[
0
]
>>
-
off
);
}
else
{
for
(
i
=
0
;
i
<
full_bytes
;
i
++
,
src
--
,
dst
--
)
do_rop_codes_8
(
dst
,
(
src
[
-
1
]
<<
(
8
+
off
))
|
(
src
[
0
]
>>
-
off
),
&
codes
);
}
#define LOOP( op ) \
for (y = 0; y < size->cy; y++, dst_start += dst_stride, src_start += src_stride) \
{ \
dst = dst_start; \
src = src_start; \
if (dst_end & 7) \
{ \
mask = edge_masks_1[dst_x & 7]; \
do_rop_codes_mask_8( dst, (src[-1] << (8 + off)) | (src[0] >> -off), &codes, mask ); \
src--; \
dst--; \
} \
for (i = 0; i < full_bytes; i++, src--, dst--) \
op; \
if (dst_x & 7) \
{ \
src_val = src[0] >> -off; \
if ((dst_x & 7) + off < 0) \
src_val |= (src[-1] << (8 + off)); \
mask = edge_masks_1[dst_x & 7]; \
do_rop_codes_mask_8( dst, src_val, &codes, mask ); \
} \
}
if
(
dst_x
&
7
)
{
src_val
=
src
[
0
]
>>
-
off
;
if
((
dst_x
&
7
)
+
off
<
0
)
src_val
|=
(
src
[
-
1
]
<<
(
8
+
off
));
mask
=
edge_masks_1
[
dst_x
&
7
];
do_rop_codes_mask_8
(
dst
,
src_val
,
&
codes
,
mask
);
}
switch
(
rop2
)
{
ROPS_ALL
(
dst
[
0
],
(
src
[
-
1
]
<<
(
8
+
off
))
|
(
src
[
0
]
>>
-
off
)
);
}
#undef LOOP
}
static
void
copy_rect_1
(
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