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
47c3993a
Commit
47c3993a
authored
Apr 28, 2009
by
Vincent Povirk
Committed by
Alexandre Julliard
Apr 29, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Add tests for GdipGet/SetLineBlend.
parent
47a81f5a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
110 additions
and
0 deletions
+110
-0
brush.c
dlls/gdiplus/tests/brush.c
+108
-0
gdiplusflat.h
include/gdiplusflat.h
+2
-0
No files found.
dlls/gdiplus/tests/brush.c
View file @
47c3993a
...
...
@@ -344,6 +344,113 @@ static void test_gradientgetrect(void)
status
=
GdipDeleteBrush
((
GpBrush
*
)
brush
);
}
static
void
test_lineblend
(
void
)
{
GpLineGradient
*
brush
;
GpStatus
status
;
GpPointF
pt1
,
pt2
;
INT
count
=
10
;
int
i
;
const
REAL
factors
[
5
]
=
{
0
.
0
f
,
0
.
1
f
,
0
.
5
f
,
0
.
9
f
,
1
.
0
f
};
const
REAL
positions
[
5
]
=
{
0
.
0
f
,
0
.
2
f
,
0
.
5
f
,
0
.
8
f
,
1
.
0
f
};
REAL
res_factors
[
6
]
=
{
0
.
3
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
};
REAL
res_positions
[
6
]
=
{
0
.
3
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
};
pt1
.
X
=
pt1
.
Y
=
1
.
0
;
pt2
.
X
=
pt2
.
Y
=
100
.
0
;
status
=
GdipCreateLineBrush
(
&
pt1
,
&
pt2
,
0
,
0
,
WrapModeTile
,
&
brush
);
expect
(
Ok
,
status
);
status
=
GdipGetLineBlendCount
(
NULL
,
&
count
);
expect
(
InvalidParameter
,
status
);
status
=
GdipGetLineBlendCount
(
brush
,
NULL
);
expect
(
InvalidParameter
,
status
);
status
=
GdipGetLineBlendCount
(
brush
,
&
count
);
expect
(
Ok
,
status
);
expect
(
1
,
count
);
status
=
GdipGetLineBlend
(
NULL
,
res_factors
,
res_positions
,
1
);
expect
(
InvalidParameter
,
status
);
status
=
GdipGetLineBlend
(
brush
,
NULL
,
res_positions
,
1
);
expect
(
InvalidParameter
,
status
);
status
=
GdipGetLineBlend
(
brush
,
res_factors
,
NULL
,
1
);
expect
(
InvalidParameter
,
status
);
status
=
GdipGetLineBlend
(
brush
,
res_factors
,
res_positions
,
0
);
expect
(
InvalidParameter
,
status
);
status
=
GdipGetLineBlend
(
brush
,
res_factors
,
res_positions
,
-
1
);
expect
(
InvalidParameter
,
status
);
status
=
GdipGetLineBlend
(
brush
,
res_factors
,
res_positions
,
1
);
expect
(
Ok
,
status
);
status
=
GdipGetLineBlend
(
brush
,
res_factors
,
res_positions
,
2
);
expect
(
Ok
,
status
);
status
=
GdipSetLineBlend
(
NULL
,
factors
,
positions
,
5
);
expect
(
InvalidParameter
,
status
);
status
=
GdipSetLineBlend
(
brush
,
NULL
,
positions
,
5
);
expect
(
InvalidParameter
,
status
);
status
=
GdipSetLineBlend
(
brush
,
factors
,
NULL
,
5
);
expect
(
InvalidParameter
,
status
);
status
=
GdipSetLineBlend
(
brush
,
factors
,
positions
,
0
);
expect
(
InvalidParameter
,
status
);
status
=
GdipSetLineBlend
(
brush
,
factors
,
positions
,
-
1
);
expect
(
InvalidParameter
,
status
);
/* leave off the 0.0 position */
status
=
GdipSetLineBlend
(
brush
,
&
factors
[
1
],
&
positions
[
1
],
4
);
expect
(
InvalidParameter
,
status
);
/* leave off the 1.0 position */
status
=
GdipSetLineBlend
(
brush
,
factors
,
positions
,
4
);
expect
(
InvalidParameter
,
status
);
status
=
GdipSetLineBlend
(
brush
,
factors
,
positions
,
5
);
expect
(
Ok
,
status
);
status
=
GdipGetLineBlendCount
(
brush
,
&
count
);
expect
(
Ok
,
status
);
expect
(
5
,
count
);
status
=
GdipGetLineBlend
(
brush
,
res_factors
,
res_positions
,
4
);
expect
(
InsufficientBuffer
,
status
);
status
=
GdipGetLineBlend
(
brush
,
res_factors
,
res_positions
,
5
);
expect
(
Ok
,
status
);
for
(
i
=
0
;
i
<
5
;
i
++
)
{
expectf
(
factors
[
i
],
res_factors
[
i
]);
expectf
(
positions
[
i
],
res_positions
[
i
]);
}
status
=
GdipGetLineBlend
(
brush
,
res_factors
,
res_positions
,
6
);
expect
(
Ok
,
status
);
status
=
GdipSetLineBlend
(
brush
,
factors
,
positions
,
1
);
expect
(
Ok
,
status
);
status
=
GdipGetLineBlendCount
(
brush
,
&
count
);
expect
(
Ok
,
status
);
expect
(
1
,
count
);
status
=
GdipGetLineBlend
(
brush
,
res_factors
,
res_positions
,
1
);
expect
(
Ok
,
status
);
status
=
GdipDeleteBrush
((
GpBrush
*
)
brush
);
expect
(
Ok
,
status
);
}
START_TEST
(
brush
)
{
struct
GdiplusStartupInput
gdiplusStartupInput
;
...
...
@@ -365,6 +472,7 @@ START_TEST(brush)
test_transform
();
test_texturewrap
();
test_gradientgetrect
();
test_lineblend
();
GdiplusShutdown
(
gdiplusToken
);
}
include/gdiplusflat.h
View file @
47c3993a
...
...
@@ -382,6 +382,8 @@ GpStatus WINGDIPAPI GdipGetLineRectI(GpLineGradient*,GpRect*);
GpStatus
WINGDIPAPI
GdipGetLineWrapMode
(
GpLineGradient
*
,
GpWrapMode
*
);
GpStatus
WINGDIPAPI
GdipSetLineBlend
(
GpLineGradient
*
,
GDIPCONST
REAL
*
,
GDIPCONST
REAL
*
,
INT
);
GpStatus
WINGDIPAPI
GdipGetLineBlend
(
GpLineGradient
*
,
REAL
*
,
REAL
*
,
INT
);
GpStatus
WINGDIPAPI
GdipGetLineBlendCount
(
GpLineGradient
*
,
INT
*
);
GpStatus
WINGDIPAPI
GdipSetLineColors
(
GpLineGradient
*
,
ARGB
,
ARGB
);
GpStatus
WINGDIPAPI
GdipSetLineGammaCorrection
(
GpLineGradient
*
,
BOOL
);
GpStatus
WINGDIPAPI
GdipSetLineSigmaBlend
(
GpLineGradient
*
,
REAL
,
REAL
);
...
...
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