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
ad6adc75
Commit
ad6adc75
authored
Sep 14, 2009
by
Vincent Povirk
Committed by
Alexandre Julliard
Sep 15, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Add tests for linear gradient preset blends.
parent
8bdabe3a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
89 additions
and
0 deletions
+89
-0
brush.c
dlls/gdiplus/tests/brush.c
+85
-0
gdiplusflat.h
include/gdiplusflat.h
+4
-0
No files found.
dlls/gdiplus/tests/brush.c
View file @
ad6adc75
...
...
@@ -395,8 +395,11 @@ static void test_lineblend(void)
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
};
const
REAL
two_positions
[
2
]
=
{
0
.
0
f
,
1
.
0
f
};
const
ARGB
colors
[
5
]
=
{
0xff0000ff
,
0xff00ff00
,
0xff00ffff
,
0xffff0000
,
0xffffffff
};
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
};
ARGB
res_colors
[
6
]
=
{
0xdeadbeef
,
0
,
0
,
0
,
0
};
pt1
.
X
=
pt1
.
Y
=
1
.
0
;
pt2
.
X
=
pt2
.
Y
=
100
.
0
;
...
...
@@ -489,6 +492,88 @@ static void test_lineblend(void)
status
=
GdipGetLineBlend
(
brush
,
res_factors
,
res_positions
,
1
);
expect
(
Ok
,
status
);
status
=
GdipGetLinePresetBlendCount
(
NULL
,
&
count
);
expect
(
InvalidParameter
,
status
);
status
=
GdipGetLinePresetBlendCount
(
brush
,
NULL
);
expect
(
InvalidParameter
,
status
);
status
=
GdipGetLinePresetBlendCount
(
brush
,
&
count
);
expect
(
Ok
,
status
);
expect
(
0
,
count
);
status
=
GdipGetLinePresetBlend
(
NULL
,
res_colors
,
res_positions
,
1
);
expect
(
InvalidParameter
,
status
);
status
=
GdipGetLinePresetBlend
(
brush
,
NULL
,
res_positions
,
1
);
expect
(
InvalidParameter
,
status
);
status
=
GdipGetLinePresetBlend
(
brush
,
res_colors
,
NULL
,
1
);
expect
(
InvalidParameter
,
status
);
status
=
GdipGetLinePresetBlend
(
brush
,
res_colors
,
res_positions
,
0
);
expect
(
InvalidParameter
,
status
);
status
=
GdipGetLinePresetBlend
(
brush
,
res_colors
,
res_positions
,
-
1
);
expect
(
InvalidParameter
,
status
);
status
=
GdipGetLinePresetBlend
(
brush
,
res_colors
,
res_positions
,
1
);
expect
(
InvalidParameter
,
status
);
status
=
GdipGetLinePresetBlend
(
brush
,
res_colors
,
res_positions
,
2
);
expect
(
GenericError
,
status
);
status
=
GdipSetLinePresetBlend
(
NULL
,
colors
,
positions
,
5
);
expect
(
InvalidParameter
,
status
);
status
=
GdipSetLinePresetBlend
(
brush
,
NULL
,
positions
,
5
);
expect
(
InvalidParameter
,
status
);
status
=
GdipSetLinePresetBlend
(
brush
,
colors
,
NULL
,
5
);
expect
(
InvalidParameter
,
status
);
status
=
GdipSetLinePresetBlend
(
brush
,
colors
,
positions
,
0
);
expect
(
InvalidParameter
,
status
);
status
=
GdipSetLinePresetBlend
(
brush
,
colors
,
positions
,
-
1
);
expect
(
InvalidParameter
,
status
);
status
=
GdipSetLinePresetBlend
(
brush
,
colors
,
positions
,
1
);
expect
(
InvalidParameter
,
status
);
/* leave off the 0.0 position */
status
=
GdipSetLinePresetBlend
(
brush
,
&
colors
[
1
],
&
positions
[
1
],
4
);
expect
(
InvalidParameter
,
status
);
/* leave off the 1.0 position */
status
=
GdipSetLinePresetBlend
(
brush
,
colors
,
positions
,
4
);
expect
(
InvalidParameter
,
status
);
status
=
GdipSetLinePresetBlend
(
brush
,
colors
,
positions
,
5
);
expect
(
Ok
,
status
);
status
=
GdipGetLinePresetBlendCount
(
brush
,
&
count
);
expect
(
Ok
,
status
);
expect
(
5
,
count
);
status
=
GdipGetLinePresetBlend
(
brush
,
res_colors
,
res_positions
,
4
);
expect
(
InsufficientBuffer
,
status
);
status
=
GdipGetLinePresetBlend
(
brush
,
res_colors
,
res_positions
,
5
);
expect
(
Ok
,
status
);
for
(
i
=
0
;
i
<
5
;
i
++
)
{
expect
(
colors
[
i
],
res_colors
[
i
]);
expectf
(
positions
[
i
],
res_positions
[
i
]);
}
status
=
GdipGetLinePresetBlend
(
brush
,
res_colors
,
res_positions
,
6
);
expect
(
Ok
,
status
);
status
=
GdipSetLinePresetBlend
(
brush
,
colors
,
two_positions
,
2
);
expect
(
Ok
,
status
);
status
=
GdipDeleteBrush
((
GpBrush
*
)
brush
);
expect
(
Ok
,
status
);
}
...
...
include/gdiplusflat.h
View file @
ad6adc75
...
...
@@ -412,6 +412,10 @@ GpStatus WINGDIPAPI GdipSetLineBlend(GpLineGradient*,GDIPCONST REAL*,
GDIPCONST
REAL
*
,
INT
);
GpStatus
WINGDIPAPI
GdipGetLineBlend
(
GpLineGradient
*
,
REAL
*
,
REAL
*
,
INT
);
GpStatus
WINGDIPAPI
GdipGetLineBlendCount
(
GpLineGradient
*
,
INT
*
);
GpStatus
WINGDIPAPI
GdipSetLinePresetBlend
(
GpLineGradient
*
,
GDIPCONST
ARGB
*
,
GDIPCONST
REAL
*
,
INT
);
GpStatus
WINGDIPAPI
GdipGetLinePresetBlend
(
GpLineGradient
*
,
ARGB
*
,
REAL
*
,
INT
);
GpStatus
WINGDIPAPI
GdipGetLinePresetBlendCount
(
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