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 >
Text File  |  1992-08-26  |  48KB  |  1,681 lines

  1. *** 1.1    1992/08/23 17:46:38
  2. --- tigdebug.c    1992/08/14 14:50:16
  3. ***************
  4. *** 1,11 ****
  5. --- 1,15 ----
  6.   void
  7.   Trace(char *arg)
  8.   {
  9. + #ifdef DOTRACE
  10.     ErrorF("Trace %s\n", arg);
  11. + #endif
  12.   }
  13.   
  14.   void
  15.   Untrace(char *arg)
  16.   {
  17. + #ifdef DOTRACE
  18.     ErrorF("Untrace %s\n", arg);
  19. + #endif
  20.   }
  21. *** 1.1    1992/08/23 17:46:38
  22. --- tiggc.c    1992/08/22 16:02:11
  23. ***************
  24. *** 1,6 ****
  25. --- 1,10 ----
  26.   /*
  27.    * TIGA GC control and manipulation
  28.    *
  29. +  * 10 Aug 92 Rick Schaeffer (ricks@isc-br.isc-br.com)
  30. +  *                    Fixed "memory leak" caused by
  31. +  *                    allocating tbox structures that
  32. +  *                    were never freed.
  33.    * 16 Jan 92 Keith Gabryelski        Bug fix in
  34.    *                    tigSetstip() that would cause
  35.    *                    stipples that had positive indexes
  36. ***************
  37. *** 544,550 ****
  38.   { 
  39.     GCPRIV *pPriv;
  40.     int win_moved;
  41. !   BoxRec *tbox;
  42.     PixmapPtr pPix=(PixmapPtr)pDraw;
  43.     extern void miPolyPoint();
  44.     
  45. --- 548,554 ----
  46.   { 
  47.     GCPRIV *pPriv;
  48.     int win_moved;
  49. !   BoxRec tbox;
  50.     PixmapPtr pPix=(PixmapPtr)pDraw;
  51.     extern void miPolyPoint();
  52.     
  53. ***************
  54. *** 569,580 ****
  55.         else if(pGC->clientClipType==CT_NONE)
  56.       { 
  57.         (*pGC->pScreen->RegionDestroy)(pPriv->clip);
  58. !       tbox=XNEW(BoxRec);
  59. !       tbox->x1=0;
  60. !           tbox->y1=0;
  61. !       tbox->x2=pDraw->width; 
  62. !       tbox->y2=pDraw->height;
  63. !       pPriv->clip=(*pGC->pScreen->RegionCreate)(tbox, 1);
  64.         win_moved=TRUE;
  65.       }
  66.       }
  67. --- 573,583 ----
  68.         else if(pGC->clientClipType==CT_NONE)
  69.       { 
  70.         (*pGC->pScreen->RegionDestroy)(pPriv->clip);
  71. !       tbox.x1=0;
  72. !           tbox.y1=0;
  73. !       tbox.x2=pDraw->width; 
  74. !       tbox.y2=pDraw->height;
  75. !       pPriv->clip=(*pGC->pScreen->RegionCreate)(&tbox, 1);
  76.         win_moved=TRUE;
  77.       }
  78.       }
  79. *** 1.1    1992/08/23 17:46:38
  80. --- tigimag.c    1992/08/22 16:04:58
  81. ***************
  82. *** 2,7 ****
  83. --- 2,11 ----
  84.    * More X primitives; primarily those dealing with 
  85.    * blits and images
  86.    *
  87. +  * 10 Aug 92 Rick Schaeffer (ricks@isc-br.isc-br.com)
  88. +  *                    Fixed "memory leak" caused by
  89. +  *                    allocating tbox structures that
  90. +  *                    were never freed.
  91.    * 22 Jun 90 Erich Rickheit KSC  Admitted responsibility
  92.    *  5 Jul 90 Erich Rickheit KSC  Moved in tigCopyArea
  93.    */
  94. ***************
  95. *** 88,94 ****
  96.       RegionPtr      reg, draw;
  97.       GCPRIV        * pPriv;
  98.       long    bm;
  99. !     BoxRec        * tbox;
  100.       WindowPtr      pWin;
  101.       unsigned char    *s;
  102.   
  103. --- 92,98 ----
  104.       RegionPtr      reg, draw;
  105.       GCPRIV        * pPriv;
  106.       long    bm;
  107. !     BoxRec        tbox;
  108.       WindowPtr      pWin;
  109.       unsigned char    *s;
  110.   
  111. ***************
  112. *** 129,140 ****
  113.               *s = swiz[*s];
  114.           host2gsp(pImage, bm, (p * h) / 8, 1);
  115.           /* figger clip region */
  116. !         tbox = XNEW(BoxRec);
  117. !         tbox->x1 = xorg + x; 
  118. !         tbox->y1 = yorg + y;
  119. !         tbox->x2 = tbox->x1 + w; 
  120. !         tbox->y2 = tbox->y1 + h;
  121. !         draw = (*pGC->pScreen->RegionCreate)(tbox, 1);
  122.           (*pGC->pScreen->Intersect)(draw, draw, reg);
  123.           /* blit that mother */
  124.           for (r = 0; r < REGION_NUM_RECTS(draw); r++) { 
  125. --- 133,143 ----
  126.               *s = swiz[*s];
  127.           host2gsp(pImage, bm, (p * h) / 8, 1);
  128.           /* figger clip region */
  129. !         tbox.x1 = xorg + x; 
  130. !         tbox.y1 = yorg + y;
  131. !         tbox.x2 = tbox.x1 + w; 
  132. !         tbox.y2 = tbox.y1 + h;
  133. !         draw = (*pGC->pScreen->RegionCreate)(&tbox, 1);
  134.           (*pGC->pScreen->Intersect)(draw, draw, reg);
  135.           /* blit that mother */
  136.           for (r = 0; r < REGION_NUM_RECTS(draw); r++) { 
  137. ***************
  138. *** 163,174 ****
  139.           }
  140.           set_srcbm(bm, p, w, h, 1);
  141.           /* figger clip region */
  142. !         tbox = XNEW(BoxRec);
  143. !         tbox->x1 = xorg + x; 
  144. !         tbox->y1 = yorg + y;
  145. !         tbox->x2 = tbox->x1 + w; 
  146. !         tbox->y2 = tbox->y1 + h;
  147. !         draw = (*pGC->pScreen->RegionCreate)(tbox, 1);
  148.           (*pGC->pScreen->Intersect)(draw, draw, reg);
  149.           set_fcolor(0); /* clear stuff out */
  150.           for (r = 0; r < REGION_NUM_RECTS(draw); r++)
  151. --- 166,176 ----
  152.           }
  153.           set_srcbm(bm, p, w, h, 1);
  154.           /* figger clip region */
  155. !         tbox.x1 = xorg + x; 
  156. !         tbox.y1 = yorg + y;
  157. !         tbox.x2 = tbox.x1 + w; 
  158. !         tbox.y2 = tbox.y1 + h;
  159. !         draw = (*pGC->pScreen->RegionCreate)(&tbox, 1);
  160.           (*pGC->pScreen->Intersect)(draw, draw, reg);
  161.           set_fcolor(0); /* clear stuff out */
  162.           for (r = 0; r < REGION_NUM_RECTS(draw); r++)
  163. ***************
  164. *** 207,218 ****
  165.                */
  166.           p = (w + 3) & ~3;
  167.           /* figger clip region */
  168. !         tbox = XNEW(BoxRec);
  169. !         tbox->x1 = xorg + x; 
  170. !         tbox->y1 = yorg + y;
  171. !         tbox->x2 = tbox->x1 + w; 
  172. !         tbox->y2 = tbox->y1 + h;
  173. !         draw = (*pGC->pScreen->RegionCreate)(tbox, 1);
  174.           (*pGC->pScreen->Intersect)(draw, draw, reg);
  175.           for (r = 0; r < REGION_NUM_RECTS(draw); r++) { 
  176.               host2gspxy(pImage, p, scrtop, scrpitch * 8,
  177. --- 209,219 ----
  178.                */
  179.           p = (w + 3) & ~3;
  180.           /* figger clip region */
  181. !         tbox.x1 = xorg + x; 
  182. !         tbox.y1 = yorg + y;
  183. !         tbox.x2 = tbox.x1 + w; 
  184. !         tbox.y2 = tbox.y1 + h;
  185. !         draw = (*pGC->pScreen->RegionCreate)(&tbox, 1);
  186.           (*pGC->pScreen->Intersect)(draw, draw, reg);
  187.           for (r = 0; r < REGION_NUM_RECTS(draw); r++) { 
  188.               host2gspxy(pImage, p, scrtop, scrpitch * 8,
  189. ***************
  190. *** 254,260 ****
  191.       RegionPtr      reg, draw;
  192.       GCPRIV        * pPriv;
  193.       long    bm;
  194. !     BoxRec        * tbox;
  195.       WindowPtr      pWin;
  196.       unsigned char    *s, *t, *bits;
  197.       int    fg, bg;
  198. --- 255,261 ----
  199.       RegionPtr      reg, draw;
  200.       GCPRIV        * pPriv;
  201.       long    bm;
  202. !     BoxRec        tbox;
  203.       WindowPtr      pWin;
  204.       unsigned char    *s, *t, *bits;
  205.       int    fg, bg;
  206. ***************
  207. *** 287,298 ****
  208.       /* send down bits */
  209.       host2gsp(bits, bm, pBitmap->devKind * h, 1);
  210.       /* figger rectangle */
  211. !     tbox = XNEW(BoxRec);
  212. !     tbox->x1 = xs; 
  213. !     tbox->y1 = ys;
  214. !     tbox->x2 = tbox->x1 + w; 
  215. !     tbox->y2 = tbox->y1 + h;
  216. !     draw = (*pGC->pScreen->RegionCreate)(tbox, 1);
  217.       (*pGC->pScreen->Intersect)(draw, draw, reg);
  218.   
  219.       i = (~pGC->planemask) & 0xff;
  220. --- 288,298 ----
  221.       /* send down bits */
  222.       host2gsp(bits, bm, pBitmap->devKind * h, 1);
  223.       /* figger rectangle */
  224. !     tbox.x1 = xs; 
  225. !     tbox.y1 = ys;
  226. !     tbox.x2 = tbox.x1 + w; 
  227. !     tbox.y2 = tbox.y1 + h;
  228. !     draw = (*pGC->pScreen->RegionCreate)(&tbox, 1);
  229.       (*pGC->pScreen->Intersect)(draw, draw, reg);
  230.   
  231.       i = (~pGC->planemask) & 0xff;
  232. ***************
  233. *** 336,342 ****
  234.   int    xSrc, ySrc, width, height, xDst, yDst;
  235.   {
  236.     RegionPtr     blitme, temp;
  237. !   BoxRec       *tbox;
  238.     ScreenPtr     pScreen=pGC->pScreen;
  239.     int           count, i, j, t, w, h, Sx, Sy, Dx, Dy;
  240.     int          *order, *wid;
  241. --- 336,342 ----
  242.   int    xSrc, ySrc, width, height, xDst, yDst;
  243.   {
  244.     RegionPtr     blitme, temp;
  245. !   BoxRec       tbox;
  246.     ScreenPtr     pScreen=pGC->pScreen;
  247.     int           count, i, j, t, w, h, Sx, Sy, Dx, Dy;
  248.     int          *order, *wid;
  249. ***************
  250. *** 355,365 ****
  251.   
  252.     if(pSrc->type == DRAWABLE_PIXMAP)
  253.       { 
  254. !       tbox = XNEW(BoxRec);
  255. !       tbox->x1 = tbox->y1 = 0;
  256. !       tbox->x2 = ((PixmapPtr)pSrc)->drawable.width;
  257. !       tbox->y2 = ((PixmapPtr)pSrc)->drawable.height;
  258. !       blitme = (*pScreen->RegionCreate)(tbox, 1);
  259.         Sx = Sy = 0;
  260.       }
  261.     else
  262. --- 355,364 ----
  263.   
  264.     if(pSrc->type == DRAWABLE_PIXMAP)
  265.       { 
  266. !       tbox.x1 = tbox.y1 = 0;
  267. !       tbox.x2 = ((PixmapPtr)pSrc)->drawable.width;
  268. !       tbox.y2 = ((PixmapPtr)pSrc)->drawable.height;
  269. !       blitme = (*pScreen->RegionCreate)(&tbox, 1);
  270.         Sx = Sy = 0;
  271.       }
  272.     else
  273. ***************
  274. *** 377,398 ****
  275.         (*pScreen->TranslateRegion)(blitme, -Sx, -Sy);
  276.       }
  277.     /* intersect with source rectangle */
  278. !   tbox = XNEW(BoxRec);
  279. !   tbox->x1 = xSrc; 
  280. !   tbox->y1 = ySrc;
  281. !   tbox->x2 = tbox->x1 + width; 
  282. !   tbox->y2 = tbox->y1 + height;
  283. !   temp = (*pScreen->RegionCreate)(tbox, 1);
  284.     (*pScreen->Intersect)(blitme, blitme, temp);
  285.     (*pGC->pScreen->RegionDestroy)(temp);
  286.     /* intersect with dest clip */
  287.     if(pDst->type == DRAWABLE_PIXMAP)
  288.       { 
  289. !       tbox = XNEW(BoxRec);
  290. !       tbox->x1 = tbox->y1 = 0;
  291. !       tbox->x2 = ((PixmapPtr)pDst)->drawable.width;
  292. !       tbox->y2 = ((PixmapPtr)pDst)->drawable.height;
  293. !       temp = (*pScreen->RegionCreate)(tbox, 1);
  294.         (*pScreen->TranslateRegion)(temp, -xDst + xSrc, -yDst + ySrc);
  295.         Dx = Dy = 0;
  296.       }
  297. --- 376,395 ----
  298.         (*pScreen->TranslateRegion)(blitme, -Sx, -Sy);
  299.       }
  300.     /* intersect with source rectangle */
  301. !   tbox.x1 = xSrc; 
  302. !   tbox.y1 = ySrc;
  303. !   tbox.x2 = tbox.x1 + width; 
  304. !   tbox.y2 = tbox.y1 + height;
  305. !   temp = (*pScreen->RegionCreate)(&tbox, 1);
  306.     (*pScreen->Intersect)(blitme, blitme, temp);
  307.     (*pGC->pScreen->RegionDestroy)(temp);
  308.     /* intersect with dest clip */
  309.     if(pDst->type == DRAWABLE_PIXMAP)
  310.       { 
  311. !       tbox.x1 = tbox.y1 = 0;
  312. !       tbox.x2 = ((PixmapPtr)pDst)->drawable.width;
  313. !       tbox.y2 = ((PixmapPtr)pDst)->drawable.height;
  314. !       temp = (*pScreen->RegionCreate)(&tbox, 1);
  315.         (*pScreen->TranslateRegion)(temp, -xDst + xSrc, -yDst + ySrc);
  316.         Dx = Dy = 0;
  317.       }
  318. *** 1.1    1992/08/23 17:46:38
  319. --- tigimg.c    1992/08/22 16:04:08
  320. ***************
  321. *** 2,7 ****
  322. --- 2,11 ----
  323.    * More X primitives; primarily those dealing with 
  324.    * blits and images
  325.    *
  326. +  * 10 Aug 92 Rick Schaeffer (ricks@isc-br.isc-br.com)
  327. +  *                    Fixed "memory leak" caused by
  328. +  *                    allocating tbox structures that
  329. +  *                    were never freed.
  330.    * 22 Jun 90 Erich Rickheit KSC  Admitted responsibility
  331.    *  5 Jul 90 Erich Rickheit KSC  Moved in tigCopyArea
  332.    */
  333. ***************
  334. *** 88,94 ****
  335.       RegionPtr      reg, draw;
  336.       GCPRIV        * pPriv;
  337.       long    bm;
  338. !     BoxRec        * tbox;
  339.       WindowPtr      pWin;
  340.       unsigned char    *s;
  341.   
  342. --- 92,98 ----
  343.       RegionPtr      reg, draw;
  344.       GCPRIV        * pPriv;
  345.       long    bm;
  346. !     BoxRec        tbox;
  347.       WindowPtr      pWin;
  348.       unsigned char    *s;
  349.   
  350. ***************
  351. *** 129,140 ****
  352.               *s = swiz[*s];
  353.           host2gsp(pImage, bm, (p * h) / 8, 1);
  354.           /* figger clip region */
  355. !         tbox = XNEW(BoxRec);
  356. !         tbox->x1 = xorg + x; 
  357. !         tbox->y1 = yorg + y;
  358. !         tbox->x2 = tbox->x1 + w; 
  359. !         tbox->y2 = tbox->y1 + h;
  360. !         draw = (*pGC->pScreen->RegionCreate)(tbox, 1);
  361.           (*pGC->pScreen->Intersect)(draw, draw, reg);
  362.           /* blit that mother */
  363.           for (r = 0; r < REGION_NUM_RECTS(draw); r++) { 
  364. --- 133,143 ----
  365.               *s = swiz[*s];
  366.           host2gsp(pImage, bm, (p * h) / 8, 1);
  367.           /* figger clip region */
  368. !         tbox.x1 = xorg + x; 
  369. !         tbox.y1 = yorg + y;
  370. !         tbox.x2 = tbox.x1 + w; 
  371. !         tbox.y2 = tbox.y1 + h;
  372. !         draw = (*pGC->pScreen->RegionCreate)(&tbox, 1);
  373.           (*pGC->pScreen->Intersect)(draw, draw, reg);
  374.           /* blit that mother */
  375.           for (r = 0; r < REGION_NUM_RECTS(draw); r++) { 
  376. ***************
  377. *** 163,174 ****
  378.           }
  379.           set_srcbm(bm, p, w, h, 1);
  380.           /* figger clip region */
  381. !         tbox = XNEW(BoxRec);
  382. !         tbox->x1 = xorg + x; 
  383. !         tbox->y1 = yorg + y;
  384. !         tbox->x2 = tbox->x1 + w; 
  385. !         tbox->y2 = tbox->y1 + h;
  386. !         draw = (*pGC->pScreen->RegionCreate)(tbox, 1);
  387.           (*pGC->pScreen->Intersect)(draw, draw, reg);
  388.           set_fcolor(0); /* clear stuff out */
  389.           for (r = 0; r < REGION_NUM_RECTS(draw); r++)
  390. --- 166,176 ----
  391.           }
  392.           set_srcbm(bm, p, w, h, 1);
  393.           /* figger clip region */
  394. !         tbox.x1 = xorg + x; 
  395. !         tbox.y1 = yorg + y;
  396. !         tbox.x2 = tbox.x1 + w; 
  397. !         tbox.y2 = tbox.y1 + h;
  398. !         draw = (*pGC->pScreen->RegionCreate)(&tbox, 1);
  399.           (*pGC->pScreen->Intersect)(draw, draw, reg);
  400.           set_fcolor(0); /* clear stuff out */
  401.           for (r = 0; r < REGION_NUM_RECTS(draw); r++)
  402. ***************
  403. *** 207,218 ****
  404.                */
  405.           p = (w + 3) & ~3;
  406.           /* figger clip region */
  407. !         tbox = XNEW(BoxRec);
  408. !         tbox->x1 = xorg + x; 
  409. !         tbox->y1 = yorg + y;
  410. !         tbox->x2 = tbox->x1 + w; 
  411. !         tbox->y2 = tbox->y1 + h;
  412. !         draw = (*pGC->pScreen->RegionCreate)(tbox, 1);
  413.           (*pGC->pScreen->Intersect)(draw, draw, reg);
  414.           for (r = 0; r < REGION_NUM_RECTS(draw); r++) {
  415.           HOST2GSPXY(pImage, p, scrtop, scrpitch * 8,
  416. --- 209,219 ----
  417.                */
  418.           p = (w + 3) & ~3;
  419.           /* figger clip region */
  420. !         tbox.x1 = xorg + x; 
  421. !         tbox.y1 = yorg + y;
  422. !         tbox.x2 = tbox.x1 + w; 
  423. !         tbox.y2 = tbox.y1 + h;
  424. !         draw = (*pGC->pScreen->RegionCreate)(&tbox, 1);
  425.           (*pGC->pScreen->Intersect)(draw, draw, reg);
  426.           for (r = 0; r < REGION_NUM_RECTS(draw); r++) {
  427.           HOST2GSPXY(pImage, p, scrtop, scrpitch * 8,
  428. ***************
  429. *** 256,262 ****
  430.       RegionPtr      reg, draw;
  431.       GCPRIV        * pPriv;
  432.       long    bm;
  433. !     BoxRec        * tbox;
  434.       WindowPtr      pWin;
  435.       unsigned char    *s, *t, *bits;
  436.       int    fg, bg;
  437. --- 257,263 ----
  438.       RegionPtr      reg, draw;
  439.       GCPRIV        * pPriv;
  440.       long    bm;
  441. !     BoxRec        tbox;
  442.       WindowPtr      pWin;
  443.       unsigned char    *s, *t, *bits;
  444.       int    fg, bg;
  445. ***************
  446. *** 288,299 ****
  447.       /* send down bits */
  448.       host2gsp(bits, bm, pBitmap->devKind * h, 1);
  449.       /* figger rectangle */
  450. !     tbox = XNEW(BoxRec);
  451. !     tbox->x1 = xs; 
  452. !     tbox->y1 = ys;
  453. !     tbox->x2 = tbox->x1 + w; 
  454. !     tbox->y2 = tbox->y1 + h;
  455. !     draw = (*pGC->pScreen->RegionCreate)(tbox, 1);
  456.       (*pGC->pScreen->Intersect)(draw, draw, reg);
  457.   
  458.       i = (~pGC->planemask) & 0xff;
  459. --- 289,299 ----
  460.       /* send down bits */
  461.       host2gsp(bits, bm, pBitmap->devKind * h, 1);
  462.       /* figger rectangle */
  463. !     tbox.x1 = xs; 
  464. !     tbox.y1 = ys;
  465. !     tbox.x2 = tbox.x1 + w; 
  466. !     tbox.y2 = tbox.y1 + h;
  467. !     draw = (*pGC->pScreen->RegionCreate)(&tbox, 1);
  468.       (*pGC->pScreen->Intersect)(draw, draw, reg);
  469.   
  470.       i = (~pGC->planemask) & 0xff;
  471. ***************
  472. *** 337,343 ****
  473.   int    xSrc, ySrc, width, height, xDst, yDst;
  474.   {
  475.     RegionPtr     blitme, temp;
  476. !   BoxRec       *tbox;
  477.     ScreenPtr     pScreen=pGC->pScreen;
  478.     int           count, i, j, t, w, h, Sx, Sy, Dx, Dy;
  479.     int          *order, *wid;
  480. --- 337,343 ----
  481.   int    xSrc, ySrc, width, height, xDst, yDst;
  482.   {
  483.     RegionPtr     blitme, temp;
  484. !   BoxRec       tbox;
  485.     ScreenPtr     pScreen=pGC->pScreen;
  486.     int           count, i, j, t, w, h, Sx, Sy, Dx, Dy;
  487.     int          *order, *wid;
  488. ***************
  489. *** 356,366 ****
  490.   
  491.     if(pSrc->type == DRAWABLE_PIXMAP)
  492.       { 
  493. !       tbox = XNEW(BoxRec);
  494. !       tbox->x1 = tbox->y1 = 0;
  495. !       tbox->x2 = ((PixmapPtr)pSrc)->drawable.width;
  496. !       tbox->y2 = ((PixmapPtr)pSrc)->drawable.height;
  497. !       blitme = (*pScreen->RegionCreate)(tbox, 1);
  498.         Sx = Sy = 0;
  499.       }
  500.     else
  501. --- 356,365 ----
  502.   
  503.     if(pSrc->type == DRAWABLE_PIXMAP)
  504.       { 
  505. !       tbox.x1 = tbox.y1 = 0;
  506. !       tbox.x2 = ((PixmapPtr)pSrc)->drawable.width;
  507. !       tbox.y2 = ((PixmapPtr)pSrc)->drawable.height;
  508. !       blitme = (*pScreen->RegionCreate)(&tbox, 1);
  509.         Sx = Sy = 0;
  510.       }
  511.     else
  512. ***************
  513. *** 378,399 ****
  514.         (*pScreen->TranslateRegion)(blitme, -Sx, -Sy);
  515.       }
  516.     /* intersect with source rectangle */
  517. !   tbox = XNEW(BoxRec);
  518. !   tbox->x1 = xSrc; 
  519. !   tbox->y1 = ySrc;
  520. !   tbox->x2 = tbox->x1 + width; 
  521. !   tbox->y2 = tbox->y1 + height;
  522. !   temp = (*pScreen->RegionCreate)(tbox, 1);
  523.     (*pScreen->Intersect)(blitme, blitme, temp);
  524.     (*pGC->pScreen->RegionDestroy)(temp);
  525.     /* intersect with dest clip */
  526.     if(pDst->type == DRAWABLE_PIXMAP)
  527.       { 
  528. !       tbox = XNEW(BoxRec);
  529. !       tbox->x1 = tbox->y1 = 0;
  530. !       tbox->x2 = ((PixmapPtr)pDst)->drawable.width;
  531. !       tbox->y2 = ((PixmapPtr)pDst)->drawable.height;
  532. !       temp = (*pScreen->RegionCreate)(tbox, 1);
  533.         (*pScreen->TranslateRegion)(temp, -xDst + xSrc, -yDst + ySrc);
  534.         Dx = Dy = 0;
  535.       }
  536. --- 377,396 ----
  537.         (*pScreen->TranslateRegion)(blitme, -Sx, -Sy);
  538.       }
  539.     /* intersect with source rectangle */
  540. !   tbox.x1 = xSrc; 
  541. !   tbox.y1 = ySrc;
  542. !   tbox.x2 = tbox.x1 + width; 
  543. !   tbox.y2 = tbox.y1 + height;
  544. !   temp = (*pScreen->RegionCreate)(&tbox, 1);
  545.     (*pScreen->Intersect)(blitme, blitme, temp);
  546.     (*pGC->pScreen->RegionDestroy)(temp);
  547.     /* intersect with dest clip */
  548.     if(pDst->type == DRAWABLE_PIXMAP)
  549.       { 
  550. !       tbox.x1 = tbox.y1 = 0;
  551. !       tbox.x2 = ((PixmapPtr)pDst)->drawable.width;
  552. !       tbox.y2 = ((PixmapPtr)pDst)->drawable.height;
  553. !       temp = (*pScreen->RegionCreate)(&tbox, 1);
  554.         (*pScreen->TranslateRegion)(temp, -xDst + xSrc, -yDst + ySrc);
  555.         Dx = Dy = 0;
  556.       }
  557. *** 1.1    1992/08/23 17:46:38
  558. --- tigmem.c    1992/08/22 16:08:48
  559. ***************
  560. *** 1,6 ****
  561. --- 1,9 ----
  562.   /*
  563.    * Routines to manage TIGA on-board memory
  564.    *
  565. +  * 10 Aug 92 Rick Schaeffer (ricks@isc-br.isc-br.com)
  566. +  *            Fixed problem in "tigmemdone" that could
  567. +  *            cause server crash if no blocks ever allocated
  568.    * 16 Jan 92 Keith Gabryelski        Bug fix in tigrequest that
  569.    *                    may cause 0 to be return
  570.    *                    even if memory was allocated.
  571. ***************
  572. *** 67,72 ****
  573. --- 70,77 ----
  574.       BLOCK * cur = blocks, *t;
  575.       unsigned long    loc;
  576.   
  577. +     if (blocks == NULL)
  578. +     return;
  579.       loc = blocks->address;
  580.       while (cur) { 
  581.           t = cur->next;
  582. ***************
  583. *** 75,80 ****
  584. --- 80,86 ----
  585.           Xfree(cur);
  586.           cur = t;
  587.       }
  588. +     blocks = NULL;
  589.       gsp_free(loc);
  590.   }
  591.   
  592. *** 1.1    1992/08/23 17:46:38
  593. --- tigpix.c    1992/08/22 16:22:16
  594. ***************
  595. *** 9,14 ****
  596. --- 9,23 ----
  597.    * of the data. Note that the pitch is padded out to a word boundary.
  598.    * Pixmaps (at this point) can be only 1 or 8 bits deep.
  599.    *
  600. +  * 15 Aug 92 Rick Schaeffer (ricks@isc-br.isc-br.com)
  601. +  *    Fixed problem in tigpixSolidSp and tigpixStipSp which caused
  602. +  *    server crash and/or display anomalies because clipping wasn't
  603. +  *    being done.  tigpixStipSp re-written using technique from
  604. +  *    X11R5 sources by Keith Gabryelski.  NOTE: tigpixTileSp probably
  605. +  *      still needs work.
  606. +  * 5 Jul 92 Rick Schaeffer (ricks@isc-br.isc-br.com)
  607. +  *    Fixed problem in tigDestroyPixmap that caused server crash
  608. +  *    if Pixmap already freed.
  609.    * 22 Jun 90 Erich Rickheit KSC  Admitted responsibility
  610.    * 28 Jun 91 Aaron Orenstein     (Partially) Recoded for X11R4
  611.    */
  612. ***************
  613. *** 100,106 ****
  614.    * if(!IS_VALID_PIXMAP(pPix)) return TRUE;
  615.    */
  616.   
  617. !   if(pPixmap)
  618.       if(--pPixmap->refcnt==0)
  619.         {
  620.       if(pPixmap->devPrivate.ptr) Xfree(pPixmap->devPrivate.ptr);
  621. --- 109,115 ----
  622.    * if(!IS_VALID_PIXMAP(pPix)) return TRUE;
  623.    */
  624.   
  625. !   if(pPixmap) {
  626.       if(--pPixmap->refcnt==0)
  627.         {
  628.       if(pPixmap->devPrivate.ptr) Xfree(pPixmap->devPrivate.ptr);
  629. ***************
  630. *** 108,113 ****
  631. --- 117,123 ----
  632.       Xfree(pPixmap);
  633.       return TRUE;
  634.         }
  635. +     }
  636.   
  637.     UNTRACE("tigDestroyPixmap");
  638.     return TRUE;
  639. ***************
  640. *** 257,277 ****
  641.     UNTRACE("tigpixSolidSp");
  642.   }
  643.   #else
  644. ! void tigpixSolidSp(pPixmap, pGC, npt, ppt, pwidth, fSorted)
  645. !     PixmapPtr   pPixmap;
  646. !     GCPtr    pGC;
  647. !     register int          npt;        /* number of spans to fill */
  648. !     register DDXPointPtr  ppt;        /* pointer to list of start points */
  649. !     register int         *pwidth;    /* pointer to list of n widths */
  650. !     int     fSorted;
  651.   {
  652.     register int  *dstBase;
  653.     register int   color;
  654.     register int   alu;
  655.     int            pitch; /* pitch in Longwords */
  656.   
  657.     TRACE("tigpixSolidSp");
  658.   
  659.     dstBase=(int *)pPixmap->devPrivate.ptr;
  660.     color=LongByteRepeater(pGC->fgPixel&0xFF);
  661.     alu=pGC->alu;
  662. --- 267,310 ----
  663.     UNTRACE("tigpixSolidSp");
  664.   }
  665.   #else
  666. ! void tigpixSolidSp(pPixmap, pGC, nptInit, pptInit, pwidthInit, fSorted)
  667. ! PixmapPtr pPixmap;
  668. ! GCPtr pGC;
  669. ! int nptInit;        /* number of spans to fill */
  670. ! DDXPointPtr  pptInit;        /* pointer to list of start points */
  671. ! int *pwidthInit;    /* pointer to list of n widths */
  672. ! int fSorted;
  673.   {
  674.     register int  *dstBase;
  675.     register int   color;
  676.     register int   alu;
  677.     int            pitch; /* pitch in Longwords */
  678. +   register int   npt;
  679. +   register DDXPointPtr ppt;
  680. +   register int   *pwidth;
  681. +   int            *pwidthFree;    /* copies of the pointers to free */
  682. +   DDXPointPtr    pptFree;
  683. +   GCPRIV         *pPriv;
  684.   
  685.     TRACE("tigpixSolidSp");
  686.   
  687. +   pPriv=(GCPRIV *)pGC->devPrivates[tigGCPrivateIndex].ptr;
  688. +   npt=nptInit*miFindMaxBand(pPriv->clip);
  689. +   pwidthFree=(int *)ALLOCATE_LOCAL(npt*sizeof(int));
  690. +   pptFree=(DDXPointPtr)ALLOCATE_LOCAL(npt*sizeof(DDXPointRec));
  691. +   if(!(pptFree&&pwidthFree))
  692. +     {
  693. +       if(pptFree) DEALLOCATE_LOCAL(pptFree);
  694. +       if(pwidthFree) DEALLOCATE_LOCAL(pwidthFree);
  695. +         return;
  696. +     }
  697. +   pwidth=pwidthFree;
  698. +   ppt=pptFree;
  699. +   
  700. +   npt=miClipSpans(pPriv->clip,pptInit,pwidthInit,nptInit,ppt,pwidth,fSorted);
  701.     dstBase=(int *)pPixmap->devPrivate.ptr;
  702.     color=LongByteRepeater(pGC->fgPixel&0xFF);
  703.     alu=pGC->alu;
  704. ***************
  705. *** 374,379 ****
  706. --- 407,572 ----
  707.   /*
  708.    * Draws stippled spans into the pixmap
  709.    */
  710. + void
  711. + tigpixStipSp(pPixmap, pGC, nptInit, pptInit, pwidthInit, fSorted)
  712. + PixmapPtr pPixmap;
  713. + GCPtr pGC;
  714. + int nptInit;
  715. + DDXPointPtr pptInit;
  716. + int *pwidthInit;
  717. + int fSorted;
  718. + {
  719. +     PixmapPtr               tile;
  720. +     unsigned char          *srcBase;
  721. +     unsigned char          *dstBase;
  722. +     register unsigned char  color;
  723. +     register int            alu;
  724. +     register int   npt;
  725. +     register DDXPointPtr ppt;
  726. +     register int   *pwidth;
  727. +     int            *pwidthFree;    /* copies of the pointers to free */
  728. +     DDXPointPtr    pptFree;
  729. +     GCPRIV         *pPriv;
  730. +   
  731. +     pPriv=(GCPRIV *)pGC->devPrivates[tigGCPrivateIndex].ptr;
  732. +     npt=nptInit*miFindMaxBand(pPriv->clip);
  733. +     pwidthFree=(int *)ALLOCATE_LOCAL(npt*sizeof(int));
  734. +     pptFree=(DDXPointPtr)ALLOCATE_LOCAL(npt*sizeof(DDXPointRec));
  735. +     if(!(pptFree&&pwidthFree))
  736. +       {
  737. +         if(pptFree) DEALLOCATE_LOCAL(pptFree);
  738. +         if(pwidthFree) DEALLOCATE_LOCAL(pwidthFree);
  739. +         return;
  740. +       }
  741. +     pwidth=pwidthFree;
  742. +     ppt=pptFree;
  743. +   
  744. +     npt=miClipSpans(pPriv->clip,pptInit,pwidthInit,nptInit,ppt,pwidth,fSorted);
  745. +     tile = pGC->stipple;
  746. +     srcBase = (unsigned char *)tile->devPrivate.ptr;
  747. +     dstBase = (unsigned char *)pPixmap->devPrivate.ptr;
  748. +   
  749. +     color = pGC->fgPixel;
  750. +     alu = pGC->alu;
  751. +     if (pPixmap->drawable.depth == 8)
  752. +     {
  753. +     while (npt--)
  754. +     {
  755. +         register unsigned char *dst;
  756. +         register unsigned char *src;
  757. +         int                     sbyte, sbit, srcX;
  758. +         int                     x, x0, x1;
  759. +   
  760. +         x0 = ppt->x;
  761. +         x1 = x0 + *pwidth;
  762. +         if (x0 < x1)
  763. +         {
  764. +         dst = dstBase + (ppt->y * pPixmap->devKind);
  765. +         src = srcBase +
  766. +             (((ppt->y-pGC->patOrg.y) % ((int)tile->drawable.height)) *
  767. +              tile->devKind);
  768. +         srcX = (x0 - pGC->patOrg.x) % (int)(tile->drawable.width);
  769. +         sbyte = srcX / 8; 
  770. +         sbit = 0x80 >> (srcX&7);
  771. +         for (x = x0; x < x1; x++)
  772. +         { 
  773. +             if (sbit & src[sbyte]) DoRop(dst[x], alu, color, dst[x]);
  774. +             if (++srcX == (int)(tile->drawable.width))
  775. +             { 
  776. +             sbit = 0x80;
  777. +             srcX = sbyte = 0;
  778. +             }
  779. +             else if(!(sbit >>= 1))
  780. +             { 
  781. +             sbit = 0x80;
  782. +             sbyte++;
  783. +             }
  784. +         }
  785. +         }
  786. +         ppt++;
  787. +         pwidth++;
  788. +     }
  789. +     }
  790. +     else                /* 1 bit... */
  791. +     {
  792. +     if (color)
  793. +         color = 0xFF;
  794. +     while(npt--)
  795. +     {
  796. +         register unsigned char *dst;
  797. +         int                     dbyte, dbit;
  798. +         register unsigned char *src;
  799. +         int                     sbyte, sbit, srcX;
  800. +         int                     x, x0, x1;
  801. +         register unsigned char  dstFunc;
  802. +         x0 = ppt->x;
  803. +         x1 = x0 + *pwidth;
  804. +         if (x0 < x1)
  805. +         {
  806. +         dst = dstBase + (ppt->y * pPixmap->devKind);
  807. +         dbyte = x0 / 8;
  808. +         dbit = 0x80 >> (x0&7);
  809. +         DoRop(dstFunc, alu, color, dst[dbyte]);
  810. +         src = srcBase +
  811. +             (((ppt->y-pGC->patOrg.y) % ((int)tile->drawable.height)) *
  812. +              tile->devKind);
  813. +         srcX = (x0 - pGC->patOrg.x) % ((int)tile->drawable.width);
  814. +         sbyte = srcX / 8;
  815. +         sbit = 0x80 >> (srcX&7);
  816. +         for (x = x0; x < x1; x++)
  817. +         {
  818. +             if (sbit & src[sbyte])
  819. +             if(dbit & dstFunc)
  820. +                 dst[dbyte] |= dbit;
  821. +             else
  822. +                 dst[dbyte] &= ~dbit;
  823. +             if (++srcX == ((int)tile->drawable.width))
  824. +             {
  825. +             sbit = 0x80;
  826. +             srcX = sbyte = 0;
  827. +             }
  828. +             else if (!(sbit >>= 1))
  829. +             {
  830. +             sbit = 0x80;
  831. +             sbyte++;
  832. +             }
  833. +             if (!(dbit >>= 1))
  834. +             {
  835. +             dbit = 0x80;
  836. +             dbyte++;
  837. +             DoRop(dstFunc, alu, color, dst[dbyte]);
  838. +             }
  839. +         }
  840. +         }
  841. +         ppt++;
  842. +         pwidth++;
  843. +     }
  844. +     }
  845. +     DEALLOCATE_LOCAL(pptFree);
  846. +     DEALLOCATE_LOCAL(pwidthFree);
  847. + }
  848. + #if 0 /* Rick Schaeffer: Old code...trying new routine above */
  849. + /*
  850. +  * Draws stippled spans into the pixmap
  851. +  */
  852.   void tigpixStipSp(pDraw, pGC, count, pts, width, sorted)
  853.        DrawablePtr    pDraw;
  854.        GCPtr          pGC;
  855. ***************
  856. *** 486,493 ****
  857.       }
  858.     UNTRACE("tigpixStipSp");
  859.   }
  860.   
  861.   /*
  862.    * Draws tiled spans into the pixmap
  863. --- 679,685 ----
  864.       }
  865.     UNTRACE("tigpixStipSp");
  866.   }
  867. ! #endif
  868.   
  869.   /*
  870.    * Draws tiled spans into the pixmap
  871. ***************
  872. *** 516,521 ****
  873. --- 708,718 ----
  874.       /*dest = (unsigned char *)pix->devPrivate;*/
  875.       dest = (unsigned char *)pix->devPrivate.ptr; /* RS */
  876.       /*tile = pGC->tile;*/
  877. +     if (pGC->tileIsPixel) {
  878. +         return;
  879. +     }
  880.       tile = pGC->tile.pixmap; /* RS */
  881.       /*src = (unsigned char *)tile->devPrivate;*/
  882.       src = (unsigned char *)tile->devPrivate.ptr; /* RS */
  883. *** 1.1    1992/08/23 17:46:38
  884. --- tigprim.c    1992/08/22 16:26:40
  885. ***************
  886. *** 1,6 ****
  887. --- 1,12 ----
  888.   /*
  889.    * X primitives; Trying to make best use of TIGA primitives
  890.    *
  891. +  * 10 Aug 92 Rick Schaeffer (ricks@isc-br.isc-br.com)
  892. +  *    Fixed "memory leak" problem caused by allocation of tbox
  893. +  *    structure that were never freed.
  894. +  * 20 Jul 92 Rick Schaeffer (ricks@isc-br.isc-br.com)
  895. +  *    Fixed problem that caused pattern fills to work improperly.  The
  896. +  *    code wasn't waiting for the tiga to finish the fill operation.
  897.    * 22 Jun 90 Erich Rickheit KSC  Admitted responsibility
  898.    *  5 Jul 90 Erich Rickheit KSC  Moved tigCopyArea to tigimg.c
  899.    * 10 Jul 90 Erich Rickheit KSC  Added tigDashLine,tigDashSegment
  900. ***************
  901. *** 223,229 ****
  902.       int    i, j, r, xorg, yorg;
  903.       RegionPtr      reg, draw;
  904.       GCPRIV        * pPriv;
  905. !     BoxRec        * tbox;
  906.   
  907.       TRACE("tigSolidRect");
  908.       xorg=pWin->drawable.x; /* used to be ->origin.x AKO */
  909. --- 229,235 ----
  910.       int    i, j, r, xorg, yorg;
  911.       RegionPtr      reg, draw;
  912.       GCPRIV        * pPriv;
  913. !     BoxRec        tbox;
  914.   
  915.       TRACE("tigSolidRect");
  916.       xorg=pWin->drawable.x; /* used to be ->origin.x AKO */
  917. ***************
  918. *** 240,251 ****
  919.       set_colors(pGC->fgPixel, pGC->bgPixel);
  920.   
  921.       for (i = 0; i < count; i++) {
  922. !         tbox = XNEW(BoxRec);
  923. !         tbox->x1 = xorg + rects[i].x;
  924. !         tbox->y1 = yorg + rects[i].y;
  925. !         tbox->x2 = tbox->x1 + rects[i].width;
  926. !         tbox->y2 = tbox->y1 + rects[i].height;
  927. !         draw = (*pGC->pScreen->RegionCreate)(tbox, 1);
  928.           (*pGC->pScreen->Intersect)(draw, draw, reg);
  929.           for (r = 0; r < REGION_NUM_RECTS(draw); r++) {
  930.               fill_rect(REGION_RECTS(draw)[r].x2 - REGION_RECTS(draw)[r].x1,
  931. --- 246,256 ----
  932.       set_colors(pGC->fgPixel, pGC->bgPixel);
  933.   
  934.       for (i = 0; i < count; i++) {
  935. !         tbox.x1 = xorg + rects[i].x;
  936. !         tbox.y1 = yorg + rects[i].y;
  937. !         tbox.x2 = tbox.x1 + rects[i].width;
  938. !         tbox.y2 = tbox.y1 + rects[i].height;
  939. !         draw = (*pGC->pScreen->RegionCreate)(&tbox, 1);
  940.           (*pGC->pScreen->Intersect)(draw, draw, reg);
  941.           for (r = 0; r < REGION_NUM_RECTS(draw); r++) {
  942.               fill_rect(REGION_RECTS(draw)[r].x2 - REGION_RECTS(draw)[r].x1,
  943. ***************
  944. *** 341,346 ****
  945. --- 346,352 ----
  946.               REGION_RECTS(reg)[r].x1, REGION_RECTS(reg)[r].y1);
  947.           patnfill_polygon(count, (unsigned short *)plist);
  948.       }
  949. +     synchronize();
  950.       set_clip_rect(scrwidth,scrheight, 0, 0);
  951.       UNTRACE("tigStipFillPoly");
  952.   }
  953. ***************
  954. *** 364,370 ****
  955.       int    i, j, r, xorg, yorg;
  956.       RegionPtr      reg, draw;
  957.       GCPRIV        * pPriv;
  958. !     BoxRec        * tbox;
  959.   
  960.       TRACE("tigStipRect");
  961.       xorg=pWin->drawable.x; /* used to be ->origin.x AKO */
  962. --- 370,376 ----
  963.       int    i, j, r, xorg, yorg;
  964.       RegionPtr      reg, draw;
  965.       GCPRIV        * pPriv;
  966. !     BoxRec        tbox;
  967.   
  968.       TRACE("tigStipRect");
  969.       xorg=pWin->drawable.x; /* used to be ->origin.x AKO */
  970. ***************
  971. *** 384,395 ****
  972.       set_colors(pGC->fgPixel, pGC->bgPixel);
  973.   
  974.       for (i = 0; i < count; i++) { 
  975. !         tbox = XNEW(BoxRec);
  976. !         tbox->x1 = xorg + rects[i].x;
  977. !         tbox->y1 = yorg + rects[i].y;
  978. !         tbox->x2 = tbox->x1 + rects[i].width;
  979. !         tbox->y2 = tbox->y1 + rects[i].height;
  980. !         draw = (*pGC->pScreen->RegionCreate)(tbox, 1);
  981.           (*pGC->pScreen->Intersect)(draw, draw, reg);
  982.           for (r = 0; r < REGION_NUM_RECTS(draw); r++) {
  983.               patnfill_rect(REGION_RECTS(draw)[r].x2 - REGION_RECTS(draw)[r].x1,
  984. --- 390,400 ----
  985.       set_colors(pGC->fgPixel, pGC->bgPixel);
  986.   
  987.       for (i = 0; i < count; i++) { 
  988. !         tbox.x1 = xorg + rects[i].x;
  989. !         tbox.y1 = yorg + rects[i].y;
  990. !         tbox.x2 = tbox.x1 + rects[i].width;
  991. !         tbox.y2 = tbox.y1 + rects[i].height;
  992. !         draw = (*pGC->pScreen->RegionCreate)(&tbox, 1);
  993.           (*pGC->pScreen->Intersect)(draw, draw, reg);
  994.           for (r = 0; r < REGION_NUM_RECTS(draw); r++) {
  995.               patnfill_rect(REGION_RECTS(draw)[r].x2 - REGION_RECTS(draw)[r].x1,
  996. ***************
  997. *** 398,403 ****
  998. --- 403,409 ----
  999.           }
  1000.           (*pGC->pScreen->RegionDestroy)(draw);
  1001.       }
  1002. +     synchronize();
  1003.       UNTRACE("tigStipRect");
  1004.   }
  1005.   
  1006. *** 1.1    1992/08/23 17:46:38
  1007. --- tigscrinit.c    1992/08/23 17:52:25
  1008. ***************
  1009. *** 9,14 ****
  1010. --- 9,19 ----
  1011.   ** Written at the University of Massachusetts at Lowell, Lowell, MA.
  1012.   **
  1013.   */
  1014. + /*
  1015. +  * 20 Jul 92 Rick Schaeffer (ricks@isc-br.isc-br.com)
  1016. +  *    Added code to release tiga memory allocated for cursors and
  1017. +  *  patterns.
  1018. + */
  1019.   #include "../amix.h"
  1020.   #include "resource.h"
  1021.   #include "servermd.h"        /* For PixmapBytePad */
  1022. ***************
  1023. *** 35,40 ****
  1024. --- 40,47 ----
  1025.   int tigWindowPrivateIndex;
  1026.   int tigGeneration=0;
  1027.   
  1028. + extern unsigned long tigpatmem;
  1029.   #ifdef LOWELLTIGA
  1030.   char *tigagm = "/usr/X/lib/tigagm.coff";
  1031.   char *osc1="36.000MHZ";
  1032. ***************
  1033. *** 291,302 ****
  1034.       return TRUE;
  1035.   }
  1036.   
  1037.   Bool tigCloseScreen(index, pScreen)
  1038.        int index;
  1039.        ScreenPtr pScreen;
  1040.   {
  1041. !   return TRUE;
  1042. ! }
  1043.   
  1044.   
  1045. --- 298,314 ----
  1046.       return TRUE;
  1047.   }
  1048.   
  1049.   Bool tigCloseScreen(index, pScreen)
  1050.        int index;
  1051.        ScreenPtr pScreen;
  1052.   {
  1053. !     TRACE("tigCloseScreen");
  1054.   
  1055. +     if (tigpatmem != NULL)
  1056. +         tigfree(tigpatmem);
  1057.   
  1058. +     tigmemdone();
  1059. +     UNTRACE("tigCloseScreen");
  1060. +     return TRUE;
  1061. + }
  1062. *** 1.1    1992/08/23 17:46:38
  1063. --- tigspan.c    1992/08/14 14:50:23
  1064. ***************
  1065. *** 223,228 ****
  1066. --- 223,230 ----
  1067.       i |= i << 8 | i << 16 | i << 24;
  1068.       set_pmask(i);
  1069.       set_colors(pGC->fgPixel, pGC->bgPixel);
  1070. +     tigSetstip(pGC->stipple, pDraw->x + pGC->patOrg.x,
  1071. +            pDraw->y + pGC->patOrg.y);
  1072.       for (r = 0; r < REGION_NUM_RECTS(reg); r++) {
  1073.           if ((pts[0].y >= REGION_RECTS(reg)[r].y2) || (pts[count-1].y
  1074.            < REGION_RECTS(reg)[r].y1))
  1075. ***************
  1076. *** 241,246 ****
  1077. --- 243,249 ----
  1078.           if (i < count) 
  1079.               be = i;
  1080.       }
  1081. +  synchronize();
  1082.    UNTRACE("tigFillStipSpans");
  1083.   }
  1084.   
  1085. ***************
  1086. *** 454,460 ****
  1087.         porgy=pPixmap->drawable.y+pGC->patOrg.y;
  1088.       }
  1089.   
  1090. !   if(!(pTile=pGC->tile.pixmap)) return;
  1091.     tBase=pTile->devPrivate.ptr;
  1092.     tWidth=pTile->drawable.width;
  1093.     tHeight=pTile->drawable.height;
  1094. --- 457,463 ----
  1095.         porgy=pPixmap->drawable.y+pGC->patOrg.y;
  1096.       }
  1097.   
  1098. !   if(pGC->tileIsPixel || !(pTile=pGC->tile.pixmap)) return;
  1099.     tBase=pTile->devPrivate.ptr;
  1100.     tWidth=pTile->drawable.width;
  1101.     tHeight=pTile->drawable.height;
  1102. ***************
  1103. *** 544,550 ****
  1104.       }
  1105.   
  1106.     get_colors(&ofc, &obc); /* WHY??? - AKO */
  1107. !   if(!(tile=pGC->tile.pixmap)) return; /* RS */
  1108.   
  1109.     data=(unsigned char *)tile->devPrivate.ptr; /* RS */
  1110.   
  1111. --- 547,553 ----
  1112.       }
  1113.   
  1114.     get_colors(&ofc, &obc); /* WHY??? - AKO */
  1115. !   if(pGC->tileIsPixel || !(tile=pGC->tile.pixmap)) return; /* RS */
  1116.   
  1117.     data=(unsigned char *)tile->devPrivate.ptr; /* RS */
  1118.   
  1119. *** 1.1    1992/08/23 17:46:38
  1120. --- tigtext.c    1992/08/22 21:10:20
  1121. ***************
  1122. *** 1,6 ****
  1123. --- 1,12 ----
  1124.   /*
  1125.    * Stuff to manipulate TIGA fonts and text
  1126.    *
  1127. +  * 10 Aug 92 Rick Schaeffer (ricks@isc-br.isc-br.com)
  1128. +  *    Fixed "memory leak" problem caused by allocation of tbox
  1129. +  *    structure that were never freed.
  1130. +  * 1 Jun 92 Rick Schaeffer (ricks@isc-br.isc-br.com)
  1131. +  *    Fix bug in which shifts were backwards causing problems with
  1132. +  *    large fonts.
  1133.    * 22 Jun 90 Erich Rickheit KSC  Admitted responsibility
  1134.    */
  1135.   
  1136. ***************
  1137. *** 215,230 ****
  1138.                   instfont = cur->next;
  1139.               Xfree(cur);
  1140.           }
  1141. !     Xfree(finf->patn);
  1142. !     Xfree(finf->locs);
  1143. !     Xfree(finf->owtab);
  1144. !     Xfree(finf);
  1145.       UNTRACE("tigUnrealizeFont");
  1146.       return TRUE;
  1147.   }
  1148.   
  1149.   
  1150. ! static short    tem[37];
  1151.   
  1152.   /*
  1153.    * We only have enough memory on the board to keep a few fonts down
  1154. --- 221,238 ----
  1155.                   instfont = cur->next;
  1156.               Xfree(cur);
  1157.           }
  1158. !     if (finf) {
  1159. !       Xfree(finf->patn);
  1160. !       Xfree(finf->locs);
  1161. !       Xfree(finf->owtab);
  1162. !       Xfree(finf);
  1163. !     }
  1164.       UNTRACE("tigUnrealizeFont");
  1165.       return TRUE;
  1166.   }
  1167.   
  1168.   
  1169. ! static unsigned short    tem[37];
  1170.   
  1171.   /*
  1172.    * We only have enough memory on the board to keep a few fonts down
  1173. ***************
  1174. *** 247,252 ****
  1175. --- 255,261 ----
  1176.           if (pFont == cur->fnp) { 
  1177.               if (cur->loc != NULL) { 
  1178.                   select_font(cur->fid);
  1179. +                 UNTRACE("tigFontLoad.0");
  1180.                   return;
  1181.               } else
  1182.                { 
  1183. ***************
  1184. *** 286,292 ****
  1185.          */
  1186.       tem[0] = finf->tigfont.magic;
  1187.       tem[1] = 0xffff & finf->tigfont.length;
  1188. !     tem[2] = (finf->tigfont.length) << 16;
  1189.       tem[3] = 0x4142; 
  1190.       tem[4] = 0;
  1191.       tem[19] = finf->tigfont.first;
  1192. --- 295,301 ----
  1193.          */
  1194.       tem[0] = finf->tigfont.magic;
  1195.       tem[1] = 0xffff & finf->tigfont.length;
  1196. !     tem[2] = (finf->tigfont.length) >> 16;
  1197.       tem[3] = 0x4142; 
  1198.       tem[4] = 0;
  1199.       tem[19] = finf->tigfont.first;
  1200. ***************
  1201. *** 300,312 ****
  1202.       tem[27] = finf->tigfont.descent;
  1203.       tem[28] = finf->tigfont.leading;
  1204.       tem[29] = 0xffff & finf->tigfont.rowpitch;
  1205. !     tem[30] = (finf->tigfont.rowpitch) << 16;
  1206.       tem[31] = 0xffff & finf->tigfont.oPatnTbl;
  1207. !     tem[32] = (finf->tigfont.oPatnTbl) << 16;
  1208.       tem[33] = 0xffff & finf->tigfont.oLocTbl;
  1209. !     tem[34] = (finf->tigfont.oLocTbl) << 16;
  1210.       tem[35] = 0xffff & finf->tigfont.oOwTbl;
  1211. !     tem[36] = (finf->tigfont.oOwTbl) << 16;
  1212.       host2gsp(tem, cur->loc, sizeof(short)*37, 0);
  1213.       pt = finf->tigfont.rowpitch;
  1214.       host2gsp(finf->patn, cur->loc + finf->tigfont.oPatnTbl,
  1215. --- 309,321 ----
  1216.       tem[27] = finf->tigfont.descent;
  1217.       tem[28] = finf->tigfont.leading;
  1218.       tem[29] = 0xffff & finf->tigfont.rowpitch;
  1219. !     tem[30] = (finf->tigfont.rowpitch) >> 16;
  1220.       tem[31] = 0xffff & finf->tigfont.oPatnTbl;
  1221. !     tem[32] = (finf->tigfont.oPatnTbl) >> 16;
  1222.       tem[33] = 0xffff & finf->tigfont.oLocTbl;
  1223. !     tem[34] = (finf->tigfont.oLocTbl) >> 16;
  1224.       tem[35] = 0xffff & finf->tigfont.oOwTbl;
  1225. !     tem[36] = (finf->tigfont.oOwTbl) >> 16;
  1226.       host2gsp(tem, cur->loc, sizeof(short)*37, 0);
  1227.       pt = finf->tigfont.rowpitch;
  1228.       host2gsp(finf->patn, cur->loc + finf->tigfont.oPatnTbl,
  1229. ***************
  1230. *** 319,325 ****
  1231.           return;
  1232.       }
  1233.       select_font(cur->fid);
  1234. !     UNTRACE("tigFontLoad");
  1235.   }
  1236.   
  1237.   #define DRAW_X 0
  1238. --- 328,334 ----
  1239.           return;
  1240.       }
  1241.       select_font(cur->fid);
  1242. !     UNTRACE("tigFontLoad.1");
  1243.   }
  1244.   
  1245.   #define DRAW_X 0
  1246. ***************
  1247. *** 340,346 ****
  1248.     RegionPtr      reg, draw;
  1249.     unsigned char *text;
  1250.     ExtentInfoRec  inf;
  1251. !   BoxRec        *tbox;
  1252.     int           start, asc, des, tw, c, xw, yw;
  1253.     FONTPRIV      *finf;
  1254.   
  1255. --- 349,355 ----
  1256.     RegionPtr      reg, draw;
  1257.     unsigned char *text;
  1258.     ExtentInfoRec  inf;
  1259. !   BoxRec        tbox;
  1260.     int           start, asc, des, tw, c, xw, yw;
  1261.     FONTPRIV      *finf;
  1262.   
  1263. ***************
  1264. *** 349,354 ****
  1265. --- 358,364 ----
  1266.     if(pGC->font->devPriv[pGC->pScreen->myNum] == NULL)
  1267.       { 
  1268.         miImageText8(pWin, pGC, x, y, count, itext);
  1269. +       UNTRACE("tigImageText8.0");
  1270.         return;
  1271.       }
  1272.     
  1273. ***************
  1274. *** 372,388 ****
  1275.     asc=pGC->font->pFI->maxbounds.metrics.ascent;
  1276.     des=pGC->font->pFI->maxbounds.metrics.descent;
  1277.   
  1278. !   tbox=XNEW(BoxRec);
  1279. !   tbox->x1=xw=x+xorg; 
  1280. !   tbox->x2=tbox->x1+tw;
  1281. !   tbox->y1=yw=y+yorg-asc; 
  1282. !   tbox->y2=y+yorg+des;
  1283.   
  1284. !   j=(*pGC->pScreen->RectIn)(reg, tbox);
  1285.   
  1286.     if(j==rgnOUT) /* trivial reject */
  1287.       { 
  1288.         Xfree(text);
  1289.         return;
  1290.       }
  1291.   
  1292. --- 382,398 ----
  1293.     asc=pGC->font->pFI->maxbounds.metrics.ascent;
  1294.     des=pGC->font->pFI->maxbounds.metrics.descent;
  1295.   
  1296. !   tbox.x1=xw=x+xorg; 
  1297. !   tbox.x2=tbox.x1+tw;
  1298. !   tbox.y1=yw=y+yorg-asc; 
  1299. !   tbox.y2=y+yorg+des;
  1300.   
  1301. !   j=(*pGC->pScreen->RectIn)(reg, &tbox);
  1302.   
  1303.     if(j==rgnOUT) /* trivial reject */
  1304.       { 
  1305.         Xfree(text);
  1306. +       UNTRACE("tigImageText8.1");
  1307.         return;
  1308.       }
  1309.   
  1310. ***************
  1311. *** 393,405 ****
  1312.         set_colors(pGC->fgPixel, pGC->bgPixel);
  1313.         text_out(x+xorg, y+yorg-asc, text);
  1314.         Xfree(text);
  1315.         return;
  1316.       }
  1317.   
  1318.     /* intersect rectangles */
  1319. !   draw=(*pGC->pScreen->RegionCreate)(tbox, 1);
  1320.     (*pGC->pScreen->Intersect)(draw, draw, reg);
  1321.   
  1322.     set_ppop(xftotf[pGC->alu]);
  1323.     set_pmask(LongByteRepeater((~pGC->planemask)&0xFF));
  1324.     set_colors(pGC->fgPixel, pGC->bgPixel);
  1325. --- 403,417 ----
  1326.         set_colors(pGC->fgPixel, pGC->bgPixel);
  1327.         text_out(x+xorg, y+yorg-asc, text);
  1328.         Xfree(text);
  1329. +       UNTRACE("tigImageText8.2");
  1330.         return;
  1331.       }
  1332.   
  1333.     /* intersect rectangles */
  1334. !   draw=(*pGC->pScreen->RegionCreate)(&tbox, 1);
  1335.     (*pGC->pScreen->Intersect)(draw, draw, reg);
  1336.   
  1337. + #if 1
  1338.     set_ppop(xftotf[pGC->alu]);
  1339.     set_pmask(LongByteRepeater((~pGC->planemask)&0xFF));
  1340.     set_colors(pGC->fgPixel, pGC->bgPixel);
  1341. ***************
  1342. *** 415,443 ****
  1343.         text_out(x+xorg,y+yorg-asc,text);
  1344.       }
  1345.     set_clip_rect(scrwidth,scrheight,0,0);
  1346.     /*
  1347.      * Text needs to be clipped. We do it by drawing the text 
  1348.      * offscreen and then blitting in the visible chunks (all
  1349.      * because hardware clipping won't do text!)
  1350. !    *  set_pmask(0); 
  1351. !    *  set_ppop(0);
  1352. !    *  set_colors(pGC->fgPixel, pGC->bgPixel);
  1353. !    *  text_out(DRAW_X,DRAW_Y, text);
  1354. !    *
  1355. !    *  for(r=0; r<REGION_NUM_RECTS(draw); r++)
  1356. !    *    bitblt(REGION_RECTS(draw)[r].x2-REGION_RECTS(draw)[r].x1,
  1357. !    *       REGION_RECTS(draw)[r].y2-REGION_RECTS(draw)[r].y1,
  1358. !    *       REGION_RECTS(draw)[r].x1-xw+DRAW_X,
  1359. !    *       REGION_RECTS(draw)[r].y1-yw+DRAW_Y,
  1360. !    *       REGION_RECTS(draw)[r].x1,
  1361. !    *       REGION_RECTS(draw)[r].y1);
  1362. !    */
  1363.     
  1364.     Xfree(text);
  1365.     (*pGC->pScreen->RegionDestroy)(draw);
  1366.   
  1367. !   UNTRACE("tigImageText");
  1368.     return;
  1369.   }
  1370.   
  1371. --- 427,456 ----
  1372.         text_out(x+xorg,y+yorg-asc,text);
  1373.       }
  1374.     set_clip_rect(scrwidth,scrheight,0,0);
  1375. ! #else
  1376.     /*
  1377.      * Text needs to be clipped. We do it by drawing the text 
  1378.      * offscreen and then blitting in the visible chunks (all
  1379.      * because hardware clipping won't do text!)
  1380. !   */
  1381. !       set_pmask(0); 
  1382. !       set_ppop(0);
  1383. !       set_colors(pGC->fgPixel, pGC->bgPixel);
  1384. !       text_out(DRAW_X,DRAW_Y, text);
  1385. !     
  1386. !       for(r=0; r<REGION_NUM_RECTS(draw); r++)
  1387. !         bitblt(REGION_RECTS(draw)[r].x2-REGION_RECTS(draw)[r].x1,
  1388. !            REGION_RECTS(draw)[r].y2-REGION_RECTS(draw)[r].y1,
  1389. !            REGION_RECTS(draw)[r].x1-xw+DRAW_X,
  1390. !            REGION_RECTS(draw)[r].y1-yw+DRAW_Y,
  1391. !            REGION_RECTS(draw)[r].x1,
  1392. !            REGION_RECTS(draw)[r].y1);
  1393. ! #endif
  1394.     
  1395.     Xfree(text);
  1396.     (*pGC->pScreen->RegionDestroy)(draw);
  1397.   
  1398. !   UNTRACE("tigImageText8.3");
  1399.     return;
  1400.   }
  1401.   
  1402. ***************
  1403. *** 460,467 ****
  1404.     RegionPtr      reg, draw;
  1405.     unsigned char    *text;
  1406.     ExtentInfoRec  inf;
  1407. !   BoxRec        * tbox;
  1408. !   int    start, fg, asc, des, tw, xw, yw;
  1409.     
  1410.     TRACE("tigPolyText8");
  1411.   
  1412. --- 473,480 ----
  1413.     RegionPtr      reg, draw;
  1414.     unsigned char    *text;
  1415.     ExtentInfoRec  inf;
  1416. !   BoxRec        tbox;
  1417. !   int   start, fg, asc, des, tw, xw, yw;
  1418.     
  1419.     TRACE("tigPolyText8");
  1420.   
  1421. ***************
  1422. *** 494,506 ****
  1423.     asc=pGC->font->pFI->maxbounds.metrics.ascent;
  1424.     des=pGC->font->pFI->maxbounds.metrics.descent;
  1425.   
  1426. !   tbox=XNEW(BoxRec);
  1427. !   tbox->x1=xw=x+xorg; 
  1428. !   tbox->x2=tbox->x1+tw;
  1429. !   tbox->y1=yw=y+yorg-asc; 
  1430. !   tbox->y2=y+yorg+des;
  1431.     
  1432. !   j=(*pGC->pScreen->RectIn)(reg, tbox);
  1433.   
  1434.     if(j==rgnOUT) /* trivial reject */
  1435.       { 
  1436. --- 507,518 ----
  1437.     asc=pGC->font->pFI->maxbounds.metrics.ascent;
  1438.     des=pGC->font->pFI->maxbounds.metrics.descent;
  1439.   
  1440. !   tbox.x1=xw=x+xorg; 
  1441. !   tbox.x2=tbox.x1+tw;
  1442. !   tbox.y1=yw=y+yorg-asc; 
  1443. !   tbox.y2=y+yorg+des;
  1444.     
  1445. !   j=(*pGC->pScreen->RectIn)(reg, &tbox);
  1446.   
  1447.     if(j==rgnOUT) /* trivial reject */
  1448.       { 
  1449. ***************
  1450. *** 534,539 ****
  1451. --- 546,552 ----
  1452.   
  1453.     /* Ummm... I think TIGA clips text (it does for me!) - AKO */
  1454.   
  1455. + #if 1
  1456.     set_pmask(LongByteRepeater((~pGC->planemask)&0xFF));
  1457.   
  1458.     if(fg)
  1459. ***************
  1460. *** 550,556 ****
  1461.       }
  1462.   
  1463.     /* intersect rectangles */
  1464. !   draw=(*pGC->pScreen->RegionCreate)(tbox, 1);
  1465.     (*pGC->pScreen->Intersect)(draw, draw, reg);
  1466.     
  1467.     for(r=0; r<REGION_NUM_RECTS(draw); r++)
  1468. --- 563,569 ----
  1469.       }
  1470.   
  1471.     /* intersect rectangles */
  1472. !   draw=(*pGC->pScreen->RegionCreate)(&tbox, 1);
  1473.     (*pGC->pScreen->Intersect)(draw, draw, reg);
  1474.     
  1475.     for(r=0; r<REGION_NUM_RECTS(draw); r++)
  1476. ***************
  1477. *** 562,606 ****
  1478.         text_out(x+xorg,y+yorg-asc,text);
  1479.       }
  1480.     set_clip_rect(scrwidth,scrheight,0,0);
  1481.     /*
  1482.      * Text needs to be clipped. We do it by drawing the text 
  1483.      * offscreen and then blitting in the visible chunks (all
  1484.      * because hardware clipping won't do text!)
  1485. -    *  set_ppop(0); 
  1486. -    *  set_fcolor(0); 
  1487. -    *  set_pmask(0);
  1488. -    *  set_clip_rect(tw,des-asc,DRAW_X,DRAW_Y);
  1489. -    *  fill_rect(tw,des-asc, DRAW_X, DRAW_Y);
  1490. -    *
  1491. -    *  if(fg) set_colors(fg, 0);
  1492. -    *  else set_colors(fg, 0xff);
  1493. -    *
  1494. -    *  text_out(DRAW_X,DRAW_Y, text);
  1495. -    *
  1496. -    *  set_clip_rect(scrwidth,scrheight,DRAW_X,DRAW_Y);
  1497. -    *
  1498. -    *
  1499. -    *  set_pmask(pmask);
  1500. -    *
  1501. -    *  if(fg)
  1502. -    *    {  
  1503. -    *      transp_on();
  1504. -    *      set_ppop(xftotf[pGC->alu]);
  1505. -    *    }
  1506. -    *  else
  1507. -    *    {
  1508. -    *      set_ppop(tigfaketrans[pGC->alu]);
  1509. -    *    }
  1510. -    *
  1511. -    *  for(r=0; r<REGION_NUM_RECTS(draw); r++)
  1512. -    *    bitblt(REGION_RECTS(draw)[r].x2-REGION_RECTS(draw)[r].x1,
  1513. -    *       REGION_RECTS(draw)[r].y2-REGION_RECTS(draw)[r].y1,
  1514. -    *       REGION_RECTS(draw)[r].x1-xw+DRAW_X,
  1515. -    *       REGION_RECTS(draw)[r].y1-yw+DRAW_Y,
  1516. -    *       REGION_RECTS(draw)[r].x1,
  1517. -    *       REGION_RECTS(draw)[r].y1);
  1518.      */
  1519.     Xfree(text);
  1520.     (*pGC->pScreen->RegionDestroy)(draw);
  1521.     transp_off();
  1522. --- 575,620 ----
  1523.         text_out(x+xorg,y+yorg-asc,text);
  1524.       }
  1525.     set_clip_rect(scrwidth,scrheight,0,0);
  1526. ! #else
  1527.     /*
  1528.      * Text needs to be clipped. We do it by drawing the text 
  1529.      * offscreen and then blitting in the visible chunks (all
  1530.      * because hardware clipping won't do text!)
  1531.      */
  1532. +       set_ppop(0); 
  1533. +       set_fcolor(0); 
  1534. +       set_pmask(0);
  1535. +       set_clip_rect(tw,des-asc,DRAW_X,DRAW_Y);
  1536. +       fill_rect(tw,des-asc, DRAW_X, DRAW_Y);
  1537. +     
  1538. +       if(fg) set_colors(fg, 0);
  1539. +       else set_colors(fg, 0xff);
  1540. +     
  1541. +       text_out(DRAW_X,DRAW_Y, text);
  1542. +     
  1543. +       set_clip_rect(scrwidth,scrheight,DRAW_X,DRAW_Y);
  1544. +     
  1545. +     
  1546. +       set_pmask(pmask);
  1547. +     
  1548. +       if(fg)
  1549. +         {  
  1550. +           transp_on();
  1551. +           set_ppop(xftotf[pGC->alu]);
  1552. +         }
  1553. +       else
  1554. +         {
  1555. +           set_ppop(tigfaketrans[pGC->alu]);
  1556. +         }
  1557. +     
  1558. +       for(r=0; r<REGION_NUM_RECTS(draw); r++)
  1559. +         bitblt(REGION_RECTS(draw)[r].x2-REGION_RECTS(draw)[r].x1,
  1560. +            REGION_RECTS(draw)[r].y2-REGION_RECTS(draw)[r].y1,
  1561. +            REGION_RECTS(draw)[r].x1-xw+DRAW_X,
  1562. +            REGION_RECTS(draw)[r].y1-yw+DRAW_Y,
  1563. +            REGION_RECTS(draw)[r].x1,
  1564. +            REGION_RECTS(draw)[r].y1);
  1565. + #endif
  1566.     Xfree(text);
  1567.     (*pGC->pScreen->RegionDestroy)(draw);
  1568.     transp_off();
  1569. ***************
  1570. *** 625,631 ****
  1571.       GCPRIV        * pPriv;
  1572.       unsigned char    *text;
  1573.       ExtentInfoRec  inf;
  1574. !     BoxRec        * tbox;
  1575.       int    start, fg, asc, des, tw, xw, yw;
  1576.       static int offscreen_x, offscreen_y; /* 0, 768 */
  1577.       static int offscreen_area_known = FALSE;
  1578. --- 639,645 ----
  1579.       GCPRIV        * pPriv;
  1580.       unsigned char    *text;
  1581.       ExtentInfoRec  inf;
  1582. !     BoxRec        tbox;
  1583.       int    start, fg, asc, des, tw, xw, yw;
  1584.       static int offscreen_x, offscreen_y; /* 0, 768 */
  1585.       static int offscreen_area_known = FALSE;
  1586. ***************
  1587. *** 656,670 ****
  1588.       tw = text_width(text);
  1589.       asc = pGC->font->pFI->maxbounds.metrics.ascent;
  1590.       des = pGC->font->pFI->maxbounds.metrics.descent;
  1591. !     tbox = XNEW(BoxRec);
  1592. !     tbox->x1 = xw = x + xorg; 
  1593. !     tbox->x2 = tbox->x1 + tw;
  1594. !     tbox->y1 = yw = y + yorg - asc; 
  1595. !     tbox->y2 = y + yorg + des;
  1596.       j = x + tw;
  1597.   
  1598.       /* intersect rectangles */
  1599. !     draw = (*pGC->pScreen->RegionCreate)(tbox, 1);
  1600.       (*pGC->pScreen->Intersect)(draw, draw, pPriv->clip);
  1601.   
  1602.       if (!offscreen_area_known)
  1603. --- 670,683 ----
  1604.       tw = text_width(text);
  1605.       asc = pGC->font->pFI->maxbounds.metrics.ascent;
  1606.       des = pGC->font->pFI->maxbounds.metrics.descent;
  1607. !     tbox.x1 = xw = x + xorg; 
  1608. !     tbox.x2 = tbox.x1 + tw;
  1609. !     tbox.y1 = yw = y + yorg - asc; 
  1610. !     tbox.y2 = y + yorg + des;
  1611.       j = x + tw;
  1612.   
  1613.       /* intersect rectangles */
  1614. !     draw = (*pGC->pScreen->RegionCreate)(&tbox, 1);
  1615.       (*pGC->pScreen->Intersect)(draw, draw, pPriv->clip);
  1616.   
  1617.       if (!offscreen_area_known)
  1618. ***************
  1619. *** 738,743 ****
  1620. --- 751,757 ----
  1621.       Xfree(text);
  1622.       (*pGC->pScreen->RegionDestroy)(draw);
  1623.       transp_off();
  1624. +     synchronize();
  1625.       UNTRACE("tigStipText8");
  1626.       return j;
  1627.   }
  1628. *** 1.1    1992/08/23 17:46:38
  1629. --- tigwin.c    1992/08/22 21:11:36
  1630. ***************
  1631. *** 1,6 ****
  1632. --- 1,8 ----
  1633.   /*
  1634.    * TIGA  window control stuff
  1635.    *
  1636. +  * 20 Aug 92 Rick Schaeffer (ricks@isc-br.isc-br.com)
  1637. +  *    Fix memory leak.
  1638.    * 22 Jun 90 Erich Rickheit KSC  Admitted responsibility
  1639.    * 1  Jul 91 Aaron Orenstein    Changed tigSetstip(...origin.x, origin.y)
  1640.    *                              to tigSetstip(...drawable.x, drawable.y)
  1641. ***************
  1642. *** 174,179 ****
  1643. --- 176,182 ----
  1644.            pbox[order[i]].x1, pbox[order[i]].y1);
  1645.       
  1646.       (*pWin->drawable.pScreen->RegionDestroy)(newreg);
  1647. +     Xfree(order);
  1648.       set_ppop(op);
  1649.       UNTRACE("tigCopyWindow");
  1650.   }
  1651.