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

Building with global optimisation for Windows CE introduces bugs

    XMLWordPrintable

Details

    Description

      When building Qt 5.6 for Windows CE with global optimisation (-Og) at least two bugs are introduced. I realise the fixes below are less than ideal, but they work in our case, and might help others who encounter them. Obviously turning off -Og for the GUI module also works, but this comes with a significant performance hit. I also realise Windows CE is pretty much dead, but it is still an officially supported platform for 5.6, and building for it with default options yields effectively broken binaries.

      So far we have encountered two such bugs:

      Crash when painting an image rotated by 180°

      Number one is a memory access violation in qblendfunctions_p.h:256 within qt_scale_image_32bit.

      int x = 0;
      for (; x<w; ++x) {
          blender.write(&dst[x], src[srcx >> 16]);  <------ here
          srcx += ix;
      }
      

      We have worked around this issue by circumventing Qt's optimisation for the special case of a 180° rotation, i. e. scaling. To this end we replaced the > with >= in qpaintengine_raster.cpp:2302 to force the paint engine to use the rotating blend function eventhough the matrix has no rotation component.

      if (!exceedsPrecision && d->canUseFastImageBlending(d->rasterBuffer->compositionMode, img)) {
          if (s->matrix.type() >= QTransform::TxScale) {  <------ here
              SrcOverTransformFunc func = qTransformFunctions[d->rasterBuffer->format][img.format()];
      

      Faulty alpha pixel detection
      The second bug is in qimage.cpp, in the QImageData::checkForAlphaPixels() function. In commit 833341e a case was added for Format_Alpha8, and the default case was replaced with explicit cases for the remaining formats. Following this commit the alpha pixel detection no longer works correctly for some of our 24bit PNG assets. Their transparent pixels are painted as opaque grey. Curiously, this only affects some of the assets, but always the same ones.
      This can be fixed by reverting 833341e. Which should be okay, as long as your don't use Format_Alpha8.

      Attachments

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

        Activity

          People

            sletta Gunnar Sletta
            dneumaerker Delf
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes