home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
World_Of_Computer_Software-02-387-Vol-3of3.iso
/
a
/
amix2410.zip
/
PATCH1
next >
Wrap
Text File
|
1992-08-26
|
48KB
|
1,681 lines
*** 1.1 1992/08/23 17:46:38
--- tigdebug.c 1992/08/14 14:50:16
***************
*** 1,11 ****
--- 1,15 ----
void
Trace(char *arg)
{
+ #ifdef DOTRACE
ErrorF("Trace %s\n", arg);
+ #endif
}
void
Untrace(char *arg)
{
+ #ifdef DOTRACE
ErrorF("Untrace %s\n", arg);
+ #endif
}
*** 1.1 1992/08/23 17:46:38
--- tiggc.c 1992/08/22 16:02:11
***************
*** 1,6 ****
--- 1,10 ----
/*
* TIGA GC control and manipulation
*
+ * 10 Aug 92 Rick Schaeffer (ricks@isc-br.isc-br.com)
+ * Fixed "memory leak" caused by
+ * allocating tbox structures that
+ * were never freed.
* 16 Jan 92 Keith Gabryelski Bug fix in
* tigSetstip() that would cause
* stipples that had positive indexes
***************
*** 544,550 ****
{
GCPRIV *pPriv;
int win_moved;
! BoxRec *tbox;
PixmapPtr pPix=(PixmapPtr)pDraw;
extern void miPolyPoint();
--- 548,554 ----
{
GCPRIV *pPriv;
int win_moved;
! BoxRec tbox;
PixmapPtr pPix=(PixmapPtr)pDraw;
extern void miPolyPoint();
***************
*** 569,580 ****
else if(pGC->clientClipType==CT_NONE)
{
(*pGC->pScreen->RegionDestroy)(pPriv->clip);
! tbox=XNEW(BoxRec);
! tbox->x1=0;
! tbox->y1=0;
! tbox->x2=pDraw->width;
! tbox->y2=pDraw->height;
! pPriv->clip=(*pGC->pScreen->RegionCreate)(tbox, 1);
win_moved=TRUE;
}
}
--- 573,583 ----
else if(pGC->clientClipType==CT_NONE)
{
(*pGC->pScreen->RegionDestroy)(pPriv->clip);
! tbox.x1=0;
! tbox.y1=0;
! tbox.x2=pDraw->width;
! tbox.y2=pDraw->height;
! pPriv->clip=(*pGC->pScreen->RegionCreate)(&tbox, 1);
win_moved=TRUE;
}
}
*** 1.1 1992/08/23 17:46:38
--- tigimag.c 1992/08/22 16:04:58
***************
*** 2,7 ****
--- 2,11 ----
* More X primitives; primarily those dealing with
* blits and images
*
+ * 10 Aug 92 Rick Schaeffer (ricks@isc-br.isc-br.com)
+ * Fixed "memory leak" caused by
+ * allocating tbox structures that
+ * were never freed.
* 22 Jun 90 Erich Rickheit KSC Admitted responsibility
* 5 Jul 90 Erich Rickheit KSC Moved in tigCopyArea
*/
***************
*** 88,94 ****
RegionPtr reg, draw;
GCPRIV * pPriv;
long bm;
! BoxRec * tbox;
WindowPtr pWin;
unsigned char *s;
--- 92,98 ----
RegionPtr reg, draw;
GCPRIV * pPriv;
long bm;
! BoxRec tbox;
WindowPtr pWin;
unsigned char *s;
***************
*** 129,140 ****
*s = swiz[*s];
host2gsp(pImage, bm, (p * h) / 8, 1);
/* figger clip region */
! tbox = XNEW(BoxRec);
! tbox->x1 = xorg + x;
! tbox->y1 = yorg + y;
! tbox->x2 = tbox->x1 + w;
! tbox->y2 = tbox->y1 + h;
! draw = (*pGC->pScreen->RegionCreate)(tbox, 1);
(*pGC->pScreen->Intersect)(draw, draw, reg);
/* blit that mother */
for (r = 0; r < REGION_NUM_RECTS(draw); r++) {
--- 133,143 ----
*s = swiz[*s];
host2gsp(pImage, bm, (p * h) / 8, 1);
/* figger clip region */
! tbox.x1 = xorg + x;
! tbox.y1 = yorg + y;
! tbox.x2 = tbox.x1 + w;
! tbox.y2 = tbox.y1 + h;
! draw = (*pGC->pScreen->RegionCreate)(&tbox, 1);
(*pGC->pScreen->Intersect)(draw, draw, reg);
/* blit that mother */
for (r = 0; r < REGION_NUM_RECTS(draw); r++) {
***************
*** 163,174 ****
}
set_srcbm(bm, p, w, h, 1);
/* figger clip region */
! tbox = XNEW(BoxRec);
! tbox->x1 = xorg + x;
! tbox->y1 = yorg + y;
! tbox->x2 = tbox->x1 + w;
! tbox->y2 = tbox->y1 + h;
! draw = (*pGC->pScreen->RegionCreate)(tbox, 1);
(*pGC->pScreen->Intersect)(draw, draw, reg);
set_fcolor(0); /* clear stuff out */
for (r = 0; r < REGION_NUM_RECTS(draw); r++)
--- 166,176 ----
}
set_srcbm(bm, p, w, h, 1);
/* figger clip region */
! tbox.x1 = xorg + x;
! tbox.y1 = yorg + y;
! tbox.x2 = tbox.x1 + w;
! tbox.y2 = tbox.y1 + h;
! draw = (*pGC->pScreen->RegionCreate)(&tbox, 1);
(*pGC->pScreen->Intersect)(draw, draw, reg);
set_fcolor(0); /* clear stuff out */
for (r = 0; r < REGION_NUM_RECTS(draw); r++)
***************
*** 207,218 ****
*/
p = (w + 3) & ~3;
/* figger clip region */
! tbox = XNEW(BoxRec);
! tbox->x1 = xorg + x;
! tbox->y1 = yorg + y;
! tbox->x2 = tbox->x1 + w;
! tbox->y2 = tbox->y1 + h;
! draw = (*pGC->pScreen->RegionCreate)(tbox, 1);
(*pGC->pScreen->Intersect)(draw, draw, reg);
for (r = 0; r < REGION_NUM_RECTS(draw); r++) {
host2gspxy(pImage, p, scrtop, scrpitch * 8,
--- 209,219 ----
*/
p = (w + 3) & ~3;
/* figger clip region */
! tbox.x1 = xorg + x;
! tbox.y1 = yorg + y;
! tbox.x2 = tbox.x1 + w;
! tbox.y2 = tbox.y1 + h;
! draw = (*pGC->pScreen->RegionCreate)(&tbox, 1);
(*pGC->pScreen->Intersect)(draw, draw, reg);
for (r = 0; r < REGION_NUM_RECTS(draw); r++) {
host2gspxy(pImage, p, scrtop, scrpitch * 8,
***************
*** 254,260 ****
RegionPtr reg, draw;
GCPRIV * pPriv;
long bm;
! BoxRec * tbox;
WindowPtr pWin;
unsigned char *s, *t, *bits;
int fg, bg;
--- 255,261 ----
RegionPtr reg, draw;
GCPRIV * pPriv;
long bm;
! BoxRec tbox;
WindowPtr pWin;
unsigned char *s, *t, *bits;
int fg, bg;
***************
*** 287,298 ****
/* send down bits */
host2gsp(bits, bm, pBitmap->devKind * h, 1);
/* figger rectangle */
! tbox = XNEW(BoxRec);
! tbox->x1 = xs;
! tbox->y1 = ys;
! tbox->x2 = tbox->x1 + w;
! tbox->y2 = tbox->y1 + h;
! draw = (*pGC->pScreen->RegionCreate)(tbox, 1);
(*pGC->pScreen->Intersect)(draw, draw, reg);
i = (~pGC->planemask) & 0xff;
--- 288,298 ----
/* send down bits */
host2gsp(bits, bm, pBitmap->devKind * h, 1);
/* figger rectangle */
! tbox.x1 = xs;
! tbox.y1 = ys;
! tbox.x2 = tbox.x1 + w;
! tbox.y2 = tbox.y1 + h;
! draw = (*pGC->pScreen->RegionCreate)(&tbox, 1);
(*pGC->pScreen->Intersect)(draw, draw, reg);
i = (~pGC->planemask) & 0xff;
***************
*** 336,342 ****
int xSrc, ySrc, width, height, xDst, yDst;
{
RegionPtr blitme, temp;
! BoxRec *tbox;
ScreenPtr pScreen=pGC->pScreen;
int count, i, j, t, w, h, Sx, Sy, Dx, Dy;
int *order, *wid;
--- 336,342 ----
int xSrc, ySrc, width, height, xDst, yDst;
{
RegionPtr blitme, temp;
! BoxRec tbox;
ScreenPtr pScreen=pGC->pScreen;
int count, i, j, t, w, h, Sx, Sy, Dx, Dy;
int *order, *wid;
***************
*** 355,365 ****
if(pSrc->type == DRAWABLE_PIXMAP)
{
! tbox = XNEW(BoxRec);
! tbox->x1 = tbox->y1 = 0;
! tbox->x2 = ((PixmapPtr)pSrc)->drawable.width;
! tbox->y2 = ((PixmapPtr)pSrc)->drawable.height;
! blitme = (*pScreen->RegionCreate)(tbox, 1);
Sx = Sy = 0;
}
else
--- 355,364 ----
if(pSrc->type == DRAWABLE_PIXMAP)
{
! tbox.x1 = tbox.y1 = 0;
! tbox.x2 = ((PixmapPtr)pSrc)->drawable.width;
! tbox.y2 = ((PixmapPtr)pSrc)->drawable.height;
! blitme = (*pScreen->RegionCreate)(&tbox, 1);
Sx = Sy = 0;
}
else
***************
*** 377,398 ****
(*pScreen->TranslateRegion)(blitme, -Sx, -Sy);
}
/* intersect with source rectangle */
! tbox = XNEW(BoxRec);
! tbox->x1 = xSrc;
! tbox->y1 = ySrc;
! tbox->x2 = tbox->x1 + width;
! tbox->y2 = tbox->y1 + height;
! temp = (*pScreen->RegionCreate)(tbox, 1);
(*pScreen->Intersect)(blitme, blitme, temp);
(*pGC->pScreen->RegionDestroy)(temp);
/* intersect with dest clip */
if(pDst->type == DRAWABLE_PIXMAP)
{
! tbox = XNEW(BoxRec);
! tbox->x1 = tbox->y1 = 0;
! tbox->x2 = ((PixmapPtr)pDst)->drawable.width;
! tbox->y2 = ((PixmapPtr)pDst)->drawable.height;
! temp = (*pScreen->RegionCreate)(tbox, 1);
(*pScreen->TranslateRegion)(temp, -xDst + xSrc, -yDst + ySrc);
Dx = Dy = 0;
}
--- 376,395 ----
(*pScreen->TranslateRegion)(blitme, -Sx, -Sy);
}
/* intersect with source rectangle */
! tbox.x1 = xSrc;
! tbox.y1 = ySrc;
! tbox.x2 = tbox.x1 + width;
! tbox.y2 = tbox.y1 + height;
! temp = (*pScreen->RegionCreate)(&tbox, 1);
(*pScreen->Intersect)(blitme, blitme, temp);
(*pGC->pScreen->RegionDestroy)(temp);
/* intersect with dest clip */
if(pDst->type == DRAWABLE_PIXMAP)
{
! tbox.x1 = tbox.y1 = 0;
! tbox.x2 = ((PixmapPtr)pDst)->drawable.width;
! tbox.y2 = ((PixmapPtr)pDst)->drawable.height;
! temp = (*pScreen->RegionCreate)(&tbox, 1);
(*pScreen->TranslateRegion)(temp, -xDst + xSrc, -yDst + ySrc);
Dx = Dy = 0;
}
*** 1.1 1992/08/23 17:46:38
--- tigimg.c 1992/08/22 16:04:08
***************
*** 2,7 ****
--- 2,11 ----
* More X primitives; primarily those dealing with
* blits and images
*
+ * 10 Aug 92 Rick Schaeffer (ricks@isc-br.isc-br.com)
+ * Fixed "memory leak" caused by
+ * allocating tbox structures that
+ * were never freed.
* 22 Jun 90 Erich Rickheit KSC Admitted responsibility
* 5 Jul 90 Erich Rickheit KSC Moved in tigCopyArea
*/
***************
*** 88,94 ****
RegionPtr reg, draw;
GCPRIV * pPriv;
long bm;
! BoxRec * tbox;
WindowPtr pWin;
unsigned char *s;
--- 92,98 ----
RegionPtr reg, draw;
GCPRIV * pPriv;
long bm;
! BoxRec tbox;
WindowPtr pWin;
unsigned char *s;
***************
*** 129,140 ****
*s = swiz[*s];
host2gsp(pImage, bm, (p * h) / 8, 1);
/* figger clip region */
! tbox = XNEW(BoxRec);
! tbox->x1 = xorg + x;
! tbox->y1 = yorg + y;
! tbox->x2 = tbox->x1 + w;
! tbox->y2 = tbox->y1 + h;
! draw = (*pGC->pScreen->RegionCreate)(tbox, 1);
(*pGC->pScreen->Intersect)(draw, draw, reg);
/* blit that mother */
for (r = 0; r < REGION_NUM_RECTS(draw); r++) {
--- 133,143 ----
*s = swiz[*s];
host2gsp(pImage, bm, (p * h) / 8, 1);
/* figger clip region */
! tbox.x1 = xorg + x;
! tbox.y1 = yorg + y;
! tbox.x2 = tbox.x1 + w;
! tbox.y2 = tbox.y1 + h;
! draw = (*pGC->pScreen->RegionCreate)(&tbox, 1);
(*pGC->pScreen->Intersect)(draw, draw, reg);
/* blit that mother */
for (r = 0; r < REGION_NUM_RECTS(draw); r++) {
***************
*** 163,174 ****
}
set_srcbm(bm, p, w, h, 1);
/* figger clip region */
! tbox = XNEW(BoxRec);
! tbox->x1 = xorg + x;
! tbox->y1 = yorg + y;
! tbox->x2 = tbox->x1 + w;
! tbox->y2 = tbox->y1 + h;
! draw = (*pGC->pScreen->RegionCreate)(tbox, 1);
(*pGC->pScreen->Intersect)(draw, draw, reg);
set_fcolor(0); /* clear stuff out */
for (r = 0; r < REGION_NUM_RECTS(draw); r++)
--- 166,176 ----
}
set_srcbm(bm, p, w, h, 1);
/* figger clip region */
! tbox.x1 = xorg + x;
! tbox.y1 = yorg + y;
! tbox.x2 = tbox.x1 + w;
! tbox.y2 = tbox.y1 + h;
! draw = (*pGC->pScreen->RegionCreate)(&tbox, 1);
(*pGC->pScreen->Intersect)(draw, draw, reg);
set_fcolor(0); /* clear stuff out */
for (r = 0; r < REGION_NUM_RECTS(draw); r++)
***************
*** 207,218 ****
*/
p = (w + 3) & ~3;
/* figger clip region */
! tbox = XNEW(BoxRec);
! tbox->x1 = xorg + x;
! tbox->y1 = yorg + y;
! tbox->x2 = tbox->x1 + w;
! tbox->y2 = tbox->y1 + h;
! draw = (*pGC->pScreen->RegionCreate)(tbox, 1);
(*pGC->pScreen->Intersect)(draw, draw, reg);
for (r = 0; r < REGION_NUM_RECTS(draw); r++) {
HOST2GSPXY(pImage, p, scrtop, scrpitch * 8,
--- 209,219 ----
*/
p = (w + 3) & ~3;
/* figger clip region */
! tbox.x1 = xorg + x;
! tbox.y1 = yorg + y;
! tbox.x2 = tbox.x1 + w;
! tbox.y2 = tbox.y1 + h;
! draw = (*pGC->pScreen->RegionCreate)(&tbox, 1);
(*pGC->pScreen->Intersect)(draw, draw, reg);
for (r = 0; r < REGION_NUM_RECTS(draw); r++) {
HOST2GSPXY(pImage, p, scrtop, scrpitch * 8,
***************
*** 256,262 ****
RegionPtr reg, draw;
GCPRIV * pPriv;
long bm;
! BoxRec * tbox;
WindowPtr pWin;
unsigned char *s, *t, *bits;
int fg, bg;
--- 257,263 ----
RegionPtr reg, draw;
GCPRIV * pPriv;
long bm;
! BoxRec tbox;
WindowPtr pWin;
unsigned char *s, *t, *bits;
int fg, bg;
***************
*** 288,299 ****
/* send down bits */
host2gsp(bits, bm, pBitmap->devKind * h, 1);
/* figger rectangle */
! tbox = XNEW(BoxRec);
! tbox->x1 = xs;
! tbox->y1 = ys;
! tbox->x2 = tbox->x1 + w;
! tbox->y2 = tbox->y1 + h;
! draw = (*pGC->pScreen->RegionCreate)(tbox, 1);
(*pGC->pScreen->Intersect)(draw, draw, reg);
i = (~pGC->planemask) & 0xff;
--- 289,299 ----
/* send down bits */
host2gsp(bits, bm, pBitmap->devKind * h, 1);
/* figger rectangle */
! tbox.x1 = xs;
! tbox.y1 = ys;
! tbox.x2 = tbox.x1 + w;
! tbox.y2 = tbox.y1 + h;
! draw = (*pGC->pScreen->RegionCreate)(&tbox, 1);
(*pGC->pScreen->Intersect)(draw, draw, reg);
i = (~pGC->planemask) & 0xff;
***************
*** 337,343 ****
int xSrc, ySrc, width, height, xDst, yDst;
{
RegionPtr blitme, temp;
! BoxRec *tbox;
ScreenPtr pScreen=pGC->pScreen;
int count, i, j, t, w, h, Sx, Sy, Dx, Dy;
int *order, *wid;
--- 337,343 ----
int xSrc, ySrc, width, height, xDst, yDst;
{
RegionPtr blitme, temp;
! BoxRec tbox;
ScreenPtr pScreen=pGC->pScreen;
int count, i, j, t, w, h, Sx, Sy, Dx, Dy;
int *order, *wid;
***************
*** 356,366 ****
if(pSrc->type == DRAWABLE_PIXMAP)
{
! tbox = XNEW(BoxRec);
! tbox->x1 = tbox->y1 = 0;
! tbox->x2 = ((PixmapPtr)pSrc)->drawable.width;
! tbox->y2 = ((PixmapPtr)pSrc)->drawable.height;
! blitme = (*pScreen->RegionCreate)(tbox, 1);
Sx = Sy = 0;
}
else
--- 356,365 ----
if(pSrc->type == DRAWABLE_PIXMAP)
{
! tbox.x1 = tbox.y1 = 0;
! tbox.x2 = ((PixmapPtr)pSrc)->drawable.width;
! tbox.y2 = ((PixmapPtr)pSrc)->drawable.height;
! blitme = (*pScreen->RegionCreate)(&tbox, 1);
Sx = Sy = 0;
}
else
***************
*** 378,399 ****
(*pScreen->TranslateRegion)(blitme, -Sx, -Sy);
}
/* intersect with source rectangle */
! tbox = XNEW(BoxRec);
! tbox->x1 = xSrc;
! tbox->y1 = ySrc;
! tbox->x2 = tbox->x1 + width;
! tbox->y2 = tbox->y1 + height;
! temp = (*pScreen->RegionCreate)(tbox, 1);
(*pScreen->Intersect)(blitme, blitme, temp);
(*pGC->pScreen->RegionDestroy)(temp);
/* intersect with dest clip */
if(pDst->type == DRAWABLE_PIXMAP)
{
! tbox = XNEW(BoxRec);
! tbox->x1 = tbox->y1 = 0;
! tbox->x2 = ((PixmapPtr)pDst)->drawable.width;
! tbox->y2 = ((PixmapPtr)pDst)->drawable.height;
! temp = (*pScreen->RegionCreate)(tbox, 1);
(*pScreen->TranslateRegion)(temp, -xDst + xSrc, -yDst + ySrc);
Dx = Dy = 0;
}
--- 377,396 ----
(*pScreen->TranslateRegion)(blitme, -Sx, -Sy);
}
/* intersect with source rectangle */
! tbox.x1 = xSrc;
! tbox.y1 = ySrc;
! tbox.x2 = tbox.x1 + width;
! tbox.y2 = tbox.y1 + height;
! temp = (*pScreen->RegionCreate)(&tbox, 1);
(*pScreen->Intersect)(blitme, blitme, temp);
(*pGC->pScreen->RegionDestroy)(temp);
/* intersect with dest clip */
if(pDst->type == DRAWABLE_PIXMAP)
{
! tbox.x1 = tbox.y1 = 0;
! tbox.x2 = ((PixmapPtr)pDst)->drawable.width;
! tbox.y2 = ((PixmapPtr)pDst)->drawable.height;
! temp = (*pScreen->RegionCreate)(&tbox, 1);
(*pScreen->TranslateRegion)(temp, -xDst + xSrc, -yDst + ySrc);
Dx = Dy = 0;
}
*** 1.1 1992/08/23 17:46:38
--- tigmem.c 1992/08/22 16:08:48
***************
*** 1,6 ****
--- 1,9 ----
/*
* Routines to manage TIGA on-board memory
*
+ * 10 Aug 92 Rick Schaeffer (ricks@isc-br.isc-br.com)
+ * Fixed problem in "tigmemdone" that could
+ * cause server crash if no blocks ever allocated
* 16 Jan 92 Keith Gabryelski Bug fix in tigrequest that
* may cause 0 to be return
* even if memory was allocated.
***************
*** 67,72 ****
--- 70,77 ----
BLOCK * cur = blocks, *t;
unsigned long loc;
+ if (blocks == NULL)
+ return;
loc = blocks->address;
while (cur) {
t = cur->next;
***************
*** 75,80 ****
--- 80,86 ----
Xfree(cur);
cur = t;
}
+ blocks = NULL;
gsp_free(loc);
}
*** 1.1 1992/08/23 17:46:38
--- tigpix.c 1992/08/22 16:22:16
***************
*** 9,14 ****
--- 9,23 ----
* of the data. Note that the pitch is padded out to a word boundary.
* Pixmaps (at this point) can be only 1 or 8 bits deep.
*
+ * 15 Aug 92 Rick Schaeffer (ricks@isc-br.isc-br.com)
+ * Fixed problem in tigpixSolidSp and tigpixStipSp which caused
+ * server crash and/or display anomalies because clipping wasn't
+ * being done. tigpixStipSp re-written using technique from
+ * X11R5 sources by Keith Gabryelski. NOTE: tigpixTileSp probably
+ * still needs work.
+ * 5 Jul 92 Rick Schaeffer (ricks@isc-br.isc-br.com)
+ * Fixed problem in tigDestroyPixmap that caused server crash
+ * if Pixmap already freed.
* 22 Jun 90 Erich Rickheit KSC Admitted responsibility
* 28 Jun 91 Aaron Orenstein (Partially) Recoded for X11R4
*/
***************
*** 100,106 ****
* if(!IS_VALID_PIXMAP(pPix)) return TRUE;
*/
! if(pPixmap)
if(--pPixmap->refcnt==0)
{
if(pPixmap->devPrivate.ptr) Xfree(pPixmap->devPrivate.ptr);
--- 109,115 ----
* if(!IS_VALID_PIXMAP(pPix)) return TRUE;
*/
! if(pPixmap) {
if(--pPixmap->refcnt==0)
{
if(pPixmap->devPrivate.ptr) Xfree(pPixmap->devPrivate.ptr);
***************
*** 108,113 ****
--- 117,123 ----
Xfree(pPixmap);
return TRUE;
}
+ }
UNTRACE("tigDestroyPixmap");
return TRUE;
***************
*** 257,277 ****
UNTRACE("tigpixSolidSp");
}
#else
! void tigpixSolidSp(pPixmap, pGC, npt, ppt, pwidth, fSorted)
! PixmapPtr pPixmap;
! GCPtr pGC;
! register int npt; /* number of spans to fill */
! register DDXPointPtr ppt; /* pointer to list of start points */
! register int *pwidth; /* pointer to list of n widths */
! int fSorted;
{
register int *dstBase;
register int color;
register int alu;
int pitch; /* pitch in Longwords */
TRACE("tigpixSolidSp");
dstBase=(int *)pPixmap->devPrivate.ptr;
color=LongByteRepeater(pGC->fgPixel&0xFF);
alu=pGC->alu;
--- 267,310 ----
UNTRACE("tigpixSolidSp");
}
#else
! void tigpixSolidSp(pPixmap, pGC, nptInit, pptInit, pwidthInit, fSorted)
! PixmapPtr pPixmap;
! GCPtr pGC;
! int nptInit; /* number of spans to fill */
! DDXPointPtr pptInit; /* pointer to list of start points */
! int *pwidthInit; /* pointer to list of n widths */
! int fSorted;
{
register int *dstBase;
register int color;
register int alu;
int pitch; /* pitch in Longwords */
+ register int npt;
+ register DDXPointPtr ppt;
+ register int *pwidth;
+ int *pwidthFree; /* copies of the pointers to free */
+ DDXPointPtr pptFree;
+ GCPRIV *pPriv;
TRACE("tigpixSolidSp");
+ pPriv=(GCPRIV *)pGC->devPrivates[tigGCPrivateIndex].ptr;
+ npt=nptInit*miFindMaxBand(pPriv->clip);
+ pwidthFree=(int *)ALLOCATE_LOCAL(npt*sizeof(int));
+ pptFree=(DDXPointPtr)ALLOCATE_LOCAL(npt*sizeof(DDXPointRec));
+
+ if(!(pptFree&&pwidthFree))
+ {
+ if(pptFree) DEALLOCATE_LOCAL(pptFree);
+ if(pwidthFree) DEALLOCATE_LOCAL(pwidthFree);
+ return;
+ }
+
+ pwidth=pwidthFree;
+ ppt=pptFree;
+
+ npt=miClipSpans(pPriv->clip,pptInit,pwidthInit,nptInit,ppt,pwidth,fSorted);
+
dstBase=(int *)pPixmap->devPrivate.ptr;
color=LongByteRepeater(pGC->fgPixel&0xFF);
alu=pGC->alu;
***************
*** 374,379 ****
--- 407,572 ----
/*
* Draws stippled spans into the pixmap
*/
+ void
+ tigpixStipSp(pPixmap, pGC, nptInit, pptInit, pwidthInit, fSorted)
+ PixmapPtr pPixmap;
+ GCPtr pGC;
+ int nptInit;
+ DDXPointPtr pptInit;
+ int *pwidthInit;
+ int fSorted;
+ {
+ PixmapPtr tile;
+ unsigned char *srcBase;
+ unsigned char *dstBase;
+ register unsigned char color;
+ register int alu;
+ register int npt;
+ register DDXPointPtr ppt;
+ register int *pwidth;
+ int *pwidthFree; /* copies of the pointers to free */
+ DDXPointPtr pptFree;
+ GCPRIV *pPriv;
+
+ pPriv=(GCPRIV *)pGC->devPrivates[tigGCPrivateIndex].ptr;
+
+ npt=nptInit*miFindMaxBand(pPriv->clip);
+ pwidthFree=(int *)ALLOCATE_LOCAL(npt*sizeof(int));
+ pptFree=(DDXPointPtr)ALLOCATE_LOCAL(npt*sizeof(DDXPointRec));
+
+ if(!(pptFree&&pwidthFree))
+ {
+ if(pptFree) DEALLOCATE_LOCAL(pptFree);
+ if(pwidthFree) DEALLOCATE_LOCAL(pwidthFree);
+ return;
+ }
+
+ pwidth=pwidthFree;
+ ppt=pptFree;
+
+ npt=miClipSpans(pPriv->clip,pptInit,pwidthInit,nptInit,ppt,pwidth,fSorted);
+
+ tile = pGC->stipple;
+ srcBase = (unsigned char *)tile->devPrivate.ptr;
+ dstBase = (unsigned char *)pPixmap->devPrivate.ptr;
+
+ color = pGC->fgPixel;
+ alu = pGC->alu;
+
+ if (pPixmap->drawable.depth == 8)
+ {
+ while (npt--)
+ {
+ register unsigned char *dst;
+ register unsigned char *src;
+ int sbyte, sbit, srcX;
+ int x, x0, x1;
+
+ x0 = ppt->x;
+ x1 = x0 + *pwidth;
+
+ if (x0 < x1)
+ {
+ dst = dstBase + (ppt->y * pPixmap->devKind);
+ src = srcBase +
+ (((ppt->y-pGC->patOrg.y) % ((int)tile->drawable.height)) *
+ tile->devKind);
+ srcX = (x0 - pGC->patOrg.x) % (int)(tile->drawable.width);
+ sbyte = srcX / 8;
+ sbit = 0x80 >> (srcX&7);
+
+ for (x = x0; x < x1; x++)
+ {
+ if (sbit & src[sbyte]) DoRop(dst[x], alu, color, dst[x]);
+
+ if (++srcX == (int)(tile->drawable.width))
+ {
+ sbit = 0x80;
+ srcX = sbyte = 0;
+ }
+ else if(!(sbit >>= 1))
+ {
+ sbit = 0x80;
+ sbyte++;
+ }
+ }
+ }
+
+ ppt++;
+ pwidth++;
+ }
+ }
+ else /* 1 bit... */
+ {
+ if (color)
+ color = 0xFF;
+
+ while(npt--)
+ {
+ register unsigned char *dst;
+ int dbyte, dbit;
+ register unsigned char *src;
+ int sbyte, sbit, srcX;
+ int x, x0, x1;
+ register unsigned char dstFunc;
+
+ x0 = ppt->x;
+ x1 = x0 + *pwidth;
+
+ if (x0 < x1)
+ {
+ dst = dstBase + (ppt->y * pPixmap->devKind);
+ dbyte = x0 / 8;
+ dbit = 0x80 >> (x0&7);
+ DoRop(dstFunc, alu, color, dst[dbyte]);
+
+ src = srcBase +
+ (((ppt->y-pGC->patOrg.y) % ((int)tile->drawable.height)) *
+ tile->devKind);
+ srcX = (x0 - pGC->patOrg.x) % ((int)tile->drawable.width);
+ sbyte = srcX / 8;
+ sbit = 0x80 >> (srcX&7);
+
+ for (x = x0; x < x1; x++)
+ {
+ if (sbit & src[sbyte])
+ if(dbit & dstFunc)
+ dst[dbyte] |= dbit;
+ else
+ dst[dbyte] &= ~dbit;
+
+ if (++srcX == ((int)tile->drawable.width))
+ {
+ sbit = 0x80;
+ srcX = sbyte = 0;
+ }
+ else if (!(sbit >>= 1))
+ {
+ sbit = 0x80;
+ sbyte++;
+ }
+
+ if (!(dbit >>= 1))
+ {
+ dbit = 0x80;
+ dbyte++;
+ DoRop(dstFunc, alu, color, dst[dbyte]);
+ }
+ }
+ }
+
+ ppt++;
+ pwidth++;
+ }
+ }
+ DEALLOCATE_LOCAL(pptFree);
+ DEALLOCATE_LOCAL(pwidthFree);
+ }
+
+ #if 0 /* Rick Schaeffer: Old code...trying new routine above */
+ /*
+ * Draws stippled spans into the pixmap
+ */
void tigpixStipSp(pDraw, pGC, count, pts, width, sorted)
DrawablePtr pDraw;
GCPtr pGC;
***************
*** 486,493 ****
}
UNTRACE("tigpixStipSp");
}
!
!
/*
* Draws tiled spans into the pixmap
--- 679,685 ----
}
UNTRACE("tigpixStipSp");
}
! #endif
/*
* Draws tiled spans into the pixmap
***************
*** 516,521 ****
--- 708,718 ----
/*dest = (unsigned char *)pix->devPrivate;*/
dest = (unsigned char *)pix->devPrivate.ptr; /* RS */
/*tile = pGC->tile;*/
+
+ if (pGC->tileIsPixel) {
+ return;
+ }
+
tile = pGC->tile.pixmap; /* RS */
/*src = (unsigned char *)tile->devPrivate;*/
src = (unsigned char *)tile->devPrivate.ptr; /* RS */
*** 1.1 1992/08/23 17:46:38
--- tigprim.c 1992/08/22 16:26:40
***************
*** 1,6 ****
--- 1,12 ----
/*
* X primitives; Trying to make best use of TIGA primitives
*
+ * 10 Aug 92 Rick Schaeffer (ricks@isc-br.isc-br.com)
+ * Fixed "memory leak" problem caused by allocation of tbox
+ * structure that were never freed.
+ * 20 Jul 92 Rick Schaeffer (ricks@isc-br.isc-br.com)
+ * Fixed problem that caused pattern fills to work improperly. The
+ * code wasn't waiting for the tiga to finish the fill operation.
* 22 Jun 90 Erich Rickheit KSC Admitted responsibility
* 5 Jul 90 Erich Rickheit KSC Moved tigCopyArea to tigimg.c
* 10 Jul 90 Erich Rickheit KSC Added tigDashLine,tigDashSegment
***************
*** 223,229 ****
int i, j, r, xorg, yorg;
RegionPtr reg, draw;
GCPRIV * pPriv;
! BoxRec * tbox;
TRACE("tigSolidRect");
xorg=pWin->drawable.x; /* used to be ->origin.x AKO */
--- 229,235 ----
int i, j, r, xorg, yorg;
RegionPtr reg, draw;
GCPRIV * pPriv;
! BoxRec tbox;
TRACE("tigSolidRect");
xorg=pWin->drawable.x; /* used to be ->origin.x AKO */
***************
*** 240,251 ****
set_colors(pGC->fgPixel, pGC->bgPixel);
for (i = 0; i < count; i++) {
! tbox = XNEW(BoxRec);
! tbox->x1 = xorg + rects[i].x;
! tbox->y1 = yorg + rects[i].y;
! tbox->x2 = tbox->x1 + rects[i].width;
! tbox->y2 = tbox->y1 + rects[i].height;
! draw = (*pGC->pScreen->RegionCreate)(tbox, 1);
(*pGC->pScreen->Intersect)(draw, draw, reg);
for (r = 0; r < REGION_NUM_RECTS(draw); r++) {
fill_rect(REGION_RECTS(draw)[r].x2 - REGION_RECTS(draw)[r].x1,
--- 246,256 ----
set_colors(pGC->fgPixel, pGC->bgPixel);
for (i = 0; i < count; i++) {
! tbox.x1 = xorg + rects[i].x;
! tbox.y1 = yorg + rects[i].y;
! tbox.x2 = tbox.x1 + rects[i].width;
! tbox.y2 = tbox.y1 + rects[i].height;
! draw = (*pGC->pScreen->RegionCreate)(&tbox, 1);
(*pGC->pScreen->Intersect)(draw, draw, reg);
for (r = 0; r < REGION_NUM_RECTS(draw); r++) {
fill_rect(REGION_RECTS(draw)[r].x2 - REGION_RECTS(draw)[r].x1,
***************
*** 341,346 ****
--- 346,352 ----
REGION_RECTS(reg)[r].x1, REGION_RECTS(reg)[r].y1);
patnfill_polygon(count, (unsigned short *)plist);
}
+ synchronize();
set_clip_rect(scrwidth,scrheight, 0, 0);
UNTRACE("tigStipFillPoly");
}
***************
*** 364,370 ****
int i, j, r, xorg, yorg;
RegionPtr reg, draw;
GCPRIV * pPriv;
! BoxRec * tbox;
TRACE("tigStipRect");
xorg=pWin->drawable.x; /* used to be ->origin.x AKO */
--- 370,376 ----
int i, j, r, xorg, yorg;
RegionPtr reg, draw;
GCPRIV * pPriv;
! BoxRec tbox;
TRACE("tigStipRect");
xorg=pWin->drawable.x; /* used to be ->origin.x AKO */
***************
*** 384,395 ****
set_colors(pGC->fgPixel, pGC->bgPixel);
for (i = 0; i < count; i++) {
! tbox = XNEW(BoxRec);
! tbox->x1 = xorg + rects[i].x;
! tbox->y1 = yorg + rects[i].y;
! tbox->x2 = tbox->x1 + rects[i].width;
! tbox->y2 = tbox->y1 + rects[i].height;
! draw = (*pGC->pScreen->RegionCreate)(tbox, 1);
(*pGC->pScreen->Intersect)(draw, draw, reg);
for (r = 0; r < REGION_NUM_RECTS(draw); r++) {
patnfill_rect(REGION_RECTS(draw)[r].x2 - REGION_RECTS(draw)[r].x1,
--- 390,400 ----
set_colors(pGC->fgPixel, pGC->bgPixel);
for (i = 0; i < count; i++) {
! tbox.x1 = xorg + rects[i].x;
! tbox.y1 = yorg + rects[i].y;
! tbox.x2 = tbox.x1 + rects[i].width;
! tbox.y2 = tbox.y1 + rects[i].height;
! draw = (*pGC->pScreen->RegionCreate)(&tbox, 1);
(*pGC->pScreen->Intersect)(draw, draw, reg);
for (r = 0; r < REGION_NUM_RECTS(draw); r++) {
patnfill_rect(REGION_RECTS(draw)[r].x2 - REGION_RECTS(draw)[r].x1,
***************
*** 398,403 ****
--- 403,409 ----
}
(*pGC->pScreen->RegionDestroy)(draw);
}
+ synchronize();
UNTRACE("tigStipRect");
}
*** 1.1 1992/08/23 17:46:38
--- tigscrinit.c 1992/08/23 17:52:25
***************
*** 9,14 ****
--- 9,19 ----
** Written at the University of Massachusetts at Lowell, Lowell, MA.
**
*/
+ /*
+ * 20 Jul 92 Rick Schaeffer (ricks@isc-br.isc-br.com)
+ * Added code to release tiga memory allocated for cursors and
+ * patterns.
+ */
#include "../amix.h"
#include "resource.h"
#include "servermd.h" /* For PixmapBytePad */
***************
*** 35,40 ****
--- 40,47 ----
int tigWindowPrivateIndex;
int tigGeneration=0;
+ extern unsigned long tigpatmem;
+
#ifdef LOWELLTIGA
char *tigagm = "/usr/X/lib/tigagm.coff";
char *osc1="36.000MHZ";
***************
*** 291,302 ****
return TRUE;
}
-
Bool tigCloseScreen(index, pScreen)
int index;
ScreenPtr pScreen;
{
! return TRUE;
! }
--- 298,314 ----
return TRUE;
}
Bool tigCloseScreen(index, pScreen)
int index;
ScreenPtr pScreen;
{
! TRACE("tigCloseScreen");
+ if (tigpatmem != NULL)
+ tigfree(tigpatmem);
+ tigmemdone();
+ UNTRACE("tigCloseScreen");
+
+ return TRUE;
+ }
*** 1.1 1992/08/23 17:46:38
--- tigspan.c 1992/08/14 14:50:23
***************
*** 223,228 ****
--- 223,230 ----
i |= i << 8 | i << 16 | i << 24;
set_pmask(i);
set_colors(pGC->fgPixel, pGC->bgPixel);
+ tigSetstip(pGC->stipple, pDraw->x + pGC->patOrg.x,
+ pDraw->y + pGC->patOrg.y);
for (r = 0; r < REGION_NUM_RECTS(reg); r++) {
if ((pts[0].y >= REGION_RECTS(reg)[r].y2) || (pts[count-1].y
< REGION_RECTS(reg)[r].y1))
***************
*** 241,246 ****
--- 243,249 ----
if (i < count)
be = i;
}
+ synchronize();
UNTRACE("tigFillStipSpans");
}
***************
*** 454,460 ****
porgy=pPixmap->drawable.y+pGC->patOrg.y;
}
! if(!(pTile=pGC->tile.pixmap)) return;
tBase=pTile->devPrivate.ptr;
tWidth=pTile->drawable.width;
tHeight=pTile->drawable.height;
--- 457,463 ----
porgy=pPixmap->drawable.y+pGC->patOrg.y;
}
! if(pGC->tileIsPixel || !(pTile=pGC->tile.pixmap)) return;
tBase=pTile->devPrivate.ptr;
tWidth=pTile->drawable.width;
tHeight=pTile->drawable.height;
***************
*** 544,550 ****
}
get_colors(&ofc, &obc); /* WHY??? - AKO */
! if(!(tile=pGC->tile.pixmap)) return; /* RS */
data=(unsigned char *)tile->devPrivate.ptr; /* RS */
--- 547,553 ----
}
get_colors(&ofc, &obc); /* WHY??? - AKO */
! if(pGC->tileIsPixel || !(tile=pGC->tile.pixmap)) return; /* RS */
data=(unsigned char *)tile->devPrivate.ptr; /* RS */
*** 1.1 1992/08/23 17:46:38
--- tigtext.c 1992/08/22 21:10:20
***************
*** 1,6 ****
--- 1,12 ----
/*
* Stuff to manipulate TIGA fonts and text
*
+ * 10 Aug 92 Rick Schaeffer (ricks@isc-br.isc-br.com)
+ * Fixed "memory leak" problem caused by allocation of tbox
+ * structure that were never freed.
+ * 1 Jun 92 Rick Schaeffer (ricks@isc-br.isc-br.com)
+ * Fix bug in which shifts were backwards causing problems with
+ * large fonts.
* 22 Jun 90 Erich Rickheit KSC Admitted responsibility
*/
***************
*** 215,230 ****
instfont = cur->next;
Xfree(cur);
}
! Xfree(finf->patn);
! Xfree(finf->locs);
! Xfree(finf->owtab);
! Xfree(finf);
UNTRACE("tigUnrealizeFont");
return TRUE;
}
! static short tem[37];
/*
* We only have enough memory on the board to keep a few fonts down
--- 221,238 ----
instfont = cur->next;
Xfree(cur);
}
! if (finf) {
! Xfree(finf->patn);
! Xfree(finf->locs);
! Xfree(finf->owtab);
! Xfree(finf);
! }
UNTRACE("tigUnrealizeFont");
return TRUE;
}
! static unsigned short tem[37];
/*
* We only have enough memory on the board to keep a few fonts down
***************
*** 247,252 ****
--- 255,261 ----
if (pFont == cur->fnp) {
if (cur->loc != NULL) {
select_font(cur->fid);
+ UNTRACE("tigFontLoad.0");
return;
} else
{
***************
*** 286,292 ****
*/
tem[0] = finf->tigfont.magic;
tem[1] = 0xffff & finf->tigfont.length;
! tem[2] = (finf->tigfont.length) << 16;
tem[3] = 0x4142;
tem[4] = 0;
tem[19] = finf->tigfont.first;
--- 295,301 ----
*/
tem[0] = finf->tigfont.magic;
tem[1] = 0xffff & finf->tigfont.length;
! tem[2] = (finf->tigfont.length) >> 16;
tem[3] = 0x4142;
tem[4] = 0;
tem[19] = finf->tigfont.first;
***************
*** 300,312 ****
tem[27] = finf->tigfont.descent;
tem[28] = finf->tigfont.leading;
tem[29] = 0xffff & finf->tigfont.rowpitch;
! tem[30] = (finf->tigfont.rowpitch) << 16;
tem[31] = 0xffff & finf->tigfont.oPatnTbl;
! tem[32] = (finf->tigfont.oPatnTbl) << 16;
tem[33] = 0xffff & finf->tigfont.oLocTbl;
! tem[34] = (finf->tigfont.oLocTbl) << 16;
tem[35] = 0xffff & finf->tigfont.oOwTbl;
! tem[36] = (finf->tigfont.oOwTbl) << 16;
host2gsp(tem, cur->loc, sizeof(short)*37, 0);
pt = finf->tigfont.rowpitch;
host2gsp(finf->patn, cur->loc + finf->tigfont.oPatnTbl,
--- 309,321 ----
tem[27] = finf->tigfont.descent;
tem[28] = finf->tigfont.leading;
tem[29] = 0xffff & finf->tigfont.rowpitch;
! tem[30] = (finf->tigfont.rowpitch) >> 16;
tem[31] = 0xffff & finf->tigfont.oPatnTbl;
! tem[32] = (finf->tigfont.oPatnTbl) >> 16;
tem[33] = 0xffff & finf->tigfont.oLocTbl;
! tem[34] = (finf->tigfont.oLocTbl) >> 16;
tem[35] = 0xffff & finf->tigfont.oOwTbl;
! tem[36] = (finf->tigfont.oOwTbl) >> 16;
host2gsp(tem, cur->loc, sizeof(short)*37, 0);
pt = finf->tigfont.rowpitch;
host2gsp(finf->patn, cur->loc + finf->tigfont.oPatnTbl,
***************
*** 319,325 ****
return;
}
select_font(cur->fid);
! UNTRACE("tigFontLoad");
}
#define DRAW_X 0
--- 328,334 ----
return;
}
select_font(cur->fid);
! UNTRACE("tigFontLoad.1");
}
#define DRAW_X 0
***************
*** 340,346 ****
RegionPtr reg, draw;
unsigned char *text;
ExtentInfoRec inf;
! BoxRec *tbox;
int start, asc, des, tw, c, xw, yw;
FONTPRIV *finf;
--- 349,355 ----
RegionPtr reg, draw;
unsigned char *text;
ExtentInfoRec inf;
! BoxRec tbox;
int start, asc, des, tw, c, xw, yw;
FONTPRIV *finf;
***************
*** 349,354 ****
--- 358,364 ----
if(pGC->font->devPriv[pGC->pScreen->myNum] == NULL)
{
miImageText8(pWin, pGC, x, y, count, itext);
+ UNTRACE("tigImageText8.0");
return;
}
***************
*** 372,388 ****
asc=pGC->font->pFI->maxbounds.metrics.ascent;
des=pGC->font->pFI->maxbounds.metrics.descent;
! tbox=XNEW(BoxRec);
! tbox->x1=xw=x+xorg;
! tbox->x2=tbox->x1+tw;
! tbox->y1=yw=y+yorg-asc;
! tbox->y2=y+yorg+des;
! j=(*pGC->pScreen->RectIn)(reg, tbox);
if(j==rgnOUT) /* trivial reject */
{
Xfree(text);
return;
}
--- 382,398 ----
asc=pGC->font->pFI->maxbounds.metrics.ascent;
des=pGC->font->pFI->maxbounds.metrics.descent;
! tbox.x1=xw=x+xorg;
! tbox.x2=tbox.x1+tw;
! tbox.y1=yw=y+yorg-asc;
! tbox.y2=y+yorg+des;
! j=(*pGC->pScreen->RectIn)(reg, &tbox);
if(j==rgnOUT) /* trivial reject */
{
Xfree(text);
+ UNTRACE("tigImageText8.1");
return;
}
***************
*** 393,405 ****
set_colors(pGC->fgPixel, pGC->bgPixel);
text_out(x+xorg, y+yorg-asc, text);
Xfree(text);
return;
}
/* intersect rectangles */
! draw=(*pGC->pScreen->RegionCreate)(tbox, 1);
(*pGC->pScreen->Intersect)(draw, draw, reg);
set_ppop(xftotf[pGC->alu]);
set_pmask(LongByteRepeater((~pGC->planemask)&0xFF));
set_colors(pGC->fgPixel, pGC->bgPixel);
--- 403,417 ----
set_colors(pGC->fgPixel, pGC->bgPixel);
text_out(x+xorg, y+yorg-asc, text);
Xfree(text);
+ UNTRACE("tigImageText8.2");
return;
}
/* intersect rectangles */
! draw=(*pGC->pScreen->RegionCreate)(&tbox, 1);
(*pGC->pScreen->Intersect)(draw, draw, reg);
+ #if 1
set_ppop(xftotf[pGC->alu]);
set_pmask(LongByteRepeater((~pGC->planemask)&0xFF));
set_colors(pGC->fgPixel, pGC->bgPixel);
***************
*** 415,443 ****
text_out(x+xorg,y+yorg-asc,text);
}
set_clip_rect(scrwidth,scrheight,0,0);
!
/*
* Text needs to be clipped. We do it by drawing the text
* offscreen and then blitting in the visible chunks (all
* because hardware clipping won't do text!)
! * set_pmask(0);
! * set_ppop(0);
! * set_colors(pGC->fgPixel, pGC->bgPixel);
! * text_out(DRAW_X,DRAW_Y, text);
! *
! * for(r=0; r<REGION_NUM_RECTS(draw); r++)
! * bitblt(REGION_RECTS(draw)[r].x2-REGION_RECTS(draw)[r].x1,
! * REGION_RECTS(draw)[r].y2-REGION_RECTS(draw)[r].y1,
! * REGION_RECTS(draw)[r].x1-xw+DRAW_X,
! * REGION_RECTS(draw)[r].y1-yw+DRAW_Y,
! * REGION_RECTS(draw)[r].x1,
! * REGION_RECTS(draw)[r].y1);
! */
Xfree(text);
(*pGC->pScreen->RegionDestroy)(draw);
! UNTRACE("tigImageText");
return;
}
--- 427,456 ----
text_out(x+xorg,y+yorg-asc,text);
}
set_clip_rect(scrwidth,scrheight,0,0);
! #else
/*
* Text needs to be clipped. We do it by drawing the text
* offscreen and then blitting in the visible chunks (all
* because hardware clipping won't do text!)
! */
! set_pmask(0);
! set_ppop(0);
! set_colors(pGC->fgPixel, pGC->bgPixel);
! text_out(DRAW_X,DRAW_Y, text);
!
! for(r=0; r<REGION_NUM_RECTS(draw); r++)
! bitblt(REGION_RECTS(draw)[r].x2-REGION_RECTS(draw)[r].x1,
! REGION_RECTS(draw)[r].y2-REGION_RECTS(draw)[r].y1,
! REGION_RECTS(draw)[r].x1-xw+DRAW_X,
! REGION_RECTS(draw)[r].y1-yw+DRAW_Y,
! REGION_RECTS(draw)[r].x1,
! REGION_RECTS(draw)[r].y1);
! #endif
Xfree(text);
(*pGC->pScreen->RegionDestroy)(draw);
! UNTRACE("tigImageText8.3");
return;
}
***************
*** 460,467 ****
RegionPtr reg, draw;
unsigned char *text;
ExtentInfoRec inf;
! BoxRec * tbox;
! int start, fg, asc, des, tw, xw, yw;
TRACE("tigPolyText8");
--- 473,480 ----
RegionPtr reg, draw;
unsigned char *text;
ExtentInfoRec inf;
! BoxRec tbox;
! int start, fg, asc, des, tw, xw, yw;
TRACE("tigPolyText8");
***************
*** 494,506 ****
asc=pGC->font->pFI->maxbounds.metrics.ascent;
des=pGC->font->pFI->maxbounds.metrics.descent;
! tbox=XNEW(BoxRec);
! tbox->x1=xw=x+xorg;
! tbox->x2=tbox->x1+tw;
! tbox->y1=yw=y+yorg-asc;
! tbox->y2=y+yorg+des;
! j=(*pGC->pScreen->RectIn)(reg, tbox);
if(j==rgnOUT) /* trivial reject */
{
--- 507,518 ----
asc=pGC->font->pFI->maxbounds.metrics.ascent;
des=pGC->font->pFI->maxbounds.metrics.descent;
! tbox.x1=xw=x+xorg;
! tbox.x2=tbox.x1+tw;
! tbox.y1=yw=y+yorg-asc;
! tbox.y2=y+yorg+des;
! j=(*pGC->pScreen->RectIn)(reg, &tbox);
if(j==rgnOUT) /* trivial reject */
{
***************
*** 534,539 ****
--- 546,552 ----
/* Ummm... I think TIGA clips text (it does for me!) - AKO */
+ #if 1
set_pmask(LongByteRepeater((~pGC->planemask)&0xFF));
if(fg)
***************
*** 550,556 ****
}
/* intersect rectangles */
! draw=(*pGC->pScreen->RegionCreate)(tbox, 1);
(*pGC->pScreen->Intersect)(draw, draw, reg);
for(r=0; r<REGION_NUM_RECTS(draw); r++)
--- 563,569 ----
}
/* intersect rectangles */
! draw=(*pGC->pScreen->RegionCreate)(&tbox, 1);
(*pGC->pScreen->Intersect)(draw, draw, reg);
for(r=0; r<REGION_NUM_RECTS(draw); r++)
***************
*** 562,606 ****
text_out(x+xorg,y+yorg-asc,text);
}
set_clip_rect(scrwidth,scrheight,0,0);
!
/*
* Text needs to be clipped. We do it by drawing the text
* offscreen and then blitting in the visible chunks (all
* because hardware clipping won't do text!)
- * set_ppop(0);
- * set_fcolor(0);
- * set_pmask(0);
- * set_clip_rect(tw,des-asc,DRAW_X,DRAW_Y);
- * fill_rect(tw,des-asc, DRAW_X, DRAW_Y);
- *
- * if(fg) set_colors(fg, 0);
- * else set_colors(fg, 0xff);
- *
- * text_out(DRAW_X,DRAW_Y, text);
- *
- * set_clip_rect(scrwidth,scrheight,DRAW_X,DRAW_Y);
- *
- *
- * set_pmask(pmask);
- *
- * if(fg)
- * {
- * transp_on();
- * set_ppop(xftotf[pGC->alu]);
- * }
- * else
- * {
- * set_ppop(tigfaketrans[pGC->alu]);
- * }
- *
- * for(r=0; r<REGION_NUM_RECTS(draw); r++)
- * bitblt(REGION_RECTS(draw)[r].x2-REGION_RECTS(draw)[r].x1,
- * REGION_RECTS(draw)[r].y2-REGION_RECTS(draw)[r].y1,
- * REGION_RECTS(draw)[r].x1-xw+DRAW_X,
- * REGION_RECTS(draw)[r].y1-yw+DRAW_Y,
- * REGION_RECTS(draw)[r].x1,
- * REGION_RECTS(draw)[r].y1);
*/
Xfree(text);
(*pGC->pScreen->RegionDestroy)(draw);
transp_off();
--- 575,620 ----
text_out(x+xorg,y+yorg-asc,text);
}
set_clip_rect(scrwidth,scrheight,0,0);
! #else
/*
* Text needs to be clipped. We do it by drawing the text
* offscreen and then blitting in the visible chunks (all
* because hardware clipping won't do text!)
*/
+ set_ppop(0);
+ set_fcolor(0);
+ set_pmask(0);
+ set_clip_rect(tw,des-asc,DRAW_X,DRAW_Y);
+ fill_rect(tw,des-asc, DRAW_X, DRAW_Y);
+
+ if(fg) set_colors(fg, 0);
+ else set_colors(fg, 0xff);
+
+ text_out(DRAW_X,DRAW_Y, text);
+
+ set_clip_rect(scrwidth,scrheight,DRAW_X,DRAW_Y);
+
+
+ set_pmask(pmask);
+
+ if(fg)
+ {
+ transp_on();
+ set_ppop(xftotf[pGC->alu]);
+ }
+ else
+ {
+ set_ppop(tigfaketrans[pGC->alu]);
+ }
+
+ for(r=0; r<REGION_NUM_RECTS(draw); r++)
+ bitblt(REGION_RECTS(draw)[r].x2-REGION_RECTS(draw)[r].x1,
+ REGION_RECTS(draw)[r].y2-REGION_RECTS(draw)[r].y1,
+ REGION_RECTS(draw)[r].x1-xw+DRAW_X,
+ REGION_RECTS(draw)[r].y1-yw+DRAW_Y,
+ REGION_RECTS(draw)[r].x1,
+ REGION_RECTS(draw)[r].y1);
+ #endif
Xfree(text);
(*pGC->pScreen->RegionDestroy)(draw);
transp_off();
***************
*** 625,631 ****
GCPRIV * pPriv;
unsigned char *text;
ExtentInfoRec inf;
! BoxRec * tbox;
int start, fg, asc, des, tw, xw, yw;
static int offscreen_x, offscreen_y; /* 0, 768 */
static int offscreen_area_known = FALSE;
--- 639,645 ----
GCPRIV * pPriv;
unsigned char *text;
ExtentInfoRec inf;
! BoxRec tbox;
int start, fg, asc, des, tw, xw, yw;
static int offscreen_x, offscreen_y; /* 0, 768 */
static int offscreen_area_known = FALSE;
***************
*** 656,670 ****
tw = text_width(text);
asc = pGC->font->pFI->maxbounds.metrics.ascent;
des = pGC->font->pFI->maxbounds.metrics.descent;
! tbox = XNEW(BoxRec);
! tbox->x1 = xw = x + xorg;
! tbox->x2 = tbox->x1 + tw;
! tbox->y1 = yw = y + yorg - asc;
! tbox->y2 = y + yorg + des;
j = x + tw;
/* intersect rectangles */
! draw = (*pGC->pScreen->RegionCreate)(tbox, 1);
(*pGC->pScreen->Intersect)(draw, draw, pPriv->clip);
if (!offscreen_area_known)
--- 670,683 ----
tw = text_width(text);
asc = pGC->font->pFI->maxbounds.metrics.ascent;
des = pGC->font->pFI->maxbounds.metrics.descent;
! tbox.x1 = xw = x + xorg;
! tbox.x2 = tbox.x1 + tw;
! tbox.y1 = yw = y + yorg - asc;
! tbox.y2 = y + yorg + des;
j = x + tw;
/* intersect rectangles */
! draw = (*pGC->pScreen->RegionCreate)(&tbox, 1);
(*pGC->pScreen->Intersect)(draw, draw, pPriv->clip);
if (!offscreen_area_known)
***************
*** 738,743 ****
--- 751,757 ----
Xfree(text);
(*pGC->pScreen->RegionDestroy)(draw);
transp_off();
+ synchronize();
UNTRACE("tigStipText8");
return j;
}
*** 1.1 1992/08/23 17:46:38
--- tigwin.c 1992/08/22 21:11:36
***************
*** 1,6 ****
--- 1,8 ----
/*
* TIGA window control stuff
*
+ * 20 Aug 92 Rick Schaeffer (ricks@isc-br.isc-br.com)
+ * Fix memory leak.
* 22 Jun 90 Erich Rickheit KSC Admitted responsibility
* 1 Jul 91 Aaron Orenstein Changed tigSetstip(...origin.x, origin.y)
* to tigSetstip(...drawable.x, drawable.y)
***************
*** 174,179 ****
--- 176,182 ----
pbox[order[i]].x1, pbox[order[i]].y1);
(*pWin->drawable.pScreen->RegionDestroy)(newreg);
+ Xfree(order);
set_ppop(op);
UNTRACE("tigCopyWindow");
}