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
01abb3d1
Commit
01abb3d1
authored
Jul 21, 2008
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jul 22, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: implemeted GdipGetPathGradientBlendCount with test.
parent
5e3786f8
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
78 additions
and
1 deletion
+78
-1
brush.c
dlls/gdiplus/brush.c
+48
-0
gdiplus.spec
dlls/gdiplus/gdiplus.spec
+1
-1
gdiplus_private.h
dlls/gdiplus/gdiplus_private.h
+3
-0
brush.c
dlls/gdiplus/tests/brush.c
+25
-0
gdiplusflat.h
include/gdiplusflat.h
+1
-0
No files found.
dlls/gdiplus/brush.c
View file @
01abb3d1
...
...
@@ -75,6 +75,24 @@ GpStatus WINGDIPAPI GdipCloneBrush(GpBrush *brush, GpBrush **clone)
memcpy
(
dest
->
pathdata
.
Points
,
src
->
pathdata
.
Points
,
count
*
sizeof
(
PointF
));
memcpy
(
dest
->
pathdata
.
Types
,
src
->
pathdata
.
Types
,
count
);
/* blending */
count
=
src
->
blendcount
;
dest
->
blendcount
=
count
;
dest
->
blendfac
=
GdipAlloc
(
count
*
sizeof
(
REAL
));
dest
->
blendpos
=
GdipAlloc
(
count
*
sizeof
(
REAL
));
if
(
!
dest
->
blendfac
||
!
dest
->
blendpos
){
GdipFree
(
dest
->
pathdata
.
Points
);
GdipFree
(
dest
->
pathdata
.
Types
);
GdipFree
(
dest
->
blendfac
);
GdipFree
(
dest
->
blendpos
);
GdipFree
(
dest
);
return
OutOfMemory
;
}
memcpy
(
dest
->
blendfac
,
src
->
blendfac
,
count
*
sizeof
(
REAL
));
memcpy
(
dest
->
blendpos
,
src
->
blendpos
,
count
*
sizeof
(
REAL
));
break
;
}
case
BrushTypeLinearGradient
:
...
...
@@ -213,6 +231,15 @@ GpStatus WINGDIPAPI GdipCreatePathGradient(GDIPCONST GpPointF* points,
*
grad
=
GdipAlloc
(
sizeof
(
GpPathGradient
));
if
(
!*
grad
)
return
OutOfMemory
;
(
*
grad
)
->
blendfac
=
GdipAlloc
(
sizeof
(
REAL
));
if
(
!
(
*
grad
)
->
blendfac
){
GdipFree
(
*
grad
);
return
OutOfMemory
;
}
(
*
grad
)
->
blendfac
[
0
]
=
1
.
0
;
(
*
grad
)
->
blendpos
=
NULL
;
(
*
grad
)
->
blendcount
=
1
;
(
*
grad
)
->
pathdata
.
Count
=
count
;
(
*
grad
)
->
pathdata
.
Points
=
GdipAlloc
(
count
*
sizeof
(
PointF
));
(
*
grad
)
->
pathdata
.
Types
=
GdipAlloc
(
count
);
...
...
@@ -284,6 +311,15 @@ GpStatus WINGDIPAPI GdipCreatePathGradientFromPath(GDIPCONST GpPath* path,
*
grad
=
GdipAlloc
(
sizeof
(
GpPathGradient
));
if
(
!*
grad
)
return
OutOfMemory
;
(
*
grad
)
->
blendfac
=
GdipAlloc
(
sizeof
(
REAL
));
if
(
!
(
*
grad
)
->
blendfac
){
GdipFree
(
*
grad
);
return
OutOfMemory
;
}
(
*
grad
)
->
blendfac
[
0
]
=
1
.
0
;
(
*
grad
)
->
blendpos
=
NULL
;
(
*
grad
)
->
blendcount
=
1
;
(
*
grad
)
->
pathdata
.
Count
=
path
->
pathdata
.
Count
;
(
*
grad
)
->
pathdata
.
Points
=
GdipAlloc
(
path
->
pathdata
.
Count
*
sizeof
(
PointF
));
(
*
grad
)
->
pathdata
.
Types
=
GdipAlloc
(
path
->
pathdata
.
Count
);
...
...
@@ -476,6 +512,8 @@ GpStatus WINGDIPAPI GdipDeleteBrush(GpBrush *brush)
case
BrushTypePathGradient
:
GdipFree
(((
GpPathGradient
*
)
brush
)
->
pathdata
.
Points
);
GdipFree
(((
GpPathGradient
*
)
brush
)
->
pathdata
.
Types
);
GdipFree
(((
GpPathGradient
*
)
brush
)
->
blendfac
);
GdipFree
(((
GpPathGradient
*
)
brush
)
->
blendpos
);
break
;
case
BrushTypeSolidColor
:
case
BrushTypeLinearGradient
:
...
...
@@ -511,6 +549,16 @@ GpStatus WINGDIPAPI GdipGetLineWrapMode(GpLineGradient *brush, GpWrapMode *wrapm
return
Ok
;
}
GpStatus
WINGDIPAPI
GdipGetPathGradientBlendCount
(
GpPathGradient
*
brush
,
INT
*
count
)
{
if
(
!
brush
||
!
count
)
return
InvalidParameter
;
*
count
=
brush
->
blendcount
;
return
Ok
;
}
GpStatus
WINGDIPAPI
GdipGetPathGradientCenterPoint
(
GpPathGradient
*
grad
,
GpPointF
*
point
)
{
...
...
dlls/gdiplus/gdiplus.spec
View file @
01abb3d1
...
...
@@ -326,7 +326,7 @@
@ stdcall GdipGetPathData(ptr ptr)
@ stdcall GdipGetPathFillMode(ptr ptr)
@ stub GdipGetPathGradientBlend
@ st
ub GdipGetPathGradientBlendCount
@ st
dcall GdipGetPathGradientBlendCount(ptr ptr)
@ stub GdipGetPathGradientCenterColor
@ stdcall GdipGetPathGradientCenterPoint(ptr ptr)
@ stdcall GdipGetPathGradientCenterPointI(ptr ptr)
...
...
dlls/gdiplus/gdiplus_private.h
View file @
01abb3d1
...
...
@@ -105,6 +105,9 @@ struct GpPathGradient{
BOOL
gamma
;
GpPointF
center
;
GpPointF
focus
;
REAL
*
blendfac
;
/* blend factors */
REAL
*
blendpos
;
/* blend positions */
INT
blendcount
;
};
struct
GpLineGradient
{
...
...
dlls/gdiplus/tests/brush.c
View file @
01abb3d1
...
...
@@ -54,6 +54,30 @@ static void test_type(void)
GdipDeleteBrush
((
GpBrush
*
)
brush
);
}
static
GpPointF
blendcount_ptf
[]
=
{{
0
.
0
,
0
.
0
},
{
50
.
0
,
50
.
0
}};
static
void
test_gradientblendcount
(
void
)
{
GpStatus
status
;
GpPathGradient
*
brush
;
INT
count
;
status
=
GdipCreatePathGradient
(
blendcount_ptf
,
2
,
WrapModeClamp
,
&
brush
);
expect
(
Ok
,
status
);
status
=
GdipGetPathGradientBlendCount
(
NULL
,
NULL
);
expect
(
InvalidParameter
,
status
);
status
=
GdipGetPathGradientBlendCount
(
NULL
,
&
count
);
expect
(
InvalidParameter
,
status
);
status
=
GdipGetPathGradientBlendCount
(
brush
,
NULL
);
expect
(
InvalidParameter
,
status
);
status
=
GdipGetPathGradientBlendCount
(
brush
,
&
count
);
expect
(
Ok
,
status
);
expect
(
1
,
count
);
GdipDeleteBrush
((
GpBrush
*
)
brush
);
}
START_TEST
(
brush
)
{
...
...
@@ -69,6 +93,7 @@ START_TEST(brush)
test_constructor_destructor
();
test_type
();
test_gradientblendcount
();
GdiplusShutdown
(
gdiplusToken
);
}
include/gdiplusflat.h
View file @
01abb3d1
...
...
@@ -199,6 +199,7 @@ GpStatus WINGDIPAPI GdipGetLineWrapMode(GpLineGradient*,GpWrapMode*);
GpStatus
WINGDIPAPI
GdipGetLineRect
(
GpLineGradient
*
,
GpRectF
*
);
GpStatus
WINGDIPAPI
GdipGetLineRectI
(
GpLineGradient
*
,
GpRect
*
);
GpStatus
WINGDIPAPI
GdipGetLineColors
(
GpLineGradient
*
,
ARGB
*
);
GpStatus
WINGDIPAPI
GdipGetPathGradientBlendCount
(
GpPathGradient
*
,
INT
*
);
GpStatus
WINGDIPAPI
GdipGetPathGradientCenterColor
(
GpPathGradient
*
,
ARGB
*
);
GpStatus
WINGDIPAPI
GdipGetPathGradientCenterPoint
(
GpPathGradient
*
,
GpPointF
*
);
GpStatus
WINGDIPAPI
GdipGetPathGradientCenterPointI
(
GpPathGradient
*
,
GpPoint
*
);
...
...
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