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
39f6f491
Commit
39f6f491
authored
Aug 26, 2009
by
Andrew Eikum
Committed by
Alexandre Julliard
Aug 27, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Add utility function get_visible_clip_region.
parent
650a0f3f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
9 deletions
+28
-9
graphics.c
dlls/gdiplus/graphics.c
+28
-9
No files found.
dlls/gdiplus/graphics.c
View file @
39f6f491
...
@@ -1062,6 +1062,33 @@ static GpStatus get_graphics_bounds(GpGraphics* graphics, GpRectF* rect)
...
@@ -1062,6 +1062,33 @@ static GpStatus get_graphics_bounds(GpGraphics* graphics, GpRectF* rect)
return
Ok
;
return
Ok
;
}
}
/* on success, rgn will contain the region of the graphics object which
* is visible after clipping has been applied */
static
GpStatus
get_visible_clip_region
(
GpGraphics
*
graphics
,
GpRegion
*
rgn
)
{
GpStatus
stat
;
GpRectF
rectf
;
GpRegion
*
tmp
;
if
((
stat
=
get_graphics_bounds
(
graphics
,
&
rectf
))
!=
Ok
)
return
stat
;
if
((
stat
=
GdipCreateRegion
(
&
tmp
))
!=
Ok
)
return
stat
;
if
((
stat
=
GdipCombineRegionRect
(
tmp
,
&
rectf
,
CombineModeReplace
))
!=
Ok
)
goto
end
;
if
((
stat
=
GdipCombineRegionRegion
(
tmp
,
graphics
->
clip
,
CombineModeIntersect
))
!=
Ok
)
goto
end
;
stat
=
GdipCombineRegionRegion
(
rgn
,
tmp
,
CombineModeReplace
);
end
:
GdipDeleteRegion
(
tmp
);
return
stat
;
}
GpStatus
WINGDIPAPI
GdipCreateFromHDC
(
HDC
hdc
,
GpGraphics
**
graphics
)
GpStatus
WINGDIPAPI
GdipCreateFromHDC
(
HDC
hdc
,
GpGraphics
**
graphics
)
{
{
TRACE
(
"(%p, %p)
\n
"
,
hdc
,
graphics
);
TRACE
(
"(%p, %p)
\n
"
,
hdc
,
graphics
);
...
@@ -3123,7 +3150,6 @@ GpStatus WINGDIPAPI GdipGetVisibleClipBounds(GpGraphics *graphics, GpRectF *rect
...
@@ -3123,7 +3150,6 @@ GpStatus WINGDIPAPI GdipGetVisibleClipBounds(GpGraphics *graphics, GpRectF *rect
{
{
GpRegion
*
clip_rgn
;
GpRegion
*
clip_rgn
;
GpStatus
stat
;
GpStatus
stat
;
GpRectF
wnd_rect
;
TRACE
(
"(%p, %p)
\n
"
,
graphics
,
rect
);
TRACE
(
"(%p, %p)
\n
"
,
graphics
,
rect
);
...
@@ -3133,18 +3159,11 @@ GpStatus WINGDIPAPI GdipGetVisibleClipBounds(GpGraphics *graphics, GpRectF *rect
...
@@ -3133,18 +3159,11 @@ GpStatus WINGDIPAPI GdipGetVisibleClipBounds(GpGraphics *graphics, GpRectF *rect
if
(
graphics
->
busy
)
if
(
graphics
->
busy
)
return
ObjectBusy
;
return
ObjectBusy
;
/* get window bounds */
if
((
stat
=
get_graphics_bounds
(
graphics
,
&
wnd_rect
))
!=
Ok
)
return
stat
;
/* intersect window and graphics clipping regions */
/* intersect window and graphics clipping regions */
if
((
stat
=
GdipCreateRegion
(
&
clip_rgn
))
!=
Ok
)
if
((
stat
=
GdipCreateRegion
(
&
clip_rgn
))
!=
Ok
)
return
stat
;
return
stat
;
if
((
stat
=
GdipCombineRegionRect
(
clip_rgn
,
&
wnd_rect
,
CombineModeIntersect
))
!=
Ok
)
if
((
stat
=
get_visible_clip_region
(
graphics
,
clip_rgn
))
!=
Ok
)
goto
cleanup
;
if
((
stat
=
GdipCombineRegionRegion
(
clip_rgn
,
graphics
->
clip
,
CombineModeIntersect
))
!=
Ok
)
goto
cleanup
;
goto
cleanup
;
/* get bounds of the region */
/* get bounds of the region */
...
...
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