I have encounter this issue during my development on mobile device app. We were trying to get the same refresh rate on both landscape and portrait screen orientation. I was getting 20 ms refresh rate for 800x480 resolution screen using memory DC blitting, but in portrait the performance deemed to 50 ms. My implementation was to achieve the similar look and feel for Display. So we were trying something given in figure, to render on screen in both orientation.
Now the graphics card always pulls pixels out of the frame buffer in the same
order, usually in landscape mode (Image1). So during refresh, the pixels are read in that order, starting with A. Memory is organized so that the pixels in a single scanline are collected together
in a single "page" of memory, and memory accesses are faster when you stay
in the same page.
But When you rotate the screen the refresh order does not change. So, even
though you now see the screen like this: Image.2 the refresh still starts with pixel E , then J, then O and goes similar order through Z.
The desktop rotates because it is being DRAWN in the new order
And when we do a graphics operations, like filling the screen, you will start
with pixel A, then B, then C and same(Image2). Which leads you to the Performance Issue reason is Although they are adjacent on the screen, they are relatively far apart in the graphics memory, and that means it takes longer to switch from pixel to pixel. Each access is a new page...
So if you want to achieve the similar performance like in landscape you should try implementing you code in such way so thatit should follow the redarw instruction in similar fashion as it was there in Landscape mode. That is From E to J to O to T....D to I to N... till Z.
Thanks,
No comments:
Post a Comment