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
b7e664bc
Commit
b7e664bc
authored
Jan 21, 2011
by
Vincent Povirk
Committed by
Alexandre Julliard
Jan 24, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Add a software implementation of hatch brushes.
parent
60cd4773
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
0 deletions
+40
-0
brush.c
dlls/gdiplus/brush.c
+11
-0
gdiplus_private.h
dlls/gdiplus/gdiplus_private.h
+2
-0
graphics.c
dlls/gdiplus/graphics.c
+27
-0
No files found.
dlls/gdiplus/brush.c
View file @
b7e664bc
...
...
@@ -219,6 +219,17 @@ static const char HatchBrushes[][8] = {
{
0x00
,
0x00
,
0xff
,
0xff
,
0x00
,
0x00
,
0xff
,
0xff
},
/* HatchStyleDarkHorizontal */
};
GpStatus
get_hatch_data
(
HatchStyle
hatchstyle
,
const
char
**
result
)
{
if
(
hatchstyle
<
sizeof
(
HatchBrushes
)
/
sizeof
(
HatchBrushes
[
0
]))
{
*
result
=
HatchBrushes
[
hatchstyle
];
return
Ok
;
}
else
return
NotImplemented
;
}
/******************************************************************************
* GdipCreateHatchBrush [GDIPLUS.@]
*/
...
...
dlls/gdiplus/gdiplus_private.h
View file @
b7e664bc
...
...
@@ -65,6 +65,8 @@ extern GpStatus trace_path(GpGraphics *graphics, GpPath *path);
typedef
struct
region_element
region_element
;
extern
void
delete_element
(
region_element
*
element
);
extern
GpStatus
get_hatch_data
(
HatchStyle
hatchstyle
,
const
char
**
result
);
static
inline
INT
roundr
(
REAL
x
)
{
return
(
INT
)
floorf
(
x
+
0
.
5
);
...
...
dlls/gdiplus/graphics.c
View file @
b7e664bc
...
...
@@ -492,6 +492,7 @@ static INT brush_can_fill_pixels(GpBrush *brush)
switch
(
brush
->
bt
)
{
case
BrushTypeSolidColor
:
case
BrushTypeHatchFill
:
return
1
;
default:
return
0
;
...
...
@@ -512,6 +513,32 @@ static GpStatus brush_fill_pixels(GpGraphics *graphics, GpBrush *brush,
argb_pixels
[
x
+
y
*
cdwStride
]
=
fill
->
color
;
return
Ok
;
}
case
BrushTypeHatchFill
:
{
int
x
,
y
;
GpHatch
*
fill
=
(
GpHatch
*
)
brush
;
const
char
*
hatch_data
;
if
(
get_hatch_data
(
fill
->
hatchstyle
,
&
hatch_data
)
!=
Ok
)
return
NotImplemented
;
for
(
x
=
0
;
x
<
fill_area
->
Width
;
x
++
)
for
(
y
=
0
;
y
<
fill_area
->
Height
;
y
++
)
{
int
hx
,
hy
;
/* FIXME: Account for the rendering origin */
hx
=
(
x
+
fill_area
->
X
)
%
8
;
hy
=
(
y
+
fill_area
->
Y
)
%
8
;
if
((
hatch_data
[
7
-
hy
]
&
(
0x80
>>
hx
))
!=
0
)
argb_pixels
[
x
+
y
*
cdwStride
]
=
fill
->
forecol
;
else
argb_pixels
[
x
+
y
*
cdwStride
]
=
fill
->
backcol
;
}
return
Ok
;
}
default:
return
NotImplemented
;
}
...
...
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