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
aed62dbf
Commit
aed62dbf
authored
Mar 31, 2012
by
Vincent Povirk
Committed by
Alexandre Julliard
Apr 02, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Add tests for preset blend accessors.
parent
5254a76a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
143 additions
and
0 deletions
+143
-0
brush.c
dlls/gdiplus/tests/brush.c
+141
-0
gdiplusflat.h
include/gdiplusflat.h
+2
-0
No files found.
dlls/gdiplus/tests/brush.c
View file @
aed62dbf
...
@@ -993,6 +993,146 @@ static void test_pathgradientcenterpoint(void)
...
@@ -993,6 +993,146 @@ static void test_pathgradientcenterpoint(void)
expect
(
Ok
,
status
);
expect
(
Ok
,
status
);
}
}
void
test_pathgradientpresetblend
(
void
)
{
static
const
GpPointF
path_points
[]
=
{{
0
,
0
},
{
3
,
0
},
{
0
,
4
}};
GpStatus
status
;
GpPathGradient
*
grad
;
INT
count
;
int
i
;
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_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
};
status
=
GdipCreatePathGradient
(
path_points
+
1
,
2
,
WrapModeClamp
,
&
grad
);
expect
(
Ok
,
status
);
status
=
GdipGetPathGradientPresetBlendCount
(
NULL
,
&
count
);
expect
(
InvalidParameter
,
status
);
status
=
GdipGetPathGradientPresetBlendCount
(
grad
,
NULL
);
expect
(
InvalidParameter
,
status
);
status
=
GdipGetPathGradientPresetBlendCount
(
grad
,
&
count
);
expect
(
Ok
,
status
);
expect
(
0
,
count
);
status
=
GdipGetPathGradientPresetBlend
(
NULL
,
res_colors
,
res_positions
,
1
);
expect
(
InvalidParameter
,
status
);
status
=
GdipGetPathGradientPresetBlend
(
grad
,
NULL
,
res_positions
,
1
);
expect
(
InvalidParameter
,
status
);
status
=
GdipGetPathGradientPresetBlend
(
grad
,
res_colors
,
NULL
,
1
);
expect
(
InvalidParameter
,
status
);
status
=
GdipGetPathGradientPresetBlend
(
grad
,
res_colors
,
res_positions
,
0
);
expect
(
InvalidParameter
,
status
);
status
=
GdipGetPathGradientPresetBlend
(
grad
,
res_colors
,
res_positions
,
-
1
);
expect
(
OutOfMemory
,
status
);
status
=
GdipGetPathGradientPresetBlend
(
grad
,
res_colors
,
res_positions
,
1
);
expect
(
InvalidParameter
,
status
);
status
=
GdipGetPathGradientPresetBlend
(
grad
,
res_colors
,
res_positions
,
2
);
expect
(
GenericError
,
status
);
status
=
GdipSetPathGradientPresetBlend
(
NULL
,
colors
,
positions
,
5
);
expect
(
InvalidParameter
,
status
);
status
=
GdipSetPathGradientPresetBlend
(
grad
,
NULL
,
positions
,
5
);
expect
(
InvalidParameter
,
status
);
if
(
0
)
{
/* crashes on windows xp */
status
=
GdipSetPathGradientPresetBlend
(
grad
,
colors
,
NULL
,
5
);
expect
(
InvalidParameter
,
status
);
}
status
=
GdipSetPathGradientPresetBlend
(
grad
,
colors
,
positions
,
0
);
expect
(
InvalidParameter
,
status
);
status
=
GdipSetPathGradientPresetBlend
(
grad
,
colors
,
positions
,
-
1
);
expect
(
InvalidParameter
,
status
);
status
=
GdipSetPathGradientPresetBlend
(
grad
,
colors
,
positions
,
1
);
expect
(
InvalidParameter
,
status
);
/* leave off the 0.0 position */
status
=
GdipSetPathGradientPresetBlend
(
grad
,
&
colors
[
1
],
&
positions
[
1
],
4
);
expect
(
InvalidParameter
,
status
);
/* leave off the 1.0 position */
status
=
GdipSetPathGradientPresetBlend
(
grad
,
colors
,
positions
,
4
);
expect
(
InvalidParameter
,
status
);
status
=
GdipSetPathGradientPresetBlend
(
grad
,
colors
,
positions
,
5
);
expect
(
Ok
,
status
);
status
=
GdipGetPathGradientPresetBlendCount
(
grad
,
&
count
);
expect
(
Ok
,
status
);
expect
(
5
,
count
);
if
(
0
)
{
/* Native GdipGetPathGradientPresetBlend seems to copy starting from
* the end of each array and do no bounds checking. This is so braindead
* I'm not going to copy it. */
res_colors
[
0
]
=
0xdeadbeef
;
res_positions
[
0
]
=
0
.
3
;
status
=
GdipGetPathGradientPresetBlend
(
grad
,
&
res_colors
[
1
],
&
res_positions
[
1
],
4
);
expect
(
Ok
,
status
);
expect
(
0xdeadbeef
,
res_colors
[
0
]);
expectf
(
0
.
3
,
res_positions
[
0
]);
for
(
i
=
1
;
i
<
5
;
i
++
)
{
expect
(
colors
[
i
],
res_colors
[
i
]);
expectf
(
positions
[
i
],
res_positions
[
i
]);
}
status
=
GdipGetPathGradientPresetBlend
(
grad
,
res_colors
,
res_positions
,
6
);
expect
(
Ok
,
status
);
for
(
i
=
0
;
i
<
5
;
i
++
)
{
expect
(
colors
[
i
],
res_colors
[
i
+
1
]);
expectf
(
positions
[
i
],
res_positions
[
i
+
1
]);
}
}
status
=
GdipGetPathGradientPresetBlend
(
grad
,
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
=
GdipGetPathGradientPresetBlend
(
grad
,
res_colors
,
res_positions
,
0
);
expect
(
InvalidParameter
,
status
);
status
=
GdipGetPathGradientPresetBlend
(
grad
,
res_colors
,
res_positions
,
-
1
);
expect
(
OutOfMemory
,
status
);
status
=
GdipGetPathGradientPresetBlend
(
grad
,
res_colors
,
res_positions
,
1
);
expect
(
InvalidParameter
,
status
);
status
=
GdipSetPathGradientPresetBlend
(
grad
,
colors
,
two_positions
,
2
);
expect
(
Ok
,
status
);
status
=
GdipDeleteBrush
((
GpBrush
*
)
grad
);
expect
(
Ok
,
status
);
}
START_TEST
(
brush
)
START_TEST
(
brush
)
{
{
struct
GdiplusStartupInput
gdiplusStartupInput
;
struct
GdiplusStartupInput
gdiplusStartupInput
;
...
@@ -1019,6 +1159,7 @@ START_TEST(brush)
...
@@ -1019,6 +1159,7 @@ START_TEST(brush)
test_gradientsurroundcolorcount
();
test_gradientsurroundcolorcount
();
test_pathgradientpath
();
test_pathgradientpath
();
test_pathgradientcenterpoint
();
test_pathgradientcenterpoint
();
test_pathgradientpresetblend
();
GdiplusShutdown
(
gdiplusToken
);
GdiplusShutdown
(
gdiplusToken
);
}
}
include/gdiplusflat.h
View file @
aed62dbf
...
@@ -555,6 +555,8 @@ GpStatus WINGDIPAPI GdipGetPathGradientCenterPointI(GpPathGradient*,GpPoint*);
...
@@ -555,6 +555,8 @@ GpStatus WINGDIPAPI GdipGetPathGradientCenterPointI(GpPathGradient*,GpPoint*);
GpStatus
WINGDIPAPI
GdipGetPathGradientFocusScales
(
GpPathGradient
*
,
REAL
*
,
REAL
*
);
GpStatus
WINGDIPAPI
GdipGetPathGradientFocusScales
(
GpPathGradient
*
,
REAL
*
,
REAL
*
);
GpStatus
WINGDIPAPI
GdipGetPathGradientGammaCorrection
(
GpPathGradient
*
,
BOOL
*
);
GpStatus
WINGDIPAPI
GdipGetPathGradientGammaCorrection
(
GpPathGradient
*
,
BOOL
*
);
GpStatus
WINGDIPAPI
GdipGetPathGradientPath
(
GpPathGradient
*
,
GpPath
*
);
GpStatus
WINGDIPAPI
GdipGetPathGradientPath
(
GpPathGradient
*
,
GpPath
*
);
GpStatus
WINGDIPAPI
GdipGetPathGradientPresetBlend
(
GpPathGradient
*
,
ARGB
*
,
REAL
*
,
INT
);
GpStatus
WINGDIPAPI
GdipGetPathGradientPresetBlendCount
(
GpPathGradient
*
,
INT
*
);
GpStatus
WINGDIPAPI
GdipGetPathGradientPointCount
(
GpPathGradient
*
,
INT
*
);
GpStatus
WINGDIPAPI
GdipGetPathGradientPointCount
(
GpPathGradient
*
,
INT
*
);
GpStatus
WINGDIPAPI
GdipSetPathGradientPresetBlend
(
GpPathGradient
*
,
GpStatus
WINGDIPAPI
GdipSetPathGradientPresetBlend
(
GpPathGradient
*
,
GDIPCONST
ARGB
*
,
GDIPCONST
REAL
*
,
INT
);
GDIPCONST
ARGB
*
,
GDIPCONST
REAL
*
,
INT
);
...
...
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