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
5f327f78
Commit
5f327f78
authored
Sep 30, 2010
by
Vincent Povirk
Committed by
Alexandre Julliard
Oct 28, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Implement GdipGetRegionScans.
parent
90edfe08
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
151 additions
and
2 deletions
+151
-2
gdiplus.spec
dlls/gdiplus/gdiplus.spec
+2
-2
region.c
dlls/gdiplus/region.c
+68
-0
region.c
dlls/gdiplus/tests/region.c
+79
-0
gdiplusflat.h
include/gdiplusflat.h
+2
-0
No files found.
dlls/gdiplus/gdiplus.spec
View file @
5f327f78
...
...
@@ -380,9 +380,9 @@
@ stdcall GdipGetRegionData(ptr ptr long ptr)
@ stdcall GdipGetRegionDataSize(ptr ptr)
@ stdcall GdipGetRegionHRgn(ptr ptr ptr)
@ st
ub GdipGetRegionScans
@ st
dcall GdipGetRegionScans(ptr ptr ptr ptr)
@ stdcall GdipGetRegionScansCount(ptr ptr ptr)
@ st
ub GdipGetRegionScansI
@ st
dcall GdipGetRegionScansI(ptr ptr ptr ptr)
@ stdcall GdipGetRenderingOrigin(ptr ptr ptr)
@ stdcall GdipGetSmoothingMode(ptr ptr)
@ stdcall GdipGetSolidFillColor(ptr ptr)
...
...
dlls/gdiplus/region.c
View file @
5f327f78
...
...
@@ -1441,3 +1441,71 @@ GpStatus WINGDIPAPI GdipGetRegionScansCount(GpRegion *region, UINT *count, GpMat
return
stat
;
}
GpStatus
WINGDIPAPI
GdipGetRegionScansI
(
GpRegion
*
region
,
GpRect
*
scans
,
INT
*
count
,
GpMatrix
*
matrix
)
{
GpStatus
stat
;
INT
i
;
LPRGNDATA
data
;
RECT
*
rects
;
if
(
!
region
||
!
count
||
!
matrix
)
return
InvalidParameter
;
stat
=
get_region_scans_data
(
region
,
matrix
,
&
data
);
if
(
stat
==
Ok
)
{
*
count
=
data
->
rdh
.
nCount
;
rects
=
(
RECT
*
)
&
data
->
Buffer
;
if
(
scans
)
{
for
(
i
=
0
;
i
<
data
->
rdh
.
nCount
;
i
++
)
{
scans
[
i
].
X
=
rects
[
i
].
left
;
scans
[
i
].
Y
=
rects
[
i
].
top
;
scans
[
i
].
Width
=
rects
[
i
].
right
-
rects
[
i
].
left
;
scans
[
i
].
Height
=
rects
[
i
].
bottom
-
rects
[
i
].
top
;
}
}
GdipFree
(
data
);
}
return
Ok
;
}
GpStatus
WINGDIPAPI
GdipGetRegionScans
(
GpRegion
*
region
,
GpRectF
*
scans
,
INT
*
count
,
GpMatrix
*
matrix
)
{
GpStatus
stat
;
INT
i
;
LPRGNDATA
data
;
RECT
*
rects
;
if
(
!
region
||
!
count
||
!
matrix
)
return
InvalidParameter
;
stat
=
get_region_scans_data
(
region
,
matrix
,
&
data
);
if
(
stat
==
Ok
)
{
*
count
=
data
->
rdh
.
nCount
;
rects
=
(
RECT
*
)
&
data
->
Buffer
;
if
(
scans
)
{
for
(
i
=
0
;
i
<
data
->
rdh
.
nCount
;
i
++
)
{
scans
[
i
].
X
=
rects
[
i
].
left
;
scans
[
i
].
Y
=
rects
[
i
].
top
;
scans
[
i
].
Width
=
rects
[
i
].
right
-
rects
[
i
].
left
;
scans
[
i
].
Height
=
rects
[
i
].
bottom
-
rects
[
i
].
top
;
}
}
GdipFree
(
data
);
}
return
Ok
;
}
dlls/gdiplus/tests/region.c
View file @
5f327f78
...
...
@@ -22,6 +22,7 @@
#include "gdiplus.h"
#include "wingdi.h"
#include "wine/test.h"
#include <math.h>
#define RGNDATA_RECT 0x10000000
#define RGNDATA_PATH 0x10000001
...
...
@@ -33,6 +34,9 @@
#define expect(expected, got) ok(got == expected, "Expected %.8x, got %.8x\n", expected, got)
#define expectf_(expected, got, precision) ok(fabs(expected - got) < precision, "Expected %.2f, got %.2f\n", expected, got)
#define expectf(expected, got) expectf_(expected, got, 0.0001)
#define expect_magic(value) ok(*value == RGNDATA_MAGIC || *value == RGNDATA_MAGIC2, "Expected a known magic value, got %8x\n", *value)
#define expect_dword(value, expected) ok(*(value) == expected, "expected %08x got %08x\n", expected, *(value))
...
...
@@ -1237,6 +1241,9 @@ static void test_scans(void)
GpRectF
rectf
;
GpStatus
status
;
ULONG
count
=
80085
;
INT
icount
;
GpRectF
scans
[
2
];
GpRect
scansi
[
2
];
status
=
GdipCreateRegion
(
&
region
);
expect
(
Ok
,
status
);
...
...
@@ -1254,11 +1261,44 @@ static void test_scans(void)
status
=
GdipGetRegionScansCount
(
region
,
&
count
,
NULL
);
expect
(
InvalidParameter
,
status
);
status
=
GdipGetRegionScans
(
NULL
,
scans
,
&
icount
,
matrix
);
expect
(
InvalidParameter
,
status
);
status
=
GdipGetRegionScans
(
region
,
scans
,
NULL
,
matrix
);
expect
(
InvalidParameter
,
status
);
status
=
GdipGetRegionScans
(
region
,
scans
,
&
icount
,
NULL
);
expect
(
InvalidParameter
,
status
);
/* infinite */
status
=
GdipGetRegionScansCount
(
region
,
&
count
,
matrix
);
expect
(
Ok
,
status
);
expect
(
1
,
count
);
status
=
GdipGetRegionScans
(
region
,
NULL
,
&
icount
,
matrix
);
expect
(
Ok
,
status
);
expect
(
1
,
icount
);
status
=
GdipGetRegionScans
(
region
,
scans
,
&
icount
,
matrix
);
expect
(
Ok
,
status
);
expect
(
1
,
icount
);
status
=
GdipGetRegionScansI
(
region
,
scansi
,
&
icount
,
matrix
);
expect
(
Ok
,
status
);
expect
(
1
,
icount
);
expect
(
-
0x400000
,
scansi
[
0
].
X
);
expect
(
-
0x400000
,
scansi
[
0
].
Y
);
expect
(
0x800000
,
scansi
[
0
].
Width
);
expect
(
0x800000
,
scansi
[
0
].
Height
);
status
=
GdipGetRegionScans
(
region
,
scans
,
&
icount
,
matrix
);
expect
(
Ok
,
status
);
expect
(
1
,
icount
);
expectf
((
double
)
-
0x400000
,
scans
[
0
].
X
);
expectf
((
double
)
-
0x400000
,
scans
[
0
].
Y
);
expectf
((
double
)
0x800000
,
scans
[
0
].
Width
);
expectf
((
double
)
0x800000
,
scans
[
0
].
Height
);
/* empty */
status
=
GdipSetEmpty
(
region
);
expect
(
Ok
,
status
);
...
...
@@ -1267,6 +1307,10 @@ static void test_scans(void)
expect
(
Ok
,
status
);
expect
(
0
,
count
);
status
=
GdipGetRegionScans
(
region
,
scans
,
&
icount
,
matrix
);
expect
(
Ok
,
status
);
expect
(
0
,
icount
);
/* single rectangle */
rectf
.
X
=
rectf
.
Y
=
0
.
0
;
rectf
.
Width
=
rectf
.
Height
=
5
.
0
;
...
...
@@ -1277,6 +1321,14 @@ static void test_scans(void)
expect
(
Ok
,
status
);
expect
(
1
,
count
);
status
=
GdipGetRegionScans
(
region
,
scans
,
&
icount
,
matrix
);
expect
(
Ok
,
status
);
expect
(
1
,
icount
);
expectf
(
0
.
0
,
scans
[
0
].
X
);
expectf
(
0
.
0
,
scans
[
0
].
Y
);
expectf
(
5
.
0
,
scans
[
0
].
Width
);
expectf
(
5
.
0
,
scans
[
0
].
Height
);
/* two rectangles */
rectf
.
X
=
rectf
.
Y
=
5
.
0
;
rectf
.
Width
=
rectf
.
Height
=
5
.
0
;
...
...
@@ -1287,6 +1339,33 @@ static void test_scans(void)
expect
(
Ok
,
status
);
expect
(
2
,
count
);
/* Native ignores the initial value of count */
scans
[
1
].
X
=
scans
[
1
].
Y
=
scans
[
1
].
Width
=
scans
[
1
].
Height
=
8
.
0
;
icount
=
1
;
status
=
GdipGetRegionScans
(
region
,
scans
,
&
icount
,
matrix
);
expect
(
Ok
,
status
);
expect
(
2
,
icount
);
expectf
(
0
.
0
,
scans
[
0
].
X
);
expectf
(
0
.
0
,
scans
[
0
].
Y
);
expectf
(
5
.
0
,
scans
[
0
].
Width
);
expectf
(
5
.
0
,
scans
[
0
].
Height
);
expectf
(
5
.
0
,
scans
[
1
].
X
);
expectf
(
5
.
0
,
scans
[
1
].
Y
);
expectf
(
5
.
0
,
scans
[
1
].
Width
);
expectf
(
5
.
0
,
scans
[
1
].
Height
);
status
=
GdipGetRegionScansI
(
region
,
scansi
,
&
icount
,
matrix
);
expect
(
Ok
,
status
);
expect
(
2
,
icount
);
expect
(
0
,
scansi
[
0
].
X
);
expect
(
0
,
scansi
[
0
].
Y
);
expect
(
5
,
scansi
[
0
].
Width
);
expect
(
5
,
scansi
[
0
].
Height
);
expect
(
5
,
scansi
[
1
].
X
);
expect
(
5
,
scansi
[
1
].
Y
);
expect
(
5
,
scansi
[
1
].
Width
);
expect
(
5
,
scansi
[
1
].
Height
);
status
=
GdipDeleteRegion
(
region
);
expect
(
Ok
,
status
);
status
=
GdipDeleteMatrix
(
matrix
);
...
...
include/gdiplusflat.h
View file @
5f327f78
...
...
@@ -643,6 +643,8 @@ 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
GdipGetRegionScans
(
GpRegion
*
,
GpRectF
*
,
INT
*
,
GpMatrix
*
);
GpStatus
WINGDIPAPI
GdipGetRegionScansI
(
GpRegion
*
,
GpRect
*
,
INT
*
,
GpMatrix
*
);
GpStatus
WINGDIPAPI
GdipGetRegionScansCount
(
GpRegion
*
,
UINT
*
,
GpMatrix
*
);
GpStatus
WINGDIPAPI
GdipIsEmptyRegion
(
GpRegion
*
,
GpGraphics
*
,
BOOL
*
);
GpStatus
WINGDIPAPI
GdipIsEqualRegion
(
GpRegion
*
,
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