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
72607b38
Commit
72607b38
authored
Jul 21, 2011
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11: Add helper functions for changing and restoring the current clipping region.
parent
0d9dde79
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
51 additions
and
34 deletions
+51
-34
graphics.c
dlls/winex11.drv/graphics.c
+43
-8
text.c
dlls/winex11.drv/text.c
+3
-13
x11drv.h
dlls/winex11.drv/x11drv.h
+2
-0
xrender.c
dlls/winex11.drv/xrender.c
+3
-13
No files found.
dlls/winex11.drv/graphics.c
View file @
72607b38
...
...
@@ -185,27 +185,62 @@ RGNDATA *X11DRV_GetRegionData( HRGN hrgn, HDC hdc_lptodp )
}
/***********************************************************************
* X11DRV_SetDeviceClipping
*/
void
X11DRV_SetDeviceClipping
(
PHYSDEV
dev
,
HRGN
vis_rgn
,
HRGN
clip_rgn
)
static
void
update_x11_clipping
(
X11DRV_PDEVICE
*
physDev
)
{
X11DRV_PDEVICE
*
physDev
=
get_x11drv_dev
(
dev
);
RGNDATA
*
data
;
CombineRgn
(
physDev
->
region
,
vis_rgn
,
clip_rgn
,
clip_rgn
?
RGN_AND
:
RGN_COPY
);
if
(
!
(
data
=
X11DRV_GetRegionData
(
physDev
->
region
,
0
)))
return
;
wine_tsx11_lock
();
XSetClipRectangles
(
gdi_display
,
physDev
->
gc
,
physDev
->
dc_rect
.
left
,
physDev
->
dc_rect
.
top
,
(
XRectangle
*
)
data
->
Buffer
,
data
->
rdh
.
nCount
,
YXBanded
);
wine_tsx11_unlock
();
if
(
physDev
->
xrender
)
X11DRV_XRender_SetDeviceClipping
(
physDev
,
data
);
HeapFree
(
GetProcessHeap
(),
0
,
data
);
}
/***********************************************************************
* add_extra_clipping_region
*
* Temporarily add a region to the current clipping region.
* The returned region must be restored with restore_clipping_region.
*/
HRGN
add_extra_clipping_region
(
X11DRV_PDEVICE
*
dev
,
HRGN
rgn
)
{
HRGN
ret
,
clip
;
if
(
!
(
clip
=
CreateRectRgn
(
0
,
0
,
0
,
0
)))
return
0
;
CombineRgn
(
clip
,
dev
->
region
,
rgn
,
RGN_AND
);
ret
=
dev
->
region
;
dev
->
region
=
clip
;
update_x11_clipping
(
dev
);
return
ret
;
}
/***********************************************************************
* restore_clipping_region
*/
void
restore_clipping_region
(
X11DRV_PDEVICE
*
dev
,
HRGN
rgn
)
{
if
(
!
rgn
)
return
;
DeleteObject
(
dev
->
region
);
dev
->
region
=
rgn
;
update_x11_clipping
(
dev
);
}
/***********************************************************************
* X11DRV_SetDeviceClipping
*/
void
X11DRV_SetDeviceClipping
(
PHYSDEV
dev
,
HRGN
vis_rgn
,
HRGN
clip_rgn
)
{
X11DRV_PDEVICE
*
physDev
=
get_x11drv_dev
(
dev
);
CombineRgn
(
physDev
->
region
,
vis_rgn
,
clip_rgn
,
clip_rgn
?
RGN_AND
:
RGN_COPY
);
update_x11_clipping
(
physDev
);
}
/***********************************************************************
* X11DRV_SetupGCForPatBlt
...
...
dlls/winex11.drv/text.c
View file @
72607b38
...
...
@@ -85,13 +85,8 @@ BOOL X11DRV_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags,
if
(
flags
&
ETO_CLIPPED
)
{
HRGN
clip_region
;
clip_region
=
CreateRectRgnIndirect
(
lprect
);
/* make a copy of the current device region */
saved_region
=
CreateRectRgn
(
0
,
0
,
0
,
0
);
CombineRgn
(
saved_region
,
physDev
->
region
,
0
,
RGN_COPY
);
X11DRV_SetDeviceClipping
(
dev
,
saved_region
,
clip_region
);
HRGN
clip_region
=
CreateRectRgnIndirect
(
lprect
);
saved_region
=
add_extra_clipping_region
(
physDev
,
clip_region
);
DeleteObject
(
clip_region
);
}
...
...
@@ -177,12 +172,7 @@ BOOL X11DRV_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags,
}
HeapFree
(
GetProcessHeap
(),
0
,
str2b
);
if
(
flags
&
ETO_CLIPPED
)
{
/* restore the device region */
X11DRV_SetDeviceClipping
(
dev
,
saved_region
,
0
);
DeleteObject
(
saved_region
);
}
if
(
saved_region
)
restore_clipping_region
(
physDev
,
saved_region
);
goto
END
;
FAIL:
...
...
dlls/winex11.drv/x11drv.h
View file @
72607b38
...
...
@@ -289,6 +289,8 @@ extern X_PHYSBITMAP *X11DRV_init_phys_bitmap( HBITMAP hbitmap ) DECLSPEC_HIDDEN;
extern
Pixmap
X11DRV_get_pixmap
(
HBITMAP
hbitmap
)
DECLSPEC_HIDDEN
;
extern
RGNDATA
*
X11DRV_GetRegionData
(
HRGN
hrgn
,
HDC
hdc_lptodp
)
DECLSPEC_HIDDEN
;
extern
HRGN
add_extra_clipping_region
(
X11DRV_PDEVICE
*
dev
,
HRGN
rgn
)
DECLSPEC_HIDDEN
;
extern
void
restore_clipping_region
(
X11DRV_PDEVICE
*
dev
,
HRGN
rgn
)
DECLSPEC_HIDDEN
;
extern
BOOL
X11DRV_SetupGCForPatBlt
(
X11DRV_PDEVICE
*
physDev
,
GC
gc
,
BOOL
fMapColors
)
DECLSPEC_HIDDEN
;
extern
BOOL
X11DRV_SetupGCForBrush
(
X11DRV_PDEVICE
*
physDev
)
DECLSPEC_HIDDEN
;
...
...
dlls/winex11.drv/xrender.c
View file @
72607b38
...
...
@@ -1866,13 +1866,8 @@ BOOL X11DRV_XRender_ExtTextOut( X11DRV_PDEVICE *physDev, INT x, INT y, UINT flag
if
(
flags
&
ETO_CLIPPED
)
{
HRGN
clip_region
;
clip_region
=
CreateRectRgnIndirect
(
lprect
);
/* make a copy of the current device region */
saved_region
=
CreateRectRgn
(
0
,
0
,
0
,
0
);
CombineRgn
(
saved_region
,
physDev
->
region
,
0
,
RGN_COPY
);
X11DRV_SetDeviceClipping
(
&
physDev
->
dev
,
saved_region
,
clip_region
);
HRGN
clip_region
=
CreateRectRgnIndirect
(
lprect
);
saved_region
=
add_extra_clipping_region
(
physDev
,
clip_region
);
DeleteObject
(
clip_region
);
}
...
...
@@ -2131,12 +2126,7 @@ BOOL X11DRV_XRender_ExtTextOut( X11DRV_PDEVICE *physDev, INT x, INT y, UINT flag
}
LeaveCriticalSection
(
&
xrender_cs
);
if
(
flags
&
ETO_CLIPPED
)
{
/* restore the device region */
X11DRV_SetDeviceClipping
(
&
physDev
->
dev
,
saved_region
,
0
);
DeleteObject
(
saved_region
);
}
if
(
saved_region
)
restore_clipping_region
(
physDev
,
saved_region
);
retv
=
TRUE
;
...
...
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