Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29262 Discussions

Suggestion #2: BEGINDRAWQQ and ENDDRAWQQ for QuickWin Applications

Jugoslav_Dujic
Valued Contributor II
311 Views
I'd like to share few thoughts and offer them as suggestions for future implementation in Intel Fortran; I'll separate them into two threads as they're unrelated.
Thesecond is inspired by this recent thread on the Forum. I've pinpointed that implementation of graphic routines in QuickWin is very inefficient. This inefficiency is visible when the number of objects to be drawn on the screen is large. For this reason you can't do things such as e.g. rerender-on-demand for complex images, as the time for completion of operation can be huge.
My conclusion is that the culprit is requirement that result of any drawing operation on a child window has to result in an immediate screen update (as the library does not know when the drawing is finished). I.e. pseudo-code of RECTANGLE function looks like:
integer(2) function RECTANGLE(...)
hActiveWindow = GetActiveChild()
ActiveChildData = GetQWWindowData(hActiveWindow)
!Adjust pen & brush, draw a rectangle on
!ActiveChildData%hCompatibleDC here
!Force screen redrawing
InvalidateRect(hActiveWindow, NULL_RECT)
UpdateWindow(hActiveWindow)
end function RECTANGLE
If I'm right, that could be easily improved by including additional routine(s) -- I call them BEGINDRAWQQ and ENDDRAWQQ, whose purpose is to lock/unlock window updating during graphic operations in the meantime. That would not affect existing programs at all (butthey could speed them up if added), if implemented in the following manner:
subroutine BEGINDRAWQQ()
hActiveWindow = GetActiveChild()
ActiveChildData = GetQWWindowData(hActiveWindow)
ActiveChildData%bLockUpdate = .TRUE.
end subroutine
subroutine ENDDRAWQQ()
hActiveWindow = GetActiveChild()
ActiveChildData = GetQWWindowData(hActiveWindow)
ActiveChildData%bLockUpdate = .FALSE.
InvalidateRect(hActiveWindow, NULL_RECT)
UpdateWindow(hActiveWindow)
end subroutine
Whereas the existing code of QuickWin library should only add another field (bLockUpdate) in private window data (ActiveChildData) and change the code of all graphic output routines so that it looks like:
!Force screen redrawing
if (.not.ActiveChildData%bLockUpdate) then
InvalidateRect(hActiveWindow, NULL_RECT)
UpdateWindow(hActiveWindow)
end if
I'm not sure how actively is QuickWin maintained by Intel people though.
Jugoslav
0 Kudos
0 Replies
Reply