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
Lorenzo Ferrillo
wine
Commits
60cd4773
Commit
60cd4773
authored
14 years ago
by
Esme Povirk
Committed by
Alexandre Julliard
14 years ago
Browse files
Options
Downloads
Patches
Plain Diff
gdiplus: Add a software implementation of GdipFillRegion.
parent
6acffba5
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dlls/gdiplus/graphics.c
+149
-3
149 additions, 3 deletions
dlls/gdiplus/graphics.c
with
149 additions
and
3 deletions
dlls/gdiplus/graphics.c
+
149
−
3
View file @
60cd4773
...
...
@@ -487,6 +487,36 @@ static void brush_fill_path(GpGraphics *graphics, GpBrush* brush)
}
}
static
INT
brush_can_fill_pixels
(
GpBrush
*
brush
)
{
switch
(
brush
->
bt
)
{
case
BrushTypeSolidColor
:
return
1
;
default:
return
0
;
}
}
static
GpStatus
brush_fill_pixels
(
GpGraphics
*
graphics
,
GpBrush
*
brush
,
DWORD
*
argb_pixels
,
GpRect
*
fill_area
,
UINT
cdwStride
)
{
switch
(
brush
->
bt
)
{
case
BrushTypeSolidColor
:
{
int
x
,
y
;
GpSolidFill
*
fill
=
(
GpSolidFill
*
)
brush
;
for
(
x
=
0
;
x
<
fill_area
->
Width
;
x
++
)
for
(
y
=
0
;
y
<
fill_area
->
Height
;
y
++
)
argb_pixels
[
x
+
y
*
cdwStride
]
=
fill
->
color
;
return
Ok
;
}
default:
return
NotImplemented
;
}
}
/* GdipDrawPie/GdipFillPie helper function */
static
void
draw_pie
(
GpGraphics
*
graphics
,
REAL
x
,
REAL
y
,
REAL
width
,
REAL
height
,
REAL
startAngle
,
REAL
sweepAngle
)
...
...
@@ -3321,13 +3351,122 @@ static GpStatus GDI32_GdipFillRegion(GpGraphics* graphics, GpBrush* brush,
return
Ok
;
}
static
GpStatus
SOFTWARE_GdipFillRegion
(
GpGraphics
*
graphics
,
GpBrush
*
brush
,
GpRegion
*
region
)
{
GpStatus
stat
;
GpRegion
*
temp_region
;
GpMatrix
*
world_to_device
,
*
identity
;
GpRectF
graphics_bounds
;
UINT
scans_count
,
i
;
INT
dummy
;
GpRect
*
scans
;
DWORD
*
pixel_data
;
if
(
!
brush_can_fill_pixels
(
brush
))
return
NotImplemented
;
stat
=
get_graphics_bounds
(
graphics
,
&
graphics_bounds
);
if
(
stat
==
Ok
)
stat
=
GdipCloneRegion
(
region
,
&
temp_region
);
if
(
stat
==
Ok
)
{
stat
=
get_graphics_transform
(
graphics
,
CoordinateSpaceDevice
,
CoordinateSpaceWorld
,
&
world_to_device
);
if
(
stat
==
Ok
)
{
stat
=
GdipTransformRegion
(
temp_region
,
world_to_device
);
GdipDeleteMatrix
(
world_to_device
);
}
if
(
stat
==
Ok
)
stat
=
GdipCombineRegionRect
(
temp_region
,
&
graphics_bounds
,
CombineModeIntersect
);
if
(
stat
==
Ok
)
stat
=
GdipCreateMatrix
(
&
identity
);
if
(
stat
==
Ok
)
{
stat
=
GdipGetRegionScansCount
(
temp_region
,
&
scans_count
,
identity
);
if
(
stat
==
Ok
&&
scans_count
!=
0
)
{
scans
=
GdipAlloc
(
sizeof
(
*
scans
)
*
scans_count
);
if
(
!
scans
)
stat
=
OutOfMemory
;
if
(
stat
==
Ok
)
{
stat
=
GdipGetRegionScansI
(
temp_region
,
scans
,
&
dummy
,
identity
);
if
(
stat
!=
Ok
)
GdipFree
(
scans
);
}
}
GdipDeleteMatrix
(
identity
);
}
GdipDeleteRegion
(
temp_region
);
}
if
(
stat
==
Ok
&&
scans_count
==
0
)
return
Ok
;
if
(
stat
==
Ok
)
{
UINT
max_size
=
0
;
for
(
i
=
0
;
i
<
scans_count
;
i
++
)
{
UINT
size
=
scans
[
i
].
Width
*
scans
[
i
].
Height
;
if
(
size
>
max_size
)
max_size
=
size
;
}
pixel_data
=
GdipAlloc
(
sizeof
(
*
pixel_data
)
*
max_size
);
if
(
!
pixel_data
)
stat
=
OutOfMemory
;
if
(
stat
==
Ok
)
{
for
(
i
=
0
;
i
<
scans_count
;
i
++
)
{
stat
=
brush_fill_pixels
(
graphics
,
brush
,
pixel_data
,
&
scans
[
i
],
scans
[
i
].
Width
);
if
(
stat
==
Ok
)
{
stat
=
alpha_blend_pixels
(
graphics
,
scans
[
i
].
X
,
scans
[
i
].
Y
,
(
BYTE
*
)
pixel_data
,
scans
[
i
].
Width
,
scans
[
i
].
Height
,
scans
[
i
].
Width
*
4
);
}
if
(
stat
!=
Ok
)
break
;
}
GdipFree
(
pixel_data
);
}
GdipFree
(
scans
);
}
return
stat
;
}
/*****************************************************************************
* GdipFillRegion [GDIPLUS.@]
*/
GpStatus
WINGDIPAPI
GdipFillRegion
(
GpGraphics
*
graphics
,
GpBrush
*
brush
,
GpRegion
*
region
)
{
GpStatus
stat
;
GpStatus
stat
=
NotImplemented
;
TRACE
(
"(%p, %p, %p)
\n
"
,
graphics
,
brush
,
region
);
...
...
@@ -3337,11 +3476,18 @@ GpStatus WINGDIPAPI GdipFillRegion(GpGraphics* graphics, GpBrush* brush,
if
(
graphics
->
busy
)
return
ObjectBusy
;
stat
=
GDI32_GdipFillRegion
(
graphics
,
brush
,
region
);
if
(
!
graphics
->
image
)
stat
=
GDI32_GdipFillRegion
(
graphics
,
brush
,
region
);
if
(
stat
==
NotImplemented
)
stat
=
SOFTWARE_GdipFillRegion
(
graphics
,
brush
,
region
);
if
(
stat
==
NotImplemented
&&
graphics
->
image
)
stat
=
GDI32_GdipFillRegion
(
graphics
,
brush
,
region
);
if
(
stat
==
NotImplemented
)
{
FIXME
(
"
partially
implemented
\n
"
);
FIXME
(
"
not
implemented
for brushtype %i
\n
"
,
brush
->
bt
);
stat
=
Ok
;
}
...
...
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