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
5254a76a
Commit
5254a76a
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: Implement path gradient preset blend accessors.
parent
a85bb87c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
95 additions
and
7 deletions
+95
-7
brush.c
dlls/gdiplus/brush.c
+78
-7
gdiplus_private.h
dlls/gdiplus/gdiplus_private.h
+3
-0
graphics.c
dlls/gdiplus/graphics.c
+14
-0
No files found.
dlls/gdiplus/brush.c
View file @
5254a76a
...
...
@@ -60,7 +60,7 @@ GpStatus WINGDIPAPI GdipCloneBrush(GpBrush *brush, GpBrush **clone)
}
case
BrushTypePathGradient
:{
GpPathGradient
*
src
,
*
dest
;
INT
count
;
INT
count
,
pcount
;
GpStatus
stat
;
*
clone
=
GdipAlloc
(
sizeof
(
GpPathGradient
));
...
...
@@ -84,12 +84,21 @@ GpStatus WINGDIPAPI GdipCloneBrush(GpBrush *brush, GpBrush **clone)
dest
->
blendfac
=
GdipAlloc
(
count
*
sizeof
(
REAL
));
dest
->
blendpos
=
GdipAlloc
(
count
*
sizeof
(
REAL
));
dest
->
surroundcolors
=
GdipAlloc
(
dest
->
surroundcolorcount
*
sizeof
(
ARGB
));
pcount
=
dest
->
pblendcount
;
if
(
pcount
)
{
dest
->
pblendcolor
=
GdipAlloc
(
pcount
*
sizeof
(
ARGB
));
dest
->
pblendpos
=
GdipAlloc
(
pcount
*
sizeof
(
REAL
));
}
if
(
!
dest
->
blendfac
||
!
dest
->
blendpos
||
!
dest
->
surroundcolors
){
if
(
!
dest
->
blendfac
||
!
dest
->
blendpos
||
!
dest
->
surroundcolors
||
(
pcount
&&
(
!
dest
->
pblendcolor
||
!
dest
->
pblendpos
))){
GdipDeletePath
(
dest
->
path
);
GdipFree
(
dest
->
blendfac
);
GdipFree
(
dest
->
blendpos
);
GdipFree
(
dest
->
surroundcolors
);
GdipFree
(
dest
->
pblendcolor
);
GdipFree
(
dest
->
pblendpos
);
GdipFree
(
dest
);
return
OutOfMemory
;
}
...
...
@@ -98,6 +107,12 @@ GpStatus WINGDIPAPI GdipCloneBrush(GpBrush *brush, GpBrush **clone)
memcpy
(
dest
->
blendpos
,
src
->
blendpos
,
count
*
sizeof
(
REAL
));
memcpy
(
dest
->
surroundcolors
,
src
->
surroundcolors
,
dest
->
surroundcolorcount
*
sizeof
(
ARGB
));
if
(
pcount
)
{
memcpy
(
dest
->
pblendcolor
,
src
->
pblendcolor
,
pcount
*
sizeof
(
ARGB
));
memcpy
(
dest
->
pblendpos
,
src
->
pblendpos
,
pcount
*
sizeof
(
REAL
));
}
break
;
}
case
BrushTypeLinearGradient
:{
...
...
@@ -878,6 +893,8 @@ GpStatus WINGDIPAPI GdipDeleteBrush(GpBrush *brush)
GdipFree
(((
GpPathGradient
*
)
brush
)
->
blendfac
);
GdipFree
(((
GpPathGradient
*
)
brush
)
->
blendpos
);
GdipFree
(((
GpPathGradient
*
)
brush
)
->
surroundcolors
);
GdipFree
(((
GpPathGradient
*
)
brush
)
->
pblendcolor
);
GdipFree
(((
GpPathGradient
*
)
brush
)
->
pblendpos
);
break
;
case
BrushTypeLinearGradient
:
GdipFree
(((
GpLineGradient
*
)
brush
)
->
blendfac
);
...
...
@@ -1413,22 +1430,76 @@ GpStatus WINGDIPAPI GdipSetPathGradientLinearBlend(GpPathGradient *brush,
GpStatus
WINGDIPAPI
GdipSetPathGradientPresetBlend
(
GpPathGradient
*
brush
,
GDIPCONST
ARGB
*
blend
,
GDIPCONST
REAL
*
pos
,
INT
count
)
{
FIXME
(
"(%p,%p,%p,%i): stub
\n
"
,
brush
,
blend
,
pos
,
count
);
return
NotImplemented
;
ARGB
*
new_color
;
REAL
*
new_pos
;
TRACE
(
"(%p,%p,%p,%i)
\n
"
,
brush
,
blend
,
pos
,
count
);
if
(
!
brush
||
!
blend
||
!
pos
||
count
<
2
||
pos
[
0
]
!=
0
.
0
f
||
pos
[
count
-
1
]
!=
1
.
0
f
)
{
return
InvalidParameter
;
}
new_color
=
GdipAlloc
(
count
*
sizeof
(
ARGB
));
new_pos
=
GdipAlloc
(
count
*
sizeof
(
REAL
));
if
(
!
new_color
||
!
new_pos
)
{
GdipFree
(
new_color
);
GdipFree
(
new_pos
);
return
OutOfMemory
;
}
memcpy
(
new_color
,
blend
,
sizeof
(
ARGB
)
*
count
);
memcpy
(
new_pos
,
pos
,
sizeof
(
REAL
)
*
count
);
GdipFree
(
brush
->
pblendcolor
);
GdipFree
(
brush
->
pblendpos
);
brush
->
pblendcolor
=
new_color
;
brush
->
pblendpos
=
new_pos
;
brush
->
pblendcount
=
count
;
return
Ok
;
}
GpStatus
WINGDIPAPI
GdipGetPathGradientPresetBlend
(
GpPathGradient
*
brush
,
ARGB
*
blend
,
REAL
*
pos
,
INT
count
)
{
FIXME
(
"(%p,%p,%p,%i): stub
\n
"
,
brush
,
blend
,
pos
,
count
);
return
NotImplemented
;
TRACE
(
"(%p,%p,%p,%i)
\n
"
,
brush
,
blend
,
pos
,
count
);
if
(
count
<
0
)
return
OutOfMemory
;
if
(
!
brush
||
!
blend
||
!
pos
||
count
<
2
)
return
InvalidParameter
;
if
(
brush
->
pblendcount
==
0
)
return
GenericError
;
if
(
count
!=
brush
->
pblendcount
)
{
/* Native lines up the ends of each array, and copies the destination size. */
FIXME
(
"Braindead behavior on wrong-sized buffer not implemented.
\n
"
);
return
InvalidParameter
;
}
memcpy
(
blend
,
brush
->
pblendcolor
,
sizeof
(
ARGB
)
*
brush
->
pblendcount
);
memcpy
(
pos
,
brush
->
pblendpos
,
sizeof
(
REAL
)
*
brush
->
pblendcount
);
return
Ok
;
}
GpStatus
WINGDIPAPI
GdipGetPathGradientPresetBlendCount
(
GpPathGradient
*
brush
,
INT
*
count
)
{
FIXME
(
"(%p,%p): stub
\n
"
,
brush
,
count
);
return
NotImplemented
;
if
(
!
brush
||
!
count
)
return
InvalidParameter
;
*
count
=
brush
->
pblendcount
;
return
Ok
;
}
GpStatus
WINGDIPAPI
GdipSetPathGradientCenterColor
(
GpPathGradient
*
grad
,
...
...
dlls/gdiplus/gdiplus_private.h
View file @
5254a76a
...
...
@@ -198,6 +198,9 @@ struct GpPathGradient{
INT
blendcount
;
ARGB
*
surroundcolors
;
INT
surroundcolorcount
;
ARGB
*
pblendcolor
;
/* preset blend colors */
REAL
*
pblendpos
;
/* preset blend positions */
INT
pblendcount
;
};
struct
GpLineGradient
{
...
...
dlls/gdiplus/graphics.c
View file @
5254a76a
...
...
@@ -1207,6 +1207,20 @@ static GpStatus brush_fill_pixels(GpGraphics *graphics, GpBrush *brush,
FIXME
(
"path gradient gamma correction not implemented
\n
"
);
}
if
(
fill
->
blendcount
)
{
static
int
once
;
if
(
!
once
++
)
FIXME
(
"path gradient blend not implemented
\n
"
);
}
if
(
fill
->
pblendcount
)
{
static
int
once
;
if
(
!
once
++
)
FIXME
(
"path gradient preset blend not implemented
\n
"
);
}
stat
=
GdipClonePath
(
fill
->
path
,
&
flat_path
);
if
(
stat
!=
Ok
)
...
...
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