9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] optimizing graphics
@ 2003-09-05  5:16 mirtchov
  2003-09-05 22:45 ` andrey mirtchovski
  0 siblings, 1 reply; 14+ messages in thread
From: mirtchov @ 2003-09-05  5:16 UTC (permalink / raw)
  To: 9fans

I'm shopping for optimization suggestions for the following:

another xscr port:

	http://pages.cpsc.ucalgary.ca/~mirtchov/p9/xscr/eruption.gif

performs relatively slow on plan9 (huge discrepancy between plan9 and
X).  the application involves drawing a large amount of pixels on the
screen and is currently doing a loop very similar to this:

	foreach y in Dy(screen->r) {
		foreach x in Dx(screen->r) {
			"draw() a 1x1 rectangle at (x,y), taking the
			colour from a previously alloc-ed image"
		}
	}

i have tried double-buffering (drawing to an offline image, then after
the loop is done draw-ing the image itself) and have contemplated
drawing to an array of pixels, then displaying it with 'loadimage()'.
another possibility is writing the pixel directly to the screen
image...

this particular one is implemented in X as a XPutPixel() to an offline
image, which then gets displayed with XPutImage() after the loop is
done.

you can find the code on the page abore (xscr.tar.gz), but run it
through a C beautifier before you look at it (jwz likes emacs)

comments and suggestions welcome -- this is more of a learning issue,
than an implementation one.

andrey




^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2003-09-08  1:10 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-09-05  5:16 [9fans] optimizing graphics mirtchov
2003-09-05 22:45 ` andrey mirtchovski
2003-09-05 23:01   ` Geoff Collyer
2003-09-06 14:55     ` David Presotto
2003-09-06 15:00       ` David Presotto
2003-09-06 18:24         ` mirtchov
2003-09-06 18:28           ` Russ Cox
2003-09-06 18:33             ` mirtchov
2003-09-06 22:03             ` Geoff Collyer
2003-09-05 23:17   ` jmk
2003-09-05 23:27     ` mirtchov
2003-09-08  1:10       ` okamoto
2003-09-06  5:36     ` boyd, rounin
2003-09-06  5:33   ` boyd, rounin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).