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
c861284a
Commit
c861284a
authored
Dec 28, 2011
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Add a helper function to add a rectangle to a region.
parent
0c840f66
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
11 deletions
+27
-11
bitblt.c
dlls/gdi32/dibdrv/bitblt.c
+16
-11
gdi_private.h
dlls/gdi32/gdi_private.h
+1
-0
region.c
dlls/gdi32/region.c
+10
-0
No files found.
dlls/gdi32/dibdrv/bitblt.c
View file @
c861284a
...
...
@@ -1288,8 +1288,8 @@ DWORD gradient_bitmapinfo( const BITMAPINFO *info, void *bits, TRIVERTEX *vert_a
unsigned
int
i
;
int
y
;
TRIVERTEX
vert
[
3
];
RECT
rc
;
DWORD
ret
=
ERROR_SUCCESS
;
HRGN
tmp_rgn
=
0
;
init_dib_info_from_bitmapinfo
(
&
dib
,
info
,
bits
,
default_color_table
);
...
...
@@ -1300,9 +1300,11 @@ DWORD gradient_bitmapinfo( const BITMAPINFO *info, void *bits, TRIVERTEX *vert_a
{
get_gradient_hrect_vertices
(
rect
,
vert_array
,
dev_pts
,
vert
);
gradient_rect
(
&
dib
,
vert
,
mode
,
0
);
if
(
!
tmp_rgn
)
tmp_rgn
=
CreateRectRgn
(
vert
[
0
].
x
,
vert
[
0
].
y
,
vert
[
1
].
x
,
vert
[
1
].
y
);
else
SetRectRgn
(
tmp_rgn
,
vert
[
0
].
x
,
vert
[
0
].
y
,
vert
[
1
].
x
,
vert
[
1
].
y
);
CombineRgn
(
rgn
,
rgn
,
tmp_rgn
,
RGN_OR
);
rc
.
left
=
vert
[
0
].
x
;
rc
.
top
=
vert
[
0
].
y
;
rc
.
right
=
vert
[
1
].
x
;
rc
.
bottom
=
vert
[
1
].
y
;
add_rect_to_region
(
rgn
,
&
rc
);
}
break
;
...
...
@@ -1311,9 +1313,11 @@ DWORD gradient_bitmapinfo( const BITMAPINFO *info, void *bits, TRIVERTEX *vert_a
{
get_gradient_vrect_vertices
(
rect
,
vert_array
,
dev_pts
,
vert
);
gradient_rect
(
&
dib
,
vert
,
mode
,
0
);
if
(
!
tmp_rgn
)
tmp_rgn
=
CreateRectRgn
(
vert
[
0
].
x
,
vert
[
0
].
y
,
vert
[
1
].
x
,
vert
[
1
].
y
);
else
SetRectRgn
(
tmp_rgn
,
vert
[
0
].
x
,
vert
[
0
].
y
,
vert
[
1
].
x
,
vert
[
1
].
y
);
CombineRgn
(
rgn
,
rgn
,
tmp_rgn
,
RGN_OR
);
rc
.
left
=
vert
[
0
].
x
;
rc
.
top
=
vert
[
0
].
y
;
rc
.
right
=
vert
[
1
].
x
;
rc
.
bottom
=
vert
[
1
].
y
;
add_rect_to_region
(
rgn
,
&
rc
);
}
break
;
...
...
@@ -1323,22 +1327,23 @@ DWORD gradient_bitmapinfo( const BITMAPINFO *info, void *bits, TRIVERTEX *vert_a
get_gradient_triangle_vertices
(
tri
,
vert_array
,
dev_pts
,
vert
);
if
(
gradient_rect
(
&
dib
,
vert
,
mode
,
0
))
{
if
(
!
tmp_rgn
)
tmp_rgn
=
CreateRectRgn
(
0
,
0
,
0
,
0
);
for
(
y
=
vert
[
0
].
y
;
y
<
vert
[
2
].
y
;
y
++
)
{
int
x1
,
x2
=
edge_coord
(
y
,
vert
[
0
].
x
,
vert
[
0
].
y
,
vert
[
2
].
x
,
vert
[
2
].
y
);
if
(
y
<
vert
[
1
].
y
)
x1
=
edge_coord
(
y
,
vert
[
0
].
x
,
vert
[
0
].
y
,
vert
[
1
].
x
,
vert
[
1
].
y
);
else
x1
=
edge_coord
(
y
,
vert
[
1
].
x
,
vert
[
1
].
y
,
vert
[
2
].
x
,
vert
[
2
].
y
);
SetRectRgn
(
tmp_rgn
,
min
(
x1
,
x2
),
y
,
max
(
x1
,
x2
),
y
+
1
);
CombineRgn
(
rgn
,
rgn
,
tmp_rgn
,
RGN_OR
);
rc
.
left
=
min
(
x1
,
x2
);
rc
.
top
=
y
;
rc
.
right
=
max
(
x1
,
x2
);
rc
.
bottom
=
y
+
1
;
add_rect_to_region
(
rgn
,
&
rc
);
}
}
else
ret
=
ERROR_INVALID_PARAMETER
;
}
break
;
}
DeleteObject
(
tmp_rgn
);
return
ret
;
}
...
...
dlls/gdi32/gdi_private.h
View file @
c861284a
...
...
@@ -318,6 +318,7 @@ extern UINT WINAPI GDIRealizePalette( HDC hdc ) DECLSPEC_HIDDEN;
extern
HPALETTE
PALETTE_Init
(
void
)
DECLSPEC_HIDDEN
;
/* region.c */
extern
BOOL
add_rect_to_region
(
HRGN
rgn
,
const
RECT
*
rect
)
DECLSPEC_HIDDEN
;
extern
INT
mirror_region
(
HRGN
dst
,
HRGN
src
,
INT
width
)
DECLSPEC_HIDDEN
;
extern
BOOL
REGION_FrameRgn
(
HRGN
dest
,
HRGN
src
,
INT
x
,
INT
y
)
DECLSPEC_HIDDEN
;
...
...
dlls/gdi32/region.c
View file @
c861284a
...
...
@@ -1268,6 +1268,16 @@ static BOOL REGION_UnionRectWithRegion(const RECT *rect, WINEREGION *rgn)
}
BOOL
add_rect_to_region
(
HRGN
rgn
,
const
RECT
*
rect
)
{
RGNOBJ
*
obj
=
GDI_GetObjPtr
(
rgn
,
OBJ_REGION
);
if
(
!
obj
)
return
FALSE
;
REGION_UnionRectWithRegion
(
rect
,
&
obj
->
rgn
);
GDI_ReleaseObj
(
rgn
);
return
TRUE
;
}
/***********************************************************************
* REGION_CreateFrameRgn
*
...
...
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