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
500544f8
Commit
500544f8
authored
Apr 08, 2016
by
Mike Gabriel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hw/nxagent/NXmitrap.c: Shrink file, drop duplicate code that can identically be…
hw/nxagent/NXmitrap.c: Shrink file, drop duplicate code that can identically be found in render/mitrap.c.
parent
8fab4afb
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
122 deletions
+22
-122
NXmitrap.c
nx-X11/programs/Xserver/hw/nxagent/NXmitrap.c
+1
-117
Render.h
nx-X11/programs/Xserver/hw/nxagent/Render.h
+1
-0
Imakefile
nx-X11/programs/Xserver/render/Imakefile
+18
-5
mitrap.c
nx-X11/programs/Xserver/render/mitrap.c
+2
-0
No files found.
nx-X11/programs/Xserver/hw/nxagent/NXmitrap.c
View file @
500544f8
...
@@ -39,117 +39,9 @@
...
@@ -39,117 +39,9 @@
* PERFORMANCE OF THIS SOFTWARE.
* PERFORMANCE OF THIS SOFTWARE.
*/
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include "scrnintstr.h"
#include "gcstruct.h"
#include "pixmapstr.h"
#include "windowstr.h"
#include "servermd.h"
#include "mi.h"
#include "picturestr.h"
#include "mipict.h"
#ifdef NXAGENT_SERVER
#include "Render.h"
#include "Render.h"
#endif
#include "../../render/mitrap.c"
PicturePtr
miCreateAlphaPicture
(
ScreenPtr
pScreen
,
PicturePtr
pDst
,
PictFormatPtr
pPictFormat
,
CARD16
width
,
CARD16
height
)
{
PixmapPtr
pPixmap
;
PicturePtr
pPicture
;
GCPtr
pGC
;
int
error
;
xRectangle
rect
;
if
(
width
>
32767
||
height
>
32767
)
return
0
;
if
(
!
pPictFormat
)
{
if
(
pDst
->
polyEdge
==
PolyEdgeSharp
)
pPictFormat
=
PictureMatchFormat
(
pScreen
,
1
,
PICT_a1
);
else
pPictFormat
=
PictureMatchFormat
(
pScreen
,
8
,
PICT_a8
);
if
(
!
pPictFormat
)
return
0
;
}
pPixmap
=
(
*
pScreen
->
CreatePixmap
)
(
pScreen
,
width
,
height
,
pPictFormat
->
depth
);
if
(
!
pPixmap
)
return
0
;
pGC
=
GetScratchGC
(
pPixmap
->
drawable
.
depth
,
pScreen
);
if
(
!
pGC
)
{
(
*
pScreen
->
DestroyPixmap
)
(
pPixmap
);
return
0
;
}
ValidateGC
(
&
pPixmap
->
drawable
,
pGC
);
rect
.
x
=
0
;
rect
.
y
=
0
;
rect
.
width
=
width
;
rect
.
height
=
height
;
(
*
pGC
->
ops
->
PolyFillRect
)(
&
pPixmap
->
drawable
,
pGC
,
1
,
&
rect
);
FreeScratchGC
(
pGC
);
pPicture
=
CreatePicture
(
0
,
&
pPixmap
->
drawable
,
pPictFormat
,
0
,
0
,
serverClient
,
&
error
);
(
*
pScreen
->
DestroyPixmap
)
(
pPixmap
);
return
pPicture
;
}
static
xFixed
miLineFixedX
(
xLineFixed
*
l
,
xFixed
y
,
Bool
ceil
)
{
xFixed
dx
=
l
->
p2
.
x
-
l
->
p1
.
x
;
xFixed_32_32
ex
=
(
xFixed_32_32
)
(
y
-
l
->
p1
.
y
)
*
dx
;
xFixed
dy
=
l
->
p2
.
y
-
l
->
p1
.
y
;
if
(
ceil
)
ex
+=
(
dy
-
1
);
return
l
->
p1
.
x
+
(
xFixed
)
(
ex
/
dy
);
}
void
miTrapezoidBounds
(
int
ntrap
,
xTrapezoid
*
traps
,
BoxPtr
box
)
{
box
->
y1
=
MAXSHORT
;
box
->
y2
=
MINSHORT
;
box
->
x1
=
MAXSHORT
;
box
->
x2
=
MINSHORT
;
for
(;
ntrap
;
ntrap
--
,
traps
++
)
{
INT16
x1
,
y1
,
x2
,
y2
;
if
(
!
xTrapezoidValid
(
traps
))
continue
;
y1
=
xFixedToInt
(
traps
->
top
);
if
(
y1
<
box
->
y1
)
box
->
y1
=
y1
;
y2
=
xFixedToInt
(
xFixedCeil
(
traps
->
bottom
));
if
(
y2
>
box
->
y2
)
box
->
y2
=
y2
;
x1
=
xFixedToInt
(
min
(
miLineFixedX
(
&
traps
->
left
,
traps
->
top
,
FALSE
),
miLineFixedX
(
&
traps
->
left
,
traps
->
bottom
,
FALSE
)));
if
(
x1
<
box
->
x1
)
box
->
x1
=
x1
;
x2
=
xFixedToInt
(
xFixedCeil
(
max
(
miLineFixedX
(
&
traps
->
right
,
traps
->
top
,
TRUE
),
miLineFixedX
(
&
traps
->
right
,
traps
->
bottom
,
TRUE
))));
if
(
x2
>
box
->
x2
)
box
->
x2
=
x2
;
}
}
void
void
miTrapezoids
(
CARD8
op
,
miTrapezoids
(
CARD8
op
,
...
@@ -182,8 +74,6 @@ miTrapezoids (CARD8 op,
...
@@ -182,8 +74,6 @@ miTrapezoids (CARD8 op,
xDst
=
traps
[
0
].
left
.
p1
.
x
>>
16
;
xDst
=
traps
[
0
].
left
.
p1
.
x
>>
16
;
yDst
=
traps
[
0
].
left
.
p1
.
y
>>
16
;
yDst
=
traps
[
0
].
left
.
p1
.
y
>>
16
;
#ifdef NXAGENT_SERVER
if
(
nxagentTrapezoidExtents
!=
NullBox
)
if
(
nxagentTrapezoidExtents
!=
NullBox
)
{
{
memcpy
(
&
bounds
,
nxagentTrapezoidExtents
,
sizeof
(
BoxRec
));
memcpy
(
&
bounds
,
nxagentTrapezoidExtents
,
sizeof
(
BoxRec
));
...
@@ -197,12 +87,6 @@ miTrapezoids (CARD8 op,
...
@@ -197,12 +87,6 @@ miTrapezoids (CARD8 op,
memcpy
(
nxagentTrapezoidExtents
,
&
bounds
,
sizeof
(
BoxRec
));
memcpy
(
nxagentTrapezoidExtents
,
&
bounds
,
sizeof
(
BoxRec
));
}
}
#else
miTrapezoidBounds
(
ntrap
,
traps
,
&
bounds
);
#endif
if
(
bounds
.
y1
>=
bounds
.
y2
||
bounds
.
x1
>=
bounds
.
x2
)
if
(
bounds
.
y1
>=
bounds
.
y2
||
bounds
.
x1
>=
bounds
.
x2
)
return
;
return
;
pPicture
=
miCreateAlphaPicture
(
pScreen
,
pDst
,
maskFormat
,
pPicture
=
miCreateAlphaPicture
(
pScreen
,
pDst
,
maskFormat
,
...
...
nx-X11/programs/Xserver/hw/nxagent/Render.h
View file @
500544f8
...
@@ -19,6 +19,7 @@
...
@@ -19,6 +19,7 @@
#define __Render_H__
#define __Render_H__
#include "screenint.h"
#include "screenint.h"
#include "cursor.h"
#include "picture.h"
#include "picture.h"
#include "renderproto.h"
#include "renderproto.h"
...
...
nx-X11/programs/Xserver/render/Imakefile
View file @
500544f8
XCOMM $XFree86: xc/programs/Xserver/render/Imakefile,v 1.10 2002/11/23 02:38:15 keithp Exp $
XCOMM $XFree86: xc/programs/Xserver/render/Imakefile,v 1.10 2002/11/23 02:38:15 keithp Exp $
NULL =
#include <Server.tmpl>
#include <Server.tmpl>
#if (!(defined(NXAgentServer) && NXAgentServer))
NXAGENT_SKIP_SRCS = \
mitrap.c \
$(NULL)
NXAGENT_SKIP_OBJS = \
mitrap.o \
$(NULL)
#endif
SRCS = animcur.c \
SRCS = animcur.c \
filter.c \
filter.c \
glyph.c \
glyph.c \
...
@@ -9,11 +21,12 @@ XCOMM $XFree86: xc/programs/Xserver/render/Imakefile,v 1.10 2002/11/23 02:38:15
...
@@ -9,11 +21,12 @@ XCOMM $XFree86: xc/programs/Xserver/render/Imakefile,v 1.10 2002/11/23 02:38:15
miindex.c \
miindex.c \
mipict.c \
mipict.c \
mirect.c \
mirect.c \
mitrap.c \
mitri.c \
mitri.c \
picture.c \
picture.c \
render.c \
render.c \
renderedge.c
renderedge.c \
$(NXAGENT_SKIP_SRCS) \
$(NULL)
OBJS = animcur.o \
OBJS = animcur.o \
filter.o \
filter.o \
...
@@ -23,11 +36,12 @@ XCOMM $XFree86: xc/programs/Xserver/render/Imakefile,v 1.10 2002/11/23 02:38:15
...
@@ -23,11 +36,12 @@ XCOMM $XFree86: xc/programs/Xserver/render/Imakefile,v 1.10 2002/11/23 02:38:15
miindex.o \
miindex.o \
mipict.o \
mipict.o \
mirect.o \
mirect.o \
mitrap.o \
mitri.o \
mitri.o \
picture.o \
picture.o \
render.o \
render.o \
renderedge.o
renderedge.o \
$(NXAGENT_SKIP_OBJS) \
$(NULL)
INCLUDES = -I. -I../include -I../mi \
INCLUDES = -I. -I../include -I../mi \
-I../fb -I../hw/kdrive -I$(EXTINCSRC) -I$(XINCLUDESRC) \
-I../fb -I../hw/kdrive -I$(EXTINCSRC) -I$(XINCLUDESRC) \
...
@@ -46,4 +60,3 @@ InstallDriverSDKNonExecFile(glyphstr.h,$(DRIVERSDKINCLUDEDIR))
...
@@ -46,4 +60,3 @@ InstallDriverSDKNonExecFile(glyphstr.h,$(DRIVERSDKINCLUDEDIR))
InstallDriverSDKNonExecFile(mipict.h,$(DRIVERSDKINCLUDEDIR))
InstallDriverSDKNonExecFile(mipict.h,$(DRIVERSDKINCLUDEDIR))
InstallDriverSDKNonExecFile(picture.h,$(DRIVERSDKINCLUDEDIR))
InstallDriverSDKNonExecFile(picture.h,$(DRIVERSDKINCLUDEDIR))
InstallDriverSDKNonExecFile(picturestr.h,$(DRIVERSDKINCLUDEDIR))
InstallDriverSDKNonExecFile(picturestr.h,$(DRIVERSDKINCLUDEDIR))
nx-X11/programs/Xserver/render/mitrap.c
View file @
500544f8
...
@@ -128,6 +128,7 @@ miTrapezoidBounds (int ntrap, xTrapezoid *traps, BoxPtr box)
...
@@ -128,6 +128,7 @@ miTrapezoidBounds (int ntrap, xTrapezoid *traps, BoxPtr box)
}
}
}
}
#ifndef NXAGENT_SERVER
void
void
miTrapezoids
(
CARD8
op
,
miTrapezoids
(
CARD8
op
,
PicturePtr
pSrc
,
PicturePtr
pSrc
,
...
@@ -188,3 +189,4 @@ miTrapezoids (CARD8 op,
...
@@ -188,3 +189,4 @@ miTrapezoids (CARD8 op,
miTrapezoids
(
op
,
pSrc
,
pDst
,
maskFormat
,
xSrc
,
ySrc
,
1
,
traps
);
miTrapezoids
(
op
,
pSrc
,
pDst
,
maskFormat
,
xSrc
,
ySrc
,
1
,
traps
);
}
}
}
}
#endif
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