How can drawing routines be optimized to achieve the maximum refresh rate in Windows CE?

假如想象 提交于 2019-12-11 23:42:46

问题


In my application i am drawing some set of lines (like a vertical graph), and the refresh rate will be around 30 times in a second. I have calculated the performance and it is taking 400 milliseconds to draw complete lines, but this won't be fast enough since we have to refresh the screen every 34 milliseconds.

I am drawing on CDC.

We will be drawing on a Windows CE device with a 400 MHz processor. Drawing involves the simple MFC APIs like MoveTo, LineTo, FillRect, etc. on DC of View:

CDC* pDC = GetDC(); //draw vertical line from one end of screen to the other 
pDC->MoveTo(some xy Cordinates);
pDC->LineTo(some xy Points);

How we can optimize the drawing routines? Please suggest any pointers.


回答1:


Since Windows Vista, GDI operations (other than BitBlt) are no longer hardware accelerated, but done in software.

To get the performance you need, you probably need to use Direct3D or OpenGl.

All though this msdn document implies that, since NT 6.1, hw acceleration of GDI is back on the table. Still I expect the vector based APIs offered by OpenGL and D3D should perform far more reliably - GDI line drawing is not something driver writers strive to optimize.


In answer to the update re Windows CE being the target: Direct X has apparently been available on Windows CE since at least CE 2.1

Im still betting that GDI is not particularly hw accelerated on CE; if there is any hw support at all, DirectX would be the way to access it.



来源:https://stackoverflow.com/questions/4524527/how-can-drawing-routines-be-optimized-to-achieve-the-maximum-refresh-rate-in-win

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!