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
64f6e9bc
Commit
64f6e9bc
authored
Oct 17, 2011
by
Huw Davies
Committed by
Alexandre Julliard
Oct 17, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Move the intersection of vis rects into a separate function.
parent
2127e944
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
58 additions
and
48 deletions
+58
-48
bitblt.c
dlls/gdi32/bitblt.c
+55
-48
gdi_private.h
dlls/gdi32/gdi_private.h
+3
-0
No files found.
dlls/gdi32/bitblt.c
View file @
64f6e9bc
...
...
@@ -47,6 +47,60 @@ static inline void swap_ints( int *i, int *j )
*
j
=
tmp
;
}
BOOL
intersect_vis_rectangles
(
struct
bitblt_coords
*
dst
,
struct
bitblt_coords
*
src
)
{
RECT
rect
;
/* intersect the rectangles */
if
((
src
->
width
==
dst
->
width
)
&&
(
src
->
height
==
dst
->
height
))
/* no stretching */
{
offset_rect
(
&
src
->
visrect
,
dst
->
x
-
src
->
x
,
dst
->
y
-
src
->
y
);
intersect_rect
(
&
rect
,
&
src
->
visrect
,
&
dst
->
visrect
);
src
->
visrect
=
dst
->
visrect
=
rect
;
offset_rect
(
&
src
->
visrect
,
src
->
x
-
dst
->
x
,
src
->
y
-
dst
->
y
);
}
else
/* stretching */
{
/* map source rectangle into destination coordinates */
rect
=
src
->
visrect
;
offset_rect
(
&
rect
,
-
min
(
src
->
x
,
src
->
x
+
src
->
width
+
1
),
-
min
(
src
->
y
,
src
->
y
+
src
->
height
+
1
)
);
rect
.
left
=
dst
->
x
+
rect
.
left
*
dst
->
width
/
abs
(
src
->
width
);
rect
.
top
=
dst
->
y
+
rect
.
top
*
dst
->
height
/
abs
(
src
->
height
);
rect
.
right
=
dst
->
x
+
rect
.
right
*
dst
->
width
/
abs
(
src
->
width
);
rect
.
bottom
=
dst
->
y
+
rect
.
bottom
*
dst
->
height
/
abs
(
src
->
height
);
if
(
rect
.
left
>
rect
.
right
)
swap_ints
(
&
rect
.
left
,
&
rect
.
right
);
if
(
rect
.
top
>
rect
.
bottom
)
swap_ints
(
&
rect
.
top
,
&
rect
.
bottom
);
/* avoid rounding errors */
rect
.
left
--
;
rect
.
top
--
;
rect
.
right
++
;
rect
.
bottom
++
;
if
(
!
intersect_rect
(
&
dst
->
visrect
,
&
rect
,
&
dst
->
visrect
))
return
FALSE
;
/* map destination rectangle back to source coordinates */
rect
=
dst
->
visrect
;
offset_rect
(
&
rect
,
-
min
(
dst
->
x
,
dst
->
x
+
dst
->
width
+
1
),
-
min
(
dst
->
y
,
dst
->
y
+
dst
->
height
+
1
)
);
rect
.
left
=
src
->
x
+
rect
.
left
*
src
->
width
/
abs
(
dst
->
width
);
rect
.
top
=
src
->
y
+
rect
.
top
*
src
->
height
/
abs
(
dst
->
height
);
rect
.
right
=
src
->
x
+
rect
.
right
*
src
->
width
/
abs
(
dst
->
width
);
rect
.
bottom
=
src
->
y
+
rect
.
bottom
*
src
->
height
/
abs
(
dst
->
height
);
if
(
rect
.
left
>
rect
.
right
)
swap_ints
(
&
rect
.
left
,
&
rect
.
right
);
if
(
rect
.
top
>
rect
.
bottom
)
swap_ints
(
&
rect
.
top
,
&
rect
.
bottom
);
/* avoid rounding errors */
rect
.
left
--
;
rect
.
top
--
;
rect
.
right
++
;
rect
.
bottom
++
;
if
(
!
intersect_rect
(
&
src
->
visrect
,
&
rect
,
&
src
->
visrect
))
return
FALSE
;
}
return
TRUE
;
}
static
BOOL
get_vis_rectangles
(
DC
*
dc_dst
,
struct
bitblt_coords
*
dst
,
DC
*
dc_src
,
struct
bitblt_coords
*
src
)
{
...
...
@@ -104,54 +158,7 @@ static BOOL get_vis_rectangles( DC *dc_dst, struct bitblt_coords *dst,
if
(
is_rect_empty
(
&
src
->
visrect
))
return
FALSE
;
if
(
is_rect_empty
(
&
dst
->
visrect
))
return
FALSE
;
/* intersect the rectangles */
if
((
src
->
width
==
dst
->
width
)
&&
(
src
->
height
==
dst
->
height
))
/* no stretching */
{
offset_rect
(
&
src
->
visrect
,
dst
->
x
-
src
->
x
,
dst
->
y
-
src
->
y
);
intersect_rect
(
&
rect
,
&
src
->
visrect
,
&
dst
->
visrect
);
src
->
visrect
=
dst
->
visrect
=
rect
;
offset_rect
(
&
src
->
visrect
,
src
->
x
-
dst
->
x
,
src
->
y
-
dst
->
y
);
}
else
/* stretching */
{
/* map source rectangle into destination coordinates */
rect
=
src
->
visrect
;
offset_rect
(
&
rect
,
-
min
(
src
->
x
,
src
->
x
+
src
->
width
+
1
),
-
min
(
src
->
y
,
src
->
y
+
src
->
height
+
1
)
);
rect
.
left
=
dst
->
x
+
rect
.
left
*
dst
->
width
/
abs
(
src
->
width
);
rect
.
top
=
dst
->
y
+
rect
.
top
*
dst
->
height
/
abs
(
src
->
height
);
rect
.
right
=
dst
->
x
+
rect
.
right
*
dst
->
width
/
abs
(
src
->
width
);
rect
.
bottom
=
dst
->
y
+
rect
.
bottom
*
dst
->
height
/
abs
(
src
->
height
);
if
(
rect
.
left
>
rect
.
right
)
swap_ints
(
&
rect
.
left
,
&
rect
.
right
);
if
(
rect
.
top
>
rect
.
bottom
)
swap_ints
(
&
rect
.
top
,
&
rect
.
bottom
);
/* avoid rounding errors */
rect
.
left
--
;
rect
.
top
--
;
rect
.
right
++
;
rect
.
bottom
++
;
if
(
!
intersect_rect
(
&
dst
->
visrect
,
&
rect
,
&
dst
->
visrect
))
return
FALSE
;
/* map destination rectangle back to source coordinates */
rect
=
dst
->
visrect
;
offset_rect
(
&
rect
,
-
min
(
dst
->
x
,
dst
->
x
+
dst
->
width
+
1
),
-
min
(
dst
->
y
,
dst
->
y
+
dst
->
height
+
1
)
);
rect
.
left
=
src
->
x
+
rect
.
left
*
src
->
width
/
abs
(
dst
->
width
);
rect
.
top
=
src
->
y
+
rect
.
top
*
src
->
height
/
abs
(
dst
->
height
);
rect
.
right
=
src
->
x
+
rect
.
right
*
src
->
width
/
abs
(
dst
->
width
);
rect
.
bottom
=
src
->
y
+
rect
.
bottom
*
src
->
height
/
abs
(
dst
->
height
);
if
(
rect
.
left
>
rect
.
right
)
swap_ints
(
&
rect
.
left
,
&
rect
.
right
);
if
(
rect
.
top
>
rect
.
bottom
)
swap_ints
(
&
rect
.
top
,
&
rect
.
bottom
);
/* avoid rounding errors */
rect
.
left
--
;
rect
.
top
--
;
rect
.
right
++
;
rect
.
bottom
++
;
if
(
!
intersect_rect
(
&
src
->
visrect
,
&
rect
,
&
src
->
visrect
))
return
FALSE
;
}
return
TRUE
;
return
intersect_vis_rectangles
(
dst
,
src
);
}
void
free_heap_bits
(
struct
gdi_image_bits
*
bits
)
...
...
dlls/gdi32/gdi_private.h
View file @
64f6e9bc
...
...
@@ -222,6 +222,9 @@ typedef struct tagBITMAPOBJ
extern
BOOL
BIDI_Reorder
(
HDC
hDC
,
LPCWSTR
lpString
,
INT
uCount
,
DWORD
dwFlags
,
DWORD
dwWineGCP_Flags
,
LPWSTR
lpOutString
,
INT
uCountOut
,
UINT
*
lpOrder
,
WORD
**
lpGlyphs
,
INT
*
cGlyphs
)
DECLSPEC_HIDDEN
;
/* bitblt.c */
extern
BOOL
intersect_vis_rectangles
(
struct
bitblt_coords
*
dst
,
struct
bitblt_coords
*
src
)
DECLSPEC_HIDDEN
;
/* bitmap.c */
extern
void
get_ddb_bitmapinfo
(
BITMAPOBJ
*
bmp
,
BITMAPINFO
*
info
)
DECLSPEC_HIDDEN
;
extern
BOOL
get_bitmap_image
(
HBITMAP
hbitmap
,
BITMAPINFO
*
info
,
struct
gdi_image_bits
*
bits
)
DECLSPEC_HIDDEN
;
...
...
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