Uploaded image for project: 'Qt Safe Renderer'
  1. Qt Safe Renderer
  2. QSR-1006

Default ANIMATION_DATA_READ_BUFFER is insufficient for maximum capacity

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: QSR 1.2
    • Fix Version/s: QSR 1.2
    • Component/s: Documentation, Runtime
    • Labels:
      None
    • Commits:
      I95831acf47ec664f400db57f887244a909dfd5b8

      Description

      The qsafeconstraints.h file has the following definition:

      static const quint32 ANIMATION_DATA_READ_BUFFER=100U*1024U; //100 kilobytes for the animation data.
      

      When testing the capacity test variant B with 128 safe images, and the states and transitions are defined in the root level (not under the safe QML type), the runtime throws outOfCache exception in the qsafestatefilereader.cpp file (row 86)

      if (size > Constraints::ANIMATION_DATA_READ_BUFFER) {
              throw OutOfCache;
          }
      

      The QML file has maximum 128 safe images, and there are 8 states in total. Each state contains animation for each QML object.

      The loaded transitionReadBuffer has a size of 905379 in this case.

      The temporary workaround is obvious to increase the buffer:

      static const quint32 ANIMATION_DATA_READ_BUFFER=1000U*1024U; //1000 kilobytes for the animation data.
      

      But then another issue is spotted:

      qsafestateloader.cpp throws QSafeAnimations::IndexOutOfBounds exception

      See line 253-260

      if (Constraints::MAX_NUM_OF_ANIMATIONS_PER_ITEM >= transitionsCount) {
                      while (transitionsCount > 0U) {
                          readTransition(buffer, dataIndex, stateContainer.m_transitions);
                          transitionsCount--;
                      }
                  } else {
                      throw QSafeAnimations::IndexOutOfBounds;
                  }
      

      transitionsCount has value of 7168.

      While the limit is defined in the safeconstraints.h file:

      static const quint32 MAX_NUM_OF_ANIMATIONS_PER_ITEM=((MAX_NUM_OF_STATES*MAX_NUM_OF_STATES)-MAX_NUM_OF_STATES)*5U; //Permutations of the MAX_NUM_OF_STATES * amount of properties (x,y,opacity,sprite,color)
      

      This seems to equal ((8*8) - 8) * 5U = (64-8)*5U = 56*5U = 280U

      So the default values seem to work for smaller cases than the maximum capacity.

      That yields a smaller memory footprint, but the capacity requirements are not met.

      Maybe some explanations would be needed in the documentation FAQ part for tuning these settings if the user wants to balance between the capacity and memory footprint.

       

       

        TestRail: Results

          Attachments

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

            Activity

              People

              Assignee:
              tarjasundqvist Tarja Sundqvist
              Reporter:
              assaarel Asmo Saarela
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes

                    TestRail: Runs

                      TestRail: Cases