Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-17966

Major regression in QGraphicsView OpenVG backend

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P0: Blocker
    • Resolution: Done
    • Affects Version/s: 4.7.2
    • Fix Version/s: 4.7.3
    • Labels:
      None
    • Environment:
      Symbian^3 (PR1.1 firmware), Nokia N8
    • Commits:
      2ecb0ea77c04424f6f557ca8a13c1d86666763df

      Description

      The minimal and smart viewport update modes have been badly broken by a change in Qt 4.7.2. This is probably related to http://bugreports.qt.nokia.com/browse/QTBUG-16932 (which is fixed superbly on its own).

      In my game, everything works perfectly until the player dies, I show an "explosion" particle animation (see 16932) and the game jumps back to the beginning, or last restart point. From there nothing is redrawn (objects visible at point of death still shown) until the (invisible) player crashes into an (invisble) object. At that point newly spawned explosion particles (see 16932) are drawn and animate correctly. Areas the animated particles pass over appear to get redrawn correctly.

      FullViewportUpdate mode works (and performance seems a little worse but I may be able to use it) and the raster paint engine is fine with any update mode.

      If I change nothing else but only remove the explosions then everything else works again in all update modes. This leads me to believe the OpenVG backend somehow switches into a different mode for calculating what to update when there are multiple objects moving on the view and doesn't ever leave it again, as a direct result of the fix to 16932.

      However, in case this in not an obvious "doh!" moment when re-visiting the code...

      About the game design:
      1) The objects in the game level are statically positioned at initialization except the ground line and the player. The player and ground line move with the scrolling of the view over the scene so they stay at the same x-coordinate on the screen.
      2) I set the player object invisible while the explosion occurs - it is set visible again just before jumping back to the beginning.
      3) Objects scrolling on and off the scene have their opacity increased and reduced respectively so that they fade in and out as they scroll by. As such, objects that have left the scene are not technically visible (as far as the graphics view is concerned) but you can't actually see them (opacity is 0.01, which is above the threshold where graphics view treats them as invisible - already worked around that optimization "feature"). When the game resets it becomes possible to see them again as their opacity is increased as they scroll onto the scene (if the player jumps to a restart point everything in the view has it's opacity set to 1 and the fade effect is re-applied before restarting).

      It is not at all easy for me to pull out a minimal example to reproduce this. If you really need a working environment to debug this I can share my port in-progress but not publicly on this bug tracker.

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            jhautaka Jani Hautakangas
            Reporter:
            m_p_wilcox Mark Wilcox
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes