Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nx-libs
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dimbor
nx-libs
Commits
39ff69c7
Commit
39ff69c7
authored
May 04, 2019
by
Ulrich Sibiller
Committed by
Mike Gabriel
Jun 11, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NXmiexpose.c: use upstream miHandleExposures()
It is (functionally) identical to our code, so why have duplicate code?
parent
a2523273
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
276 deletions
+0
-276
NXmiexpose.c
nx-X11/programs/Xserver/hw/nxagent/NXmiexpose.c
+0
-274
miexpose.c
nx-X11/programs/Xserver/mi/miexpose.c
+0
-2
No files found.
nx-X11/programs/Xserver/hw/nxagent/NXmiexpose.c
View file @
39ff69c7
...
...
@@ -102,280 +102,6 @@ Equipment Corporation.
#include "../../mi/miexpose.c"
/* miHandleExposures
generate a region for exposures for areas that were copied from obscured or
non-existent areas to non-obscured areas of the destination. Paint the
background for the region, if the destination is a window.
NOTE:
this should generally be called, even if graphicsExposures is false,
because this is where bits get recovered from backing store.
NOTE:
added argument 'plane' is used to indicate how exposures from backing
store should be accomplished. If plane is 0 (i.e. no bit plane), CopyArea
should be used, else a CopyPlane of the indicated plane will be used. The
exposing is done by the backing store's GraphicsExpose function, of course.
*/
RegionPtr
miHandleExposures
(
pSrcDrawable
,
pDstDrawable
,
pGC
,
srcx
,
srcy
,
width
,
height
,
dstx
,
dsty
,
plane
)
register
DrawablePtr
pSrcDrawable
;
register
DrawablePtr
pDstDrawable
;
GCPtr
pGC
;
int
srcx
,
srcy
;
int
width
,
height
;
int
dstx
,
dsty
;
unsigned
long
plane
;
{
register
ScreenPtr
pscr
;
RegionPtr
prgnSrcClip
;
/* drawable-relative source clip */
RegionRec
rgnSrcRec
;
RegionPtr
prgnDstClip
;
/* drawable-relative dest clip */
RegionRec
rgnDstRec
;
BoxRec
srcBox
;
/* unclipped source */
RegionRec
rgnExposed
;
/* exposed region, calculated source-
relative, made dst relative to
intersect with visible parts of
dest and send events to client,
and then screen relative to paint
the window background
*/
WindowPtr
pSrcWin
;
BoxRec
expBox
;
Bool
extents
;
/*
* Set the elements reported by the compiler
* as uninitialized.
*/
expBox
.
x1
=
0
;
expBox
.
y1
=
0
;
expBox
.
x2
=
0
;
expBox
.
y2
=
0
;
/* This prevents warning about pscr not being used. */
pGC
->
pScreen
=
pscr
=
pGC
->
pScreen
;
/* avoid work if we can */
if
(
!
pGC
->
graphicsExposures
&&
(
pDstDrawable
->
type
==
DRAWABLE_PIXMAP
)
&&
((
pSrcDrawable
->
type
==
DRAWABLE_PIXMAP
)
||
(((
WindowPtr
)
pSrcDrawable
)
->
backStorage
==
NULL
)))
return
NULL
;
srcBox
.
x1
=
srcx
;
srcBox
.
y1
=
srcy
;
srcBox
.
x2
=
srcx
+
width
;
srcBox
.
y2
=
srcy
+
height
;
if
(
pSrcDrawable
->
type
!=
DRAWABLE_PIXMAP
)
{
BoxRec
TsrcBox
;
TsrcBox
.
x1
=
srcx
+
pSrcDrawable
->
x
;
TsrcBox
.
y1
=
srcy
+
pSrcDrawable
->
y
;
TsrcBox
.
x2
=
TsrcBox
.
x1
+
width
;
TsrcBox
.
y2
=
TsrcBox
.
y1
+
height
;
pSrcWin
=
(
WindowPtr
)
pSrcDrawable
;
if
(
pGC
->
subWindowMode
==
IncludeInferiors
)
{
prgnSrcClip
=
NotClippedByChildren
(
pSrcWin
);
if
((
RegionContainsRect
(
prgnSrcClip
,
&
TsrcBox
))
==
rgnIN
)
{
RegionDestroy
(
prgnSrcClip
);
return
NULL
;
}
}
else
{
if
((
RegionContainsRect
(
&
pSrcWin
->
clipList
,
&
TsrcBox
))
==
rgnIN
)
return
NULL
;
prgnSrcClip
=
&
rgnSrcRec
;
RegionNull
(
prgnSrcClip
);
RegionCopy
(
prgnSrcClip
,
&
pSrcWin
->
clipList
);
}
RegionTranslate
(
prgnSrcClip
,
-
pSrcDrawable
->
x
,
-
pSrcDrawable
->
y
);
}
else
{
BoxRec
box
;
if
((
srcBox
.
x1
>=
0
)
&&
(
srcBox
.
y1
>=
0
)
&&
(
srcBox
.
x2
<=
pSrcDrawable
->
width
)
&&
(
srcBox
.
y2
<=
pSrcDrawable
->
height
))
return
NULL
;
box
.
x1
=
0
;
box
.
y1
=
0
;
box
.
x2
=
pSrcDrawable
->
width
;
box
.
y2
=
pSrcDrawable
->
height
;
prgnSrcClip
=
&
rgnSrcRec
;
RegionInit
(
prgnSrcClip
,
&
box
,
1
);
pSrcWin
=
(
WindowPtr
)
NULL
;
}
if
(
pDstDrawable
==
pSrcDrawable
)
{
prgnDstClip
=
prgnSrcClip
;
}
else
if
(
pDstDrawable
->
type
!=
DRAWABLE_PIXMAP
)
{
if
(
pGC
->
subWindowMode
==
IncludeInferiors
)
{
prgnDstClip
=
NotClippedByChildren
((
WindowPtr
)
pDstDrawable
);
}
else
{
prgnDstClip
=
&
rgnDstRec
;
RegionNull
(
prgnDstClip
);
RegionCopy
(
prgnDstClip
,
&
((
WindowPtr
)
pDstDrawable
)
->
clipList
);
}
RegionTranslate
(
prgnDstClip
,
-
pDstDrawable
->
x
,
-
pDstDrawable
->
y
);
}
else
{
BoxRec
box
;
box
.
x1
=
0
;
box
.
y1
=
0
;
box
.
x2
=
pDstDrawable
->
width
;
box
.
y2
=
pDstDrawable
->
height
;
prgnDstClip
=
&
rgnDstRec
;
RegionInit
(
prgnDstClip
,
&
box
,
1
);
}
/* drawable-relative source region */
RegionInit
(
&
rgnExposed
,
&
srcBox
,
1
);
/* now get the hidden parts of the source box*/
RegionSubtract
(
&
rgnExposed
,
&
rgnExposed
,
prgnSrcClip
);
if
(
pSrcWin
&&
pSrcWin
->
backStorage
)
{
/*
* Copy any areas from the source backing store. Modifies
* rgnExposed.
*/
(
*
pSrcWin
->
drawable
.
pScreen
->
ExposeCopy
)
((
WindowPtr
)
pSrcDrawable
,
pDstDrawable
,
pGC
,
&
rgnExposed
,
srcx
,
srcy
,
dstx
,
dsty
,
plane
);
}
/* move them over the destination */
RegionTranslate
(
&
rgnExposed
,
dstx
-
srcx
,
dsty
-
srcy
);
/* intersect with visible areas of dest */
RegionIntersect
(
&
rgnExposed
,
&
rgnExposed
,
prgnDstClip
);
/*
* If we have LOTS of rectangles, we decide to take the extents
* and force an exposure on that. This should require much less
* work overall, on both client and server. This is cheating, but
* isn't prohibited by the protocol ("spontaneous combustion" :-)
* for windows.
*/
extents
=
pGC
->
graphicsExposures
&&
(
RegionNumRects
(
&
rgnExposed
)
>
RECTLIMIT
)
&&
(
pDstDrawable
->
type
!=
DRAWABLE_PIXMAP
);
#ifdef SHAPE
if
(
pSrcWin
)
{
RegionPtr
region
;
if
(
!
(
region
=
wClipShape
(
pSrcWin
)))
region
=
wBoundingShape
(
pSrcWin
);
/*
* If you try to CopyArea the extents of a shaped window, compacting the
* exposed region will undo all our work!
*/
if
(
extents
&&
pSrcWin
&&
region
&&
(
RegionContainsRect
(
region
,
&
srcBox
)
!=
rgnIN
))
extents
=
FALSE
;
}
#endif
if
(
extents
)
{
WindowPtr
pWin
=
(
WindowPtr
)
pDstDrawable
;
expBox
=
*
RegionExtents
(
&
rgnExposed
);
RegionReset
(
&
rgnExposed
,
&
expBox
);
/* need to clear out new areas of backing store */
if
(
pWin
->
backStorage
)
(
void
)
(
*
pWin
->
drawable
.
pScreen
->
ClearBackingStore
)(
pWin
,
expBox
.
x1
,
expBox
.
y1
,
expBox
.
x2
-
expBox
.
x1
,
expBox
.
y2
-
expBox
.
y1
,
FALSE
);
}
if
((
pDstDrawable
->
type
!=
DRAWABLE_PIXMAP
)
&&
(((
WindowPtr
)
pDstDrawable
)
->
backgroundState
!=
None
))
{
WindowPtr
pWin
=
(
WindowPtr
)
pDstDrawable
;
/* make the exposed area screen-relative */
RegionTranslate
(
&
rgnExposed
,
pDstDrawable
->
x
,
pDstDrawable
->
y
);
if
(
extents
)
{
/* PaintWindowBackground doesn't clip, so we have to */
RegionIntersect
(
&
rgnExposed
,
&
rgnExposed
,
&
pWin
->
clipList
);
}
(
*
pWin
->
drawable
.
pScreen
->
PaintWindowBackground
)(
(
WindowPtr
)
pDstDrawable
,
&
rgnExposed
,
PW_BACKGROUND
);
if
(
extents
)
{
RegionReset
(
&
rgnExposed
,
&
expBox
);
}
else
RegionTranslate
(
&
rgnExposed
,
-
pDstDrawable
->
x
,
-
pDstDrawable
->
y
);
}
if
(
prgnDstClip
==
&
rgnDstRec
)
{
RegionUninit
(
prgnDstClip
);
}
else
if
(
prgnDstClip
!=
prgnSrcClip
)
{
RegionDestroy
(
prgnDstClip
);
}
if
(
prgnSrcClip
==
&
rgnSrcRec
)
{
RegionUninit
(
prgnSrcClip
);
}
else
{
RegionDestroy
(
prgnSrcClip
);
}
if
(
pGC
->
graphicsExposures
)
{
/* don't look */
RegionPtr
exposed
=
RegionCreate
(
NullBox
,
0
);
*
exposed
=
rgnExposed
;
return
exposed
;
}
else
{
RegionUninit
(
&
rgnExposed
);
return
NULL
;
}
}
void
miWindowExposures
(
pWin
,
prgn
,
other_exposed
)
WindowPtr
pWin
;
...
...
nx-X11/programs/Xserver/mi/miexpose.c
View file @
39ff69c7
...
...
@@ -126,7 +126,6 @@ exposing is done by the backing store's GraphicsExpose function, of course.
*/
#ifndef NXAGENT_SERVER
RegionPtr
miHandleExposures
(
pSrcDrawable
,
pDstDrawable
,
pGC
,
srcx
,
srcy
,
width
,
height
,
dstx
,
dsty
,
plane
)
...
...
@@ -373,7 +372,6 @@ miHandleExposures(pSrcDrawable, pDstDrawable,
return
NULL
;
}
}
#endif
/* send GraphicsExpose events, or a NoExpose event, based on 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