Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
1e2dd7ca
Commit
1e2dd7ca
authored
Dec 06, 2011
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Add a helper function to clip a rectangle to the DC visible rect.
parent
3284d17e
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
30 additions
and
25 deletions
+30
-25
bitblt.c
dlls/gdi32/bitblt.c
+3
-9
clipping.c
dlls/gdi32/clipping.c
+18
-1
dib.c
dlls/gdi32/dib.c
+7
-11
font.c
dlls/gdi32/font.c
+1
-3
gdi_private.h
dlls/gdi32/gdi_private.h
+1
-1
No files found.
dlls/gdi32/bitblt.c
View file @
1e2dd7ca
...
...
@@ -104,7 +104,7 @@ BOOL intersect_vis_rectangles( struct bitblt_coords *dst, struct bitblt_coords *
static
BOOL
get_vis_rectangles
(
DC
*
dc_dst
,
struct
bitblt_coords
*
dst
,
DC
*
dc_src
,
struct
bitblt_coords
*
src
)
{
RECT
rect
,
clip
;
RECT
rect
;
/* get the destination visible rectangle */
...
...
@@ -124,10 +124,7 @@ static BOOL get_vis_rectangles( DC *dc_dst, struct bitblt_coords *dst,
}
get_bounding_rect
(
&
rect
,
dst
->
x
,
dst
->
y
,
dst
->
width
,
dst
->
height
);
if
(
get_clip_box
(
dc_dst
,
&
clip
))
intersect_rect
(
&
dst
->
visrect
,
&
rect
,
&
clip
);
else
dst
->
visrect
=
rect
;
clip_visrect
(
dc_dst
,
&
dst
->
visrect
,
&
rect
);
/* get the source visible rectangle */
...
...
@@ -408,7 +405,6 @@ BOOL nulldrv_GradientFill( PHYSDEV dev, TRIVERTEX *vert_array, ULONG nvert,
struct
gdi_image_bits
bits
;
unsigned
int
i
;
POINT
*
pts
;
RECT
clip
;
BOOL
ret
=
TRUE
;
DWORD
err
;
HRGN
rgn
;
...
...
@@ -437,9 +433,7 @@ BOOL nulldrv_GradientFill( PHYSDEV dev, TRIVERTEX *vert_array, ULONG nvert,
dst
.
y
=
dst
.
visrect
.
top
;
dst
.
width
=
dst
.
visrect
.
right
-
dst
.
visrect
.
left
;
dst
.
height
=
dst
.
visrect
.
bottom
-
dst
.
visrect
.
top
;
if
(
get_clip_box
(
dc
,
&
clip
))
intersect_rect
(
&
dst
.
visrect
,
&
dst
.
visrect
,
&
clip
);
if
(
is_rect_empty
(
&
dst
.
visrect
))
goto
done
;
if
(
!
clip_visrect
(
dc
,
&
dst
.
visrect
,
&
dst
.
visrect
))
goto
done
;
/* query the bitmap format */
info
->
bmiHeader
.
biSize
=
sizeof
(
info
->
bmiHeader
);
...
...
dlls/gdi32/clipping.c
View file @
1e2dd7ca
...
...
@@ -57,7 +57,7 @@ static inline RECT get_clip_rect( DC * dc, int left, int top, int right, int bot
*
* Get the clipping rectangle in device coordinates.
*/
int
get_clip_box
(
DC
*
dc
,
RECT
*
rect
)
static
int
get_clip_box
(
DC
*
dc
,
RECT
*
rect
)
{
int
ret
=
ERROR
;
HRGN
rgn
,
clip
=
get_clip_region
(
dc
);
...
...
@@ -74,6 +74,23 @@ int get_clip_box( DC *dc, RECT *rect )
}
/***********************************************************************
* clip_visrect
*
* Clip a rectangle to the DC visible rect.
*/
BOOL
clip_visrect
(
DC
*
dc
,
RECT
*
dst
,
const
RECT
*
src
)
{
RECT
clip
;
if
(
!
get_clip_box
(
dc
,
&
clip
))
{
*
dst
=
*
src
;
return
!
is_rect_empty
(
dst
);
}
return
intersect_rect
(
dst
,
src
,
&
clip
);
}
/***********************************************************************
* CLIPPING_UpdateGCRegion
*
* Update the GC clip region when the ClipRgn or VisRgn have changed.
...
...
dlls/gdi32/dib.c
View file @
1e2dd7ca
...
...
@@ -403,7 +403,7 @@ INT nulldrv_StretchDIBits( PHYSDEV dev, INT xDst, INT yDst, INT widthDst, INT he
INT
ret
=
0
;
INT
height
=
abs
(
src_info
->
bmiHeader
.
biHeight
);
BOOL
top_down
=
src_info
->
bmiHeader
.
biHeight
<
0
,
non_stretch_from_origin
=
FALSE
;
RECT
rect
,
clip_rect
;
RECT
rect
;
TRACE
(
"%d %d %d %d <- %d %d %d %d rop %08x
\n
"
,
xDst
,
yDst
,
widthDst
,
heightDst
,
xSrc
,
ySrc
,
widthSrc
,
heightSrc
,
rop
);
...
...
@@ -487,11 +487,7 @@ INT nulldrv_StretchDIBits( PHYSDEV dev, INT xDst, INT yDst, INT widthDst, INT he
get_bounding_rect
(
&
rect
,
dst
.
x
,
dst
.
y
,
dst
.
width
,
dst
.
height
);
if
(
get_clip_box
(
dc
,
&
clip_rect
))
intersect_rect
(
&
dst
.
visrect
,
&
rect
,
&
clip_rect
);
else
dst
.
visrect
=
rect
;
if
(
is_rect_empty
(
&
dst
.
visrect
))
goto
done
;
if
(
!
clip_visrect
(
dc
,
&
dst
.
visrect
,
&
rect
))
goto
done
;
if
(
!
intersect_vis_rectangles
(
&
dst
,
&
src
))
goto
done
;
...
...
@@ -796,11 +792,11 @@ INT nulldrv_SetDIBitsToDevice( PHYSDEV dev, INT x_dst, INT y_dst, DWORD cx, DWOR
dst
.
height
=
cy
;
if
(
GetLayout
(
dev
->
hdc
)
&
LAYOUT_RTL
)
dst
.
x
-=
cx
-
1
;
dst
.
vis
rect
.
left
=
dst
.
x
;
dst
.
vis
rect
.
top
=
dst
.
y
;
dst
.
vis
rect
.
right
=
dst
.
x
+
cx
;
dst
.
vis
rect
.
bottom
=
dst
.
y
+
cy
;
if
(
get_clip_box
(
dc
,
&
rect
))
intersect_rect
(
&
dst
.
visrect
,
&
dst
.
visrect
,
&
rect
)
;
rect
.
left
=
dst
.
x
;
rect
.
top
=
dst
.
y
;
rect
.
right
=
dst
.
x
+
cx
;
rect
.
bottom
=
dst
.
y
+
cy
;
if
(
!
clip_visrect
(
dc
,
&
dst
.
visrect
,
&
rect
))
goto
done
;
offset_rect
(
&
src
.
visrect
,
dst
.
x
-
src
.
x
,
dst
.
y
-
src
.
y
);
intersect_rect
(
&
rect
,
&
src
.
visrect
,
&
dst
.
visrect
);
...
...
dlls/gdi32/font.c
View file @
1e2dd7ca
...
...
@@ -1863,13 +1863,11 @@ BOOL nulldrv_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags, const RECT *rect
struct
gdi_image_bits
bits
;
struct
bitblt_coords
src
,
dst
;
PHYSDEV
dst_dev
;
RECT
clip
;
dst_dev
=
GET_DC_PHYSDEV
(
dc
,
pPutImage
);
src
.
visrect
=
get_total_extents
(
dev
->
hdc
,
x
,
y
,
flags
,
aa_flags
,
str
,
count
,
dx
);
if
(
flags
&
ETO_CLIPPED
)
intersect_rect
(
&
src
.
visrect
,
&
src
.
visrect
,
rect
);
if
(
get_clip_box
(
dc
,
&
clip
))
intersect_rect
(
&
src
.
visrect
,
&
src
.
visrect
,
&
clip
);
if
(
is_rect_empty
(
&
src
.
visrect
))
return
TRUE
;
if
(
!
clip_visrect
(
dc
,
&
src
.
visrect
,
&
src
.
visrect
))
return
TRUE
;
/* FIXME: check for ETO_OPAQUE and avoid GetImage */
src
.
x
=
src
.
visrect
.
left
;
...
...
dlls/gdi32/gdi_private.h
View file @
1e2dd7ca
...
...
@@ -212,7 +212,7 @@ extern DWORD stretch_bits( const BITMAPINFO *src_info, struct bitblt_coords *src
extern
BOOL
get_brush_bitmap_info
(
HBRUSH
handle
,
BITMAPINFO
*
info
,
void
**
bits
,
UINT
*
usage
)
DECLSPEC_HIDDEN
;
/* clipping.c */
extern
int
get_clip_box
(
DC
*
dc
,
RECT
*
rect
)
DECLSPEC_HIDDEN
;
extern
BOOL
clip_visrect
(
DC
*
dc
,
RECT
*
dst
,
const
RECT
*
src
)
DECLSPEC_HIDDEN
;
extern
void
CLIPPING_UpdateGCRegion
(
DC
*
dc
)
DECLSPEC_HIDDEN
;
/* Return the total clip region (if any) */
...
...
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