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
b05cf906
Commit
b05cf906
authored
Apr 28, 2009
by
Vincent Povirk
Committed by
Alexandre Julliard
Apr 29, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Add blend information to linear gradient brushes.
parent
1de79229
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
5 deletions
+52
-5
brush.c
dlls/gdiplus/brush.c
+49
-5
gdiplus_private.h
dlls/gdiplus/gdiplus_private.h
+3
-0
No files found.
dlls/gdiplus/brush.c
View file @
b05cf906
...
@@ -108,14 +108,38 @@ GpStatus WINGDIPAPI GdipCloneBrush(GpBrush *brush, GpBrush **clone)
...
@@ -108,14 +108,38 @@ GpStatus WINGDIPAPI GdipCloneBrush(GpBrush *brush, GpBrush **clone)
break
;
break
;
}
}
case
BrushTypeLinearGradient
:
case
BrushTypeLinearGradient
:{
*
clone
=
GdipAlloc
(
sizeof
(
GpLineGradient
));
GpLineGradient
*
dest
,
*
src
;
if
(
!*
clone
)
return
OutOfMemory
;
INT
count
;
dest
=
GdipAlloc
(
sizeof
(
GpLineGradient
));
if
(
!
dest
)
return
OutOfMemory
;
src
=
(
GpLineGradient
*
)
brush
;
memcpy
(
dest
,
src
,
sizeof
(
GpLineGradient
));
dest
->
brush
.
gdibrush
=
CreateSolidBrush
(
dest
->
brush
.
lb
.
lbColor
);
count
=
dest
->
blendcount
;
dest
->
blendfac
=
GdipAlloc
(
count
*
sizeof
(
REAL
));
dest
->
blendpos
=
GdipAlloc
(
count
*
sizeof
(
REAL
));
if
(
!
dest
->
blendfac
||
!
dest
->
blendpos
)
{
GdipFree
(
dest
->
blendfac
);
GdipFree
(
dest
->
blendpos
);
DeleteObject
(
dest
->
brush
.
gdibrush
);
GdipFree
(
dest
);
return
OutOfMemory
;
}
memcpy
(
*
clone
,
brush
,
sizeof
(
GpLineGradient
));
memcpy
(
dest
->
blendfac
,
src
->
blendfac
,
count
*
sizeof
(
REAL
));
memcpy
(
dest
->
blendpos
,
src
->
blendpos
,
count
*
sizeof
(
REAL
));
(
*
clone
)
->
gdibrush
=
CreateSolidBrush
((
*
clone
)
->
lb
.
lbColor
)
;
*
clone
=
&
dest
->
brush
;
break
;
break
;
}
case
BrushTypeTextureFill
:
case
BrushTypeTextureFill
:
*
clone
=
GdipAlloc
(
sizeof
(
GpTexture
));
*
clone
=
GdipAlloc
(
sizeof
(
GpTexture
));
if
(
!*
clone
)
return
OutOfMemory
;
if
(
!*
clone
)
return
OutOfMemory
;
...
@@ -226,6 +250,23 @@ GpStatus WINGDIPAPI GdipCreateLineBrush(GDIPCONST GpPointF* startpoint,
...
@@ -226,6 +250,23 @@ GpStatus WINGDIPAPI GdipCreateLineBrush(GDIPCONST GpPointF* startpoint,
(
*
line
)
->
wrap
=
wrap
;
(
*
line
)
->
wrap
=
wrap
;
(
*
line
)
->
gamma
=
FALSE
;
(
*
line
)
->
gamma
=
FALSE
;
(
*
line
)
->
blendcount
=
1
;
(
*
line
)
->
blendfac
=
GdipAlloc
(
sizeof
(
REAL
));
(
*
line
)
->
blendpos
=
GdipAlloc
(
sizeof
(
REAL
));
if
(
!
(
*
line
)
->
blendfac
||
!
(
*
line
)
->
blendpos
)
{
GdipFree
((
*
line
)
->
blendfac
);
GdipFree
((
*
line
)
->
blendpos
);
DeleteObject
((
*
line
)
->
brush
.
gdibrush
);
GdipFree
(
*
line
);
*
line
=
NULL
;
return
OutOfMemory
;
}
(
*
line
)
->
blendfac
[
0
]
=
1
.
0
f
;
(
*
line
)
->
blendpos
[
0
]
=
1
.
0
f
;
return
Ok
;
return
Ok
;
}
}
...
@@ -765,7 +806,10 @@ GpStatus WINGDIPAPI GdipDeleteBrush(GpBrush *brush)
...
@@ -765,7 +806,10 @@ GpStatus WINGDIPAPI GdipDeleteBrush(GpBrush *brush)
GdipFree
(((
GpPathGradient
*
)
brush
)
->
blendpos
);
GdipFree
(((
GpPathGradient
*
)
brush
)
->
blendpos
);
break
;
break
;
case
BrushTypeSolidColor
:
case
BrushTypeSolidColor
:
break
;
case
BrushTypeLinearGradient
:
case
BrushTypeLinearGradient
:
GdipFree
(((
GpLineGradient
*
)
brush
)
->
blendfac
);
GdipFree
(((
GpLineGradient
*
)
brush
)
->
blendpos
);
break
;
break
;
case
BrushTypeTextureFill
:
case
BrushTypeTextureFill
:
GdipDeleteMatrix
(((
GpTexture
*
)
brush
)
->
transform
);
GdipDeleteMatrix
(((
GpTexture
*
)
brush
)
->
transform
);
...
...
dlls/gdiplus/gdiplus_private.h
View file @
b05cf906
...
@@ -145,6 +145,9 @@ struct GpLineGradient{
...
@@ -145,6 +145,9 @@ struct GpLineGradient{
ARGB
endcolor
;
ARGB
endcolor
;
GpWrapMode
wrap
;
GpWrapMode
wrap
;
BOOL
gamma
;
BOOL
gamma
;
REAL
*
blendfac
;
/* blend factors */
REAL
*
blendpos
;
/* blend positions */
INT
blendcount
;
};
};
struct
GpTexture
{
struct
GpTexture
{
...
...
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