by refractor » Jun 25, 2002 @ 4:12pm
Well, the screen is still usually a linear buffer... i.e. a contiguous chunk of memory.
So, it really shouldn't shouldn't matter the orientation of the screen. Just because GAPI tells you you have to do stupid things like move the pointer along 480 to access the "next" pixel horizontally doesn't mean that you have to play by its rules and actually do it.
Ask GAPI to give you the start address of the screen and the orientation, and then shove a full, contiguous row/column into it (depending on the orientation), and move along to the next row/column (on the iPAQ you don't even need to move along to the next row, but on some devices you might). All you've got to do is watch out for variations in the "pitch".
If you're plucking pixels from a rotated buffer it should be fairly simple to pick them out two at a time, transform them and plot them.
If you always try and load and store in the same "grain" as the memory/cache-lines you're going to produce fast code.
If you start loading and plotting 16-bit pixels one at a time, all over the memory it's going to be slow as hell. You need to try to do at least one side of things (loading or storing) contiguously in memory.
Cheers,
Refractor