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
3558dea0
Commit
3558dea0
authored
Oct 04, 2017
by
Vincent Povirk
Committed by
Alexandre Julliard
Oct 04, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Store the gdi32 clip region at Graphics creation time.
Signed-off-by:
Vincent Povirk
<
vincent@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
31e4dede
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
22 deletions
+38
-22
gdiplus_private.h
dlls/gdiplus/gdiplus_private.h
+1
-0
graphics.c
dlls/gdiplus/graphics.c
+37
-22
No files found.
dlls/gdiplus/gdiplus_private.h
View file @
3558dea0
...
...
@@ -262,6 +262,7 @@ struct GpGraphics{
INT
origin_x
,
origin_y
;
INT
gdi_transform_acquire_count
,
gdi_transform_save
;
GpMatrix
gdi_transform
;
HRGN
gdi_clip
;
/* For giving the caller an HDC when we technically can't: */
HBITMAP
temp_hbitmap
;
int
temp_hbitmap_width
;
...
...
dlls/gdiplus/graphics.c
View file @
3558dea0
...
...
@@ -348,6 +348,17 @@ static GpStatus get_clip_hrgn(GpGraphics *graphics, HRGN *hrgn)
GdipDeleteRegion
(
rgn
);
}
if
(
stat
==
Ok
&&
graphics
->
gdi_clip
)
{
if
(
*
hrgn
)
CombineRgn
(
*
hrgn
,
*
hrgn
,
graphics
->
gdi_clip
,
RGN_AND
);
else
{
*
hrgn
=
CreateRectRgn
(
0
,
0
,
0
,
0
);
CombineRgn
(
*
hrgn
,
graphics
->
gdi_clip
,
graphics
->
gdi_clip
,
RGN_COPY
);
}
}
return
stat
;
}
...
...
@@ -498,8 +509,7 @@ static GpStatus alpha_blend_pixels_hrgn(GpGraphics *graphics, INT dst_x, INT dst
save
=
SaveDC
(
graphics
->
hdc
);
if
(
hrgn
)
ExtSelectClipRgn
(
graphics
->
hdc
,
hrgn
,
RGN_AND
);
ExtSelectClipRgn
(
graphics
->
hdc
,
hrgn
,
RGN_COPY
);
if
(
hregion
)
ExtSelectClipRgn
(
graphics
->
hdc
,
hregion
,
RGN_AND
);
...
...
@@ -2315,6 +2325,13 @@ GpStatus WINGDIPAPI GdipCreateFromHDC2(HDC hdc, HANDLE hDevice, GpGraphics **gra
(
*
graphics
)
->
contid
=
0
;
get_gdi_transform
(
*
graphics
,
&
(
*
graphics
)
->
gdi_transform
);
(
*
graphics
)
->
gdi_clip
=
CreateRectRgn
(
0
,
0
,
0
,
0
);
if
(
!
GetClipRgn
(
hdc
,
(
*
graphics
)
->
gdi_clip
))
{
DeleteObject
((
*
graphics
)
->
gdi_clip
);
(
*
graphics
)
->
gdi_clip
=
NULL
;
}
TRACE
(
"<-- %p
\n
"
,
*
graphics
);
return
Ok
;
...
...
@@ -2439,6 +2456,8 @@ GpStatus WINGDIPAPI GdipDeleteGraphics(GpGraphics *graphics)
GdipDeleteRegion
(
graphics
->
clip
);
DeleteObject
(
graphics
->
gdi_clip
);
/* Native returns ObjectBusy on the second free, instead of crashing as we'd
* do otherwise, but we can't have that in the test suite because it means
* accessing freed memory. */
...
...
@@ -3223,9 +3242,9 @@ GpStatus WINGDIPAPI GdipDrawImagePointsRect(GpGraphics *graphics, GpImage *image
stat
=
get_clip_hrgn
(
graphics
,
&
hrgn
);
if
(
stat
==
Ok
&&
hrgn
)
if
(
stat
==
Ok
)
{
ExtSelectClipRgn
(
graphics
->
hdc
,
hrgn
,
RGN_
AND
);
ExtSelectClipRgn
(
graphics
->
hdc
,
hrgn
,
RGN_
COPY
);
DeleteObject
(
hrgn
);
}
...
...
@@ -3466,8 +3485,7 @@ static GpStatus GDI32_GdipDrawPath(GpGraphics *graphics, GpPen *pen, GpPath *pat
if
(
retval
!=
Ok
)
goto
end
;
if
(
hrgn
)
ExtSelectClipRgn
(
graphics
->
hdc
,
hrgn
,
RGN_AND
);
ExtSelectClipRgn
(
graphics
->
hdc
,
hrgn
,
RGN_COPY
);
gdi_transform_acquire
(
graphics
);
...
...
@@ -4155,8 +4173,7 @@ static GpStatus GDI32_GdipFillPath(GpGraphics *graphics, GpBrush *brush, GpPath
if
(
retval
!=
Ok
)
goto
end
;
if
(
hrgn
)
ExtSelectClipRgn
(
graphics
->
hdc
,
hrgn
,
RGN_AND
);
ExtSelectClipRgn
(
graphics
->
hdc
,
hrgn
,
RGN_COPY
);
gdi_transform_acquire
(
graphics
);
...
...
@@ -4443,32 +4460,30 @@ static GpStatus GDI32_GdipFillRegion(GpGraphics* graphics, GpBrush* brush,
if
(
!
graphics
->
hdc
||
!
brush_can_fill_path
(
brush
,
TRUE
))
return
NotImplemented
;
status
=
GdipGetRegionHRgn
(
region
,
graphics
,
&
hrgn
);
if
(
status
!=
Ok
)
return
status
;
save_state
=
SaveDC
(
graphics
->
hdc
);
EndPath
(
graphics
->
hdc
);
ExtSelectClipRgn
(
graphics
->
hdc
,
hrgn
,
RGN_AND
);
DeleteObject
(
hrgn
);
hrgn
=
NULL
;
status
=
get_clip_hrgn
(
graphics
,
&
hrgn
);
if
(
status
!=
Ok
)
{
RestoreDC
(
graphics
->
hdc
,
save_state
);
return
status
;
}
if
(
hrgn
)
ExtSelectClipRgn
(
graphics
->
hdc
,
hrgn
,
RGN_COPY
);
DeleteObject
(
hrgn
);
status
=
GdipGetRegionHRgn
(
region
,
graphics
,
&
hrgn
);
if
(
status
!=
Ok
)
{
ExtSelectClipRgn
(
graphics
->
hdc
,
hrgn
,
RGN_AND
);
DeleteObject
(
hrgn
)
;
RestoreDC
(
graphics
->
hdc
,
save_state
);
return
status
;
}
ExtSelectClipRgn
(
graphics
->
hdc
,
hrgn
,
RGN_AND
);
DeleteObject
(
hrgn
);
if
(
GetClipBox
(
graphics
->
hdc
,
&
rc
)
!=
NULLREGION
)
{
BeginPath
(
graphics
->
hdc
);
...
...
@@ -7001,9 +7016,9 @@ static GpStatus GDI32_GdipDrawDriverString(GpGraphics *graphics, GDIPCONST UINT1
status
=
get_clip_hrgn
(
graphics
,
&
hrgn
);
if
(
status
==
Ok
&&
hrgn
)
if
(
status
==
Ok
)
{
ExtSelectClipRgn
(
graphics
->
hdc
,
hrgn
,
RGN_
AND
);
ExtSelectClipRgn
(
graphics
->
hdc
,
hrgn
,
RGN_
COPY
);
DeleteObject
(
hrgn
);
}
...
...
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