I found that FMX mobile platforms does not support local invalidation!

I found that FMX mobile platforms does not support local invalidation!

This means that all controls on a form are repainted every time any control invalidates anything. I hope I am wrong or at least a workaround can be found. My findings are in this SO question:
http://stackoverflow.com/questions/41361668

Any suggestions for a workaround on iOS?

Comments

  1. unclear how delphi handles it, however, on both iOS and Android, using the platform tools(Xcode/Android Studio), you have the ability to invalidate a specific UI element

    ReplyDelete
  2. I suppose that OpenGL uses a DoubleBuffered rendering, so the entire screen as to be recomputed at each frame...the only way to avoid that is to use Buffer Objects to store portion of the screen and compose the form without recomputing everything.
    I think that I've seen "NeedUpdate" or something like that in the code...perhaps it is already done that way.

    ReplyDelete
  3. Dorin Duminica To iOS the whole form is considered as one UIView control. The problem is in FMX.

    ReplyDelete
  4. Hans Lavdal Jakobsen I find delphi to be a great product for desktop applications, using it for over a decade, when it comes to mobile, it's always at the bottom of my tool list together with the so called hybrid solutions.

    ReplyDelete
  5. Eli M I wonder how the support for GDI/GDI+/Direct2D is not a problem in the way FMX is designed. OpenGL do not have any 2D API, it use a 3D orthogonal projection...so they should not exists a Canvas and a Context3D but only one general purpose rendering context.

    When I've designed the StereoViewport I had to create a Texture, a Context3D and a Bitmap, the last one to draw on the 2D Canvas, but for OpenGL it sould be a texture aswell...did'nt dig in the code to know how it is handled.

    ReplyDelete
  6. Double-buffering would increase the speed so much that you wont see the problem, though it is still strange that partial invalidation has not been implemented. If it would just paint only the control that was invalidated it would be great. Eli M I saw that one of your links contains a link to QP feature request. I voted for it:
    quality.embarcadero.com - Log in - Embarcadero Technologies

    ReplyDelete
  7. Hans Lavdal Jakobsen AFAIK OpenGL use two video buffers so you can't update a portion of the screen.

    https://www.khronos.org/opengl/wiki/Common_Mistakes#Swap_Buffers

    ReplyDelete
  8. Eli M I ended up making my own solution. The keyword for me was double-buffering. Since I only use custom FMX controls on iOS, I simply made my own variant of TControl, from which my components inherit. It renders to an internal bitmap when contents changed and in all other invalidation situations it will simply copy the bitmap to the target canvas.

    ReplyDelete

Post a Comment