Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexey Alyaev
wine
Commits
7e90dc3d
Commit
7e90dc3d
authored
13 years ago
by
Esme Povirk
Committed by
Alexandre Julliard
13 years ago
Browse files
Options
Downloads
Patches
Plain Diff
gdiplus: Implement path gradient surround color accessors.
parent
7a9f6abd
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
dlls/gdiplus/brush.c
+39
-15
39 additions, 15 deletions
dlls/gdiplus/brush.c
dlls/gdiplus/gdiplus_private.h
+2
-0
2 additions, 0 deletions
dlls/gdiplus/gdiplus_private.h
dlls/gdiplus/tests/brush.c
+33
-23
33 additions, 23 deletions
dlls/gdiplus/tests/brush.c
with
74 additions
and
38 deletions
dlls/gdiplus/brush.c
+
39
−
15
View file @
7e90dc3d
...
...
@@ -83,17 +83,20 @@ GpStatus WINGDIPAPI GdipCloneBrush(GpBrush *brush, GpBrush **clone)
dest
->
blendcount
=
count
;
dest
->
blendfac
=
GdipAlloc
(
count
*
sizeof
(
REAL
));
dest
->
blendpos
=
GdipAlloc
(
count
*
sizeof
(
REAL
));
dest
->
surroundcolors
=
GdipAlloc
(
dest
->
surroundcolorcount
*
sizeof
(
ARGB
));
if
(
!
dest
->
blendfac
||
!
dest
->
blendpos
){
if
(
!
dest
->
blendfac
||
!
dest
->
blendpos
||
!
dest
->
surroundcolors
){
GdipDeletePath
(
dest
->
path
);
GdipFree
(
dest
->
blendfac
);
GdipFree
(
dest
->
blendpos
);
GdipFree
(
dest
->
surroundcolors
);
GdipFree
(
dest
);
return
OutOfMemory
;
}
memcpy
(
dest
->
blendfac
,
src
->
blendfac
,
count
*
sizeof
(
REAL
));
memcpy
(
dest
->
blendpos
,
src
->
blendpos
,
count
*
sizeof
(
REAL
));
memcpy
(
dest
->
surroundcolors
,
src
->
surroundcolors
,
dest
->
surroundcolorcount
*
sizeof
(
ARGB
));
break
;
}
...
...
@@ -499,9 +502,11 @@ static GpStatus create_path_gradient(GpPath *path, GpPathGradient **grad)
(
*
grad
)
->
blendfac
=
GdipAlloc
(
sizeof
(
REAL
));
(
*
grad
)
->
blendpos
=
GdipAlloc
(
sizeof
(
REAL
));
if
(
!
(
*
grad
)
->
blendfac
||
!
(
*
grad
)
->
blendpos
){
(
*
grad
)
->
surroundcolors
=
GdipAlloc
(
sizeof
(
ARGB
));
if
(
!
(
*
grad
)
->
blendfac
||
!
(
*
grad
)
->
blendpos
||
!
(
*
grad
)
->
surroundcolors
){
GdipFree
((
*
grad
)
->
blendfac
);
GdipFree
((
*
grad
)
->
blendpos
);
GdipFree
((
*
grad
)
->
surroundcolors
);
GdipFree
(
*
grad
);
*
grad
=
NULL
;
return
OutOfMemory
;
...
...
@@ -521,6 +526,8 @@ static GpStatus create_path_gradient(GpPath *path, GpPathGradient **grad)
(
*
grad
)
->
center
.
Y
=
bounds
.
Y
+
bounds
.
Height
/
2
;
(
*
grad
)
->
focus
.
X
=
0
.
0
;
(
*
grad
)
->
focus
.
Y
=
0
.
0
;
(
*
grad
)
->
surroundcolors
[
0
]
=
0xffffffff
;
(
*
grad
)
->
surroundcolorcount
=
1
;
TRACE
(
"<-- %p
\n
"
,
*
grad
);
...
...
@@ -870,6 +877,7 @@ GpStatus WINGDIPAPI GdipDeleteBrush(GpBrush *brush)
GdipDeletePath
(((
GpPathGradient
*
)
brush
)
->
path
);
GdipFree
(((
GpPathGradient
*
)
brush
)
->
blendfac
);
GdipFree
(((
GpPathGradient
*
)
brush
)
->
blendpos
);
GdipFree
(((
GpPathGradient
*
)
brush
)
->
surroundcolors
);
break
;
case
BrushTypeLinearGradient
:
GdipFree
(((
GpLineGradient
*
)
brush
)
->
blendfac
);
...
...
@@ -1086,32 +1094,40 @@ GpStatus WINGDIPAPI GdipGetPathGradientRectI(GpPathGradient *brush, GpRect *rect
GpStatus
WINGDIPAPI
GdipGetPathGradientSurroundColorsWithCount
(
GpPathGradient
*
grad
,
ARGB
*
argb
,
INT
*
count
)
{
static
int
calls
;
INT
i
;
TRACE
(
"(%p,%p,%p)
\n
"
,
grad
,
argb
,
count
);
if
(
!
grad
||
!
argb
||
!
count
||
(
*
count
<
grad
->
path
->
pathdata
.
Count
))
return
InvalidParameter
;
if
(
!
(
calls
++
))
FIXME
(
"not implemented
\n
"
);
for
(
i
=
0
;
i
<
grad
->
path
->
pathdata
.
Count
;
i
++
)
{
if
(
i
<
grad
->
surroundcolorcount
)
argb
[
i
]
=
grad
->
surroundcolors
[
i
];
else
argb
[
i
]
=
grad
->
surroundcolors
[
grad
->
surroundcolorcount
-
1
];
}
return
NotImplemented
;
*
count
=
grad
->
surroundcolorcount
;
return
Ok
;
}
GpStatus
WINGDIPAPI
GdipGetPathGradientSurroundColorCount
(
GpPathGradient
*
brush
,
INT
*
count
)
{
static
int
calls
;
TRACE
(
"(%p, %p)
\n
"
,
brush
,
count
);
if
(
!
brush
||
!
count
)
return
InvalidParameter
;
if
(
!
(
calls
++
))
FIXME
(
"not implemented
\n
"
);
/* Yes, this actually returns the number of points in the path (which is the
* required size of a buffer to get the surround colors), rather than the
* number of surround colors. The real count is returned when getting the
* colors. */
*
count
=
brush
->
path
->
pathdata
.
Count
;
return
NotImplemented
;
return
Ok
;
}
GpStatus
WINGDIPAPI
GdipGetPathGradientWrapMode
(
GpPathGradient
*
brush
,
...
...
@@ -1503,7 +1519,7 @@ GpStatus WINGDIPAPI GdipSetPathGradientSigmaBlend(GpPathGradient *grad,
GpStatus
WINGDIPAPI
GdipSetPathGradientSurroundColorsWithCount
(
GpPathGradient
*
grad
,
GDIPCONST
ARGB
*
argb
,
INT
*
count
)
{
static
int
call
s
;
ARGB
*
new_surroundcolor
s
;
TRACE
(
"(%p,%p,%p)
\n
"
,
grad
,
argb
,
count
);
...
...
@@ -1511,10 +1527,18 @@ GpStatus WINGDIPAPI GdipSetPathGradientSurroundColorsWithCount(GpPathGradient
(
*
count
>
grad
->
path
->
pathdata
.
Count
))
return
InvalidParameter
;
if
(
!
(
calls
++
))
FIXME
(
"not implemented
\n
"
);
new_surroundcolors
=
GdipAlloc
(
*
count
*
sizeof
(
ARGB
));
if
(
!
new_surroundcolors
)
return
OutOfMemory
;
return
NotImplemented
;
memcpy
(
new_surroundcolors
,
argb
,
*
count
*
sizeof
(
ARGB
));
GdipFree
(
grad
->
surroundcolors
);
grad
->
surroundcolors
=
new_surroundcolors
;
grad
->
surroundcolorcount
=
*
count
;
return
Ok
;
}
GpStatus
WINGDIPAPI
GdipSetPathGradientWrapMode
(
GpPathGradient
*
grad
,
...
...
This diff is collapsed.
Click to expand it.
dlls/gdiplus/gdiplus_private.h
+
2
−
0
View file @
7e90dc3d
...
...
@@ -196,6 +196,8 @@ struct GpPathGradient{
REAL
*
blendfac
;
/* blend factors */
REAL
*
blendpos
;
/* blend positions */
INT
blendcount
;
ARGB
*
surroundcolors
;
INT
surroundcolorcount
;
};
struct
GpLineGradient
{
...
...
This diff is collapsed.
Click to expand it.
dlls/gdiplus/tests/brush.c
+
33
−
23
View file @
7e90dc3d
...
...
@@ -781,25 +781,25 @@ static void test_gradientsurroundcolorcount(void)
count
=
0
;
status
=
GdipGetPathGradientSurroundColorCount
(
grad
,
&
count
);
todo_wine
expect
(
Ok
,
status
);
todo_wine
expect
(
2
,
count
);
expect
(
Ok
,
status
);
expect
(
2
,
count
);
color
[
0
]
=
color
[
1
]
=
color
[
2
]
=
0xdeadbeef
;
count
=
3
;
status
=
GdipGetPathGradientSurroundColorsWithCount
(
grad
,
color
,
&
count
);
todo_wine
expect
(
Ok
,
status
);
todo_wine
expect
(
1
,
count
);
todo_wine
expect
(
0xffffffff
,
color
[
0
]);
todo_wine
expect
(
0xffffffff
,
color
[
1
]);
expect
(
Ok
,
status
);
expect
(
1
,
count
);
expect
(
0xffffffff
,
color
[
0
]);
expect
(
0xffffffff
,
color
[
1
]);
expect
(
0xdeadbeef
,
color
[
2
]);
color
[
0
]
=
color
[
1
]
=
color
[
2
]
=
0xdeadbeef
;
count
=
2
;
status
=
GdipGetPathGradientSurroundColorsWithCount
(
grad
,
color
,
&
count
);
todo_wine
expect
(
Ok
,
status
);
todo_wine
expect
(
1
,
count
);
todo_wine
expect
(
0xffffffff
,
color
[
0
]);
todo_wine
expect
(
0xffffffff
,
color
[
1
]);
expect
(
Ok
,
status
);
expect
(
1
,
count
);
expect
(
0xffffffff
,
color
[
0
]);
expect
(
0xffffffff
,
color
[
1
]);
expect
(
0xdeadbeef
,
color
[
2
]);
color
[
0
]
=
color
[
1
]
=
color
[
2
]
=
0xdeadbeef
;
...
...
@@ -843,7 +843,7 @@ static void test_gradientsurroundcolorcount(void)
}
status
=
GdipSetPathGradientSurroundColorsWithCount
(
grad
,
color
,
&
count
);
todo_wine
expect
(
Ok
,
status
);
expect
(
Ok
,
status
);
expect
(
2
,
count
);
status
=
GdipGetPathGradientSurroundColorCount
(
NULL
,
&
count
);
...
...
@@ -854,26 +854,31 @@ static void test_gradientsurroundcolorcount(void)
count
=
0
;
status
=
GdipGetPathGradientSurroundColorCount
(
grad
,
&
count
);
todo_wine
expect
(
Ok
,
status
);
todo_wine
expect
(
2
,
count
);
expect
(
Ok
,
status
);
expect
(
2
,
count
);
color
[
0
]
=
color
[
1
]
=
color
[
2
]
=
0xdeadbeef
;
count
=
2
;
status
=
GdipGetPathGradientSurroundColorsWithCount
(
grad
,
color
,
&
count
);
todo_wine
expect
(
Ok
,
status
);
expect
(
Ok
,
status
);
expect
(
2
,
count
);
todo_wine
expect
(
0x00ff0000
,
color
[
0
]);
todo_wine
expect
(
0x0000ff00
,
color
[
1
]);
expect
(
0x00ff0000
,
color
[
0
]);
expect
(
0x0000ff00
,
color
[
1
]);
expect
(
0xdeadbeef
,
color
[
2
]);
count
=
1
;
status
=
GdipSetPathGradientSurroundColorsWithCount
(
grad
,
color
,
&
count
);
todo_wine
expect
(
Ok
,
status
);
expect
(
Ok
,
status
);
expect
(
1
,
count
);
count
=
0
;
status
=
GdipGetPathGradientSurroundColorCount
(
grad
,
&
count
);
expect
(
Ok
,
status
);
expect
(
2
,
count
);
count
=
0
;
status
=
GdipSetPathGradientSurroundColorsWithCount
(
grad
,
color
,
&
count
);
todo_wine
expect
(
InvalidParameter
,
status
);
expect
(
InvalidParameter
,
status
);
expect
(
0
,
count
);
GdipDeleteBrush
((
GpBrush
*
)
grad
);
...
...
@@ -884,11 +889,11 @@ static void test_gradientsurroundcolorcount(void)
color
[
0
]
=
color
[
1
]
=
color
[
2
]
=
0xdeadbeef
;
count
=
3
;
status
=
GdipGetPathGradientSurroundColorsWithCount
(
grad
,
color
,
&
count
);
todo_wine
expect
(
Ok
,
status
);
todo_wine
expect
(
1
,
count
);
todo_wine
expect
(
0xffffffff
,
color
[
0
]);
todo_wine
expect
(
0xffffffff
,
color
[
1
]);
todo_wine
expect
(
0xffffffff
,
color
[
2
]);
expect
(
Ok
,
status
);
expect
(
1
,
count
);
expect
(
0xffffffff
,
color
[
0
]);
expect
(
0xffffffff
,
color
[
1
]);
expect
(
0xffffffff
,
color
[
2
]);
color
[
0
]
=
color
[
1
]
=
color
[
2
]
=
0xdeadbeef
;
count
=
2
;
...
...
@@ -899,6 +904,11 @@ static void test_gradientsurroundcolorcount(void)
expect
(
0xdeadbeef
,
color
[
1
]);
expect
(
0xdeadbeef
,
color
[
2
]);
count
=
0
;
status
=
GdipGetPathGradientSurroundColorCount
(
grad
,
&
count
);
expect
(
Ok
,
status
);
expect
(
3
,
count
);
GdipDeleteBrush
((
GpBrush
*
)
grad
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment