Subject: fast bitmaps

From: [email-masked] (Mark Hjelm)
Date: Fri, 16 Oct 87 00:02:43 EST

I am in the process of porting a window manager to run under NeWS that
relies heavily on ropping pixrects to the screen.  I am not satisfied at all
with the performance I'm getting.  Is there anything I can to better?
Does NeWS support Unix domain sockets in any way?  Here's my code:

Postscript:

cdef news_win_update(id,width,height,x,y)
	{	%% assumes everything is on a byte boundary
	    /win Windows id get def
	    win /Canvas get setcanvas
	    /str width 8 idiv string def
	    gsave
	    x y translate
	    width height scale
	    width height 1 [ width 0 0 height neg 0 height ]
	        { currentfile str readstring pop } image
	    grestore
	} exec	%% so it doesn't interfere with readstring

C:

void do_update(pr,width,height,x,y)

struct pixrect *pr;
int width, height, x, y;

{

    int d, i;
    struct mpr_data *mpr;
    char *data;

    d = x % 8;	/* align on byte boundary */
    x -= d;
    width +=
d;
    width = (width + 7) / 8 * 8;

    news_win_update(ID,width,height,x,WINDOW_HEIGHT-(y+height));

    mpr = (string mpr_data *) pr->pr_data;
    data = (char *) mpr->md_image;
    data += (y * mpr->md_linebytes) + (x / 8);
    for (i=0; i<height; i++) {
        fwrite(data,width/8,1,PostScript);
        data += mpr->md_linebytes;
    }

}

Thanks,
Mark

ARPA:   [email-masked]
UUCP:   seismo!g.gp.cs.cmu.edu!hjelm
CSNET:  hjelm%pt.cs.cmu.edu@csnet-relay