Hi Krzysztof,
I want to change wrapping and painting code to minimize flickering and maximize performance.
From what I see, the following could be done:
The paragraph structure should include not MEPF_REWRAP and MEPF_REPAINT flags, but indexes of rows from which to start re-wrapping and repainting (e.g. nStartRewrap and nStartRepaint). The wrapping routine should check if it has actually changed wrapping and set nStartRepaint accordingly.
ME_Repaint should not call ME_PaintContent directly. Instead, the wrapping routine (and probably others) should call InvalidateRect for screen areas that need to be repainted.
What do you as the author of that code think about my suggestions? Or it's possible that you are working in the same direction, and then it would be silly to implement one thing twice?
-- Ph.
On Sat, 13 Aug 2005 12:47:19 +0400 Phil Krylov phil@newstar.rinet.ru wrote:
The paragraph structure should include not MEPF_REWRAP and MEPF_REPAINT flags, but indexes of rows from which to start re-wrapping and repainting (e.g. nStartRewrap and nStartRepaint). The wrapping routine should check if it has actually changed wrapping and set nStartRepaint accordingly.
ME_Repaint should not call ME_PaintContent directly. Instead, the wrapping routine (and probably others) should call InvalidateRect for screen areas that need to be repainted.
On other hand, the current code is pretty stable although flickering. Probably flickering could be more easily by drawing to an offscreen bitmap which would be just exposed by WM_PAINT.
-- Ph.
On Sat, 13 Aug 2005 18:51:06 +0400 Phil Krylov phil@newstar.rinet.ru wrote:
The paragraph structure should include not MEPF_REWRAP and MEPF_REPAINT flags, but indexes of rows from which to start re-wrapping and repainting (e.g. nStartRewrap and nStartRepaint). The wrapping routine should check if it has actually changed wrapping and set nStartRepaint accordingly.
ME_Repaint should not call ME_PaintContent directly. Instead, the wrapping routine (and probably others) should call InvalidateRect for screen areas that need to be repainted.
On other hand, the current code is pretty stable although flickering. Probably flickering could be more easily by drawing to an offscreen bitmap which would be just exposed by WM_PAINT.
I've just sent a patch that implements both approaches to wine-patches.
-- Ph.