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
473afa4b
Commit
473afa4b
authored
Sep 30, 2010
by
Vincent Povirk
Committed by
Alexandre Julliard
Oct 01, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Implement GdipGetRegionScansCount.
parent
40d8876f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
137 additions
and
4 deletions
+137
-4
region.c
dlls/gdiplus/region.c
+72
-4
region.c
dlls/gdiplus/tests/region.c
+64
-0
gdiplusflat.h
include/gdiplusflat.h
+1
-0
No files found.
dlls/gdiplus/region.c
View file @
473afa4b
...
...
@@ -1362,14 +1362,82 @@ GpStatus WINGDIPAPI GdipTranslateRegionI(GpRegion *region, INT dx, INT dy)
return
GdipTranslateRegion
(
region
,
(
REAL
)
dx
,
(
REAL
)
dy
);
}
static
GpStatus
get_region_scans_data
(
GpRegion
*
region
,
GpMatrix
*
matrix
,
LPRGNDATA
*
data
)
{
GpRegion
*
region_copy
;
GpStatus
stat
;
HRGN
hrgn
;
DWORD
data_size
;
stat
=
GdipCloneRegion
(
region
,
&
region_copy
);
if
(
stat
==
Ok
)
{
stat
=
GdipTransformRegion
(
region_copy
,
matrix
);
if
(
stat
==
Ok
)
stat
=
GdipGetRegionHRgn
(
region_copy
,
NULL
,
&
hrgn
);
if
(
stat
==
Ok
)
{
if
(
hrgn
)
{
data_size
=
GetRegionData
(
hrgn
,
0
,
NULL
);
*
data
=
GdipAlloc
(
data_size
);
if
(
*
data
)
GetRegionData
(
hrgn
,
data_size
,
*
data
);
else
stat
=
OutOfMemory
;
DeleteObject
(
hrgn
);
}
else
{
data_size
=
sizeof
(
RGNDATAHEADER
)
+
sizeof
(
RECT
);
*
data
=
GdipAlloc
(
data_size
);
if
(
*
data
)
{
(
*
data
)
->
rdh
.
dwSize
=
sizeof
(
RGNDATAHEADER
);
(
*
data
)
->
rdh
.
iType
=
RDH_RECTANGLES
;
(
*
data
)
->
rdh
.
nCount
=
1
;
(
*
data
)
->
rdh
.
nRgnSize
=
sizeof
(
RECT
);
(
*
data
)
->
rdh
.
rcBound
.
left
=
(
*
data
)
->
rdh
.
rcBound
.
top
=
-
0x400000
;
(
*
data
)
->
rdh
.
rcBound
.
right
=
(
*
data
)
->
rdh
.
rcBound
.
bottom
=
0x400000
;
memcpy
(
&
(
*
data
)
->
Buffer
,
&
(
*
data
)
->
rdh
.
rcBound
,
sizeof
(
RECT
));
}
else
stat
=
OutOfMemory
;
}
}
GdipDeleteRegion
(
region_copy
);
}
return
stat
;
}
GpStatus
WINGDIPAPI
GdipGetRegionScansCount
(
GpRegion
*
region
,
UINT
*
count
,
GpMatrix
*
matrix
)
{
static
int
calls
;
GpStatus
stat
;
LPRGNDATA
data
;
TRACE
(
"(%p, %p, %p)
\n
"
,
region
,
count
,
matrix
);
if
(
!
(
calls
++
)
)
FIXME
(
"not implemented
\n
"
)
;
if
(
!
region
||
!
count
||
!
matrix
)
return
InvalidParameter
;
return
NotImplemented
;
stat
=
get_region_scans_data
(
region
,
matrix
,
&
data
);
if
(
stat
==
Ok
)
{
*
count
=
data
->
rdh
.
nCount
;
GdipFree
(
data
);
}
return
stat
;
}
dlls/gdiplus/tests/region.c
View file @
473afa4b
...
...
@@ -1230,6 +1230,69 @@ static void test_transform(void)
ReleaseDC
(
0
,
hdc
);
}
static
void
test_scans
(
void
)
{
GpRegion
*
region
;
GpMatrix
*
matrix
;
GpRectF
rectf
;
GpStatus
status
;
ULONG
count
=
80085
;
status
=
GdipCreateRegion
(
&
region
);
expect
(
Ok
,
status
);
status
=
GdipCreateMatrix
(
&
matrix
);
expect
(
Ok
,
status
);
/* test NULL values */
status
=
GdipGetRegionScansCount
(
NULL
,
&
count
,
matrix
);
expect
(
InvalidParameter
,
status
);
status
=
GdipGetRegionScansCount
(
region
,
NULL
,
matrix
);
expect
(
InvalidParameter
,
status
);
status
=
GdipGetRegionScansCount
(
region
,
&
count
,
NULL
);
expect
(
InvalidParameter
,
status
);
/* infinite */
status
=
GdipGetRegionScansCount
(
region
,
&
count
,
matrix
);
expect
(
Ok
,
status
);
expect
(
1
,
count
);
/* empty */
status
=
GdipSetEmpty
(
region
);
expect
(
Ok
,
status
);
status
=
GdipGetRegionScansCount
(
region
,
&
count
,
matrix
);
expect
(
Ok
,
status
);
expect
(
0
,
count
);
/* single rectangle */
rectf
.
X
=
rectf
.
Y
=
0
.
0
;
rectf
.
Width
=
rectf
.
Height
=
5
.
0
;
status
=
GdipCombineRegionRect
(
region
,
&
rectf
,
CombineModeReplace
);
expect
(
Ok
,
status
);
status
=
GdipGetRegionScansCount
(
region
,
&
count
,
matrix
);
expect
(
Ok
,
status
);
expect
(
1
,
count
);
/* two rectangles */
rectf
.
X
=
rectf
.
Y
=
5
.
0
;
rectf
.
Width
=
rectf
.
Height
=
5
.
0
;
status
=
GdipCombineRegionRect
(
region
,
&
rectf
,
CombineModeUnion
);
expect
(
Ok
,
status
);
status
=
GdipGetRegionScansCount
(
region
,
&
count
,
matrix
);
expect
(
Ok
,
status
);
expect
(
2
,
count
);
status
=
GdipDeleteRegion
(
region
);
expect
(
Ok
,
status
);
status
=
GdipDeleteMatrix
(
matrix
);
expect
(
Ok
,
status
);
}
static
void
test_getbounds
(
void
)
{
GpRegion
*
region
;
...
...
@@ -1742,6 +1805,7 @@ START_TEST(region)
test_isequal
();
test_translate
();
test_transform
();
test_scans
();
test_getbounds
();
test_isvisiblepoint
();
test_isvisiblerect
();
...
...
include/gdiplusflat.h
View file @
473afa4b
...
...
@@ -643,6 +643,7 @@ GpStatus WINGDIPAPI GdipGetRegionBoundsI(GpRegion *, GpGraphics *, GpRect *);
GpStatus
WINGDIPAPI
GdipGetRegionData
(
GpRegion
*
,
BYTE
*
,
UINT
,
UINT
*
);
GpStatus
WINGDIPAPI
GdipGetRegionDataSize
(
GpRegion
*
,
UINT
*
);
GpStatus
WINGDIPAPI
GdipGetRegionHRgn
(
GpRegion
*
,
GpGraphics
*
,
HRGN
*
);
GpStatus
WINGDIPAPI
GdipGetRegionScansCount
(
GpRegion
*
,
UINT
*
,
GpMatrix
*
);
GpStatus
WINGDIPAPI
GdipIsEmptyRegion
(
GpRegion
*
,
GpGraphics
*
,
BOOL
*
);
GpStatus
WINGDIPAPI
GdipIsEqualRegion
(
GpRegion
*
,
GpRegion
*
,
GpGraphics
*
,
BOOL
*
);
GpStatus
WINGDIPAPI
GdipIsInfiniteRegion
(
GpRegion
*
,
GpGraphics
*
,
BOOL
*
);
...
...
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