src/gui/image/qpixmap_raster.cpp
changeset 30 5dc02b23752f
parent 22 79de32ba3296
child 33 3e2da88830cd
equal deleted inserted replaced
29:b72c6db6890b 30:5dc02b23752f
   180         } else {
   180         } else {
   181 
   181 
   182             QImage::Format opaqueFormat = QNativeImage::systemFormat();
   182             QImage::Format opaqueFormat = QNativeImage::systemFormat();
   183             QImage::Format alphaFormat = QImage::Format_ARGB32_Premultiplied;
   183             QImage::Format alphaFormat = QImage::Format_ARGB32_Premultiplied;
   184 
   184 
       
   185 #ifndef QT_HAVE_NEON
   185             switch (opaqueFormat) {
   186             switch (opaqueFormat) {
   186             case QImage::Format_RGB16:
   187             case QImage::Format_RGB16:
   187                 alphaFormat = QImage::Format_ARGB8565_Premultiplied;
   188                 alphaFormat = QImage::Format_ARGB8565_Premultiplied;
   188                 break;
   189                 break;
   189             default: // We don't care about the others...
   190             default: // We don't care about the others...
   190                 break;
   191                 break;
   191             }
   192             }
       
   193 #endif
   192 
   194 
   193             if (!sourceImage.hasAlphaChannel()
   195             if (!sourceImage.hasAlphaChannel()
   194                 || ((flags & Qt::NoOpaqueDetection) == 0
   196                 || ((flags & Qt::NoOpaqueDetection) == 0
   195                     && !const_cast<QImage &>(sourceImage).data_ptr()->checkForAlphaPixels())) {
   197                     && !const_cast<QImage &>(sourceImage).data_ptr()->checkForAlphaPixels())) {
   196                 image = sourceImage.convertToFormat(opaqueFormat);
   198                 image = sourceImage.convertToFormat(opaqueFormat);
   236     } else if (image.depth() >= 15) {
   238     } else if (image.depth() >= 15) {
   237         int alpha = color.alpha();
   239         int alpha = color.alpha();
   238         if (alpha != 255) {
   240         if (alpha != 255) {
   239             if (!image.hasAlphaChannel()) {
   241             if (!image.hasAlphaChannel()) {
   240                 QImage::Format toFormat;
   242                 QImage::Format toFormat;
       
   243 #ifndef QT_HAVE_NEON
   241                 if (image.format() == QImage::Format_RGB16)
   244                 if (image.format() == QImage::Format_RGB16)
   242                     toFormat = QImage::Format_ARGB8565_Premultiplied;
   245                     toFormat = QImage::Format_ARGB8565_Premultiplied;
   243                 else if (image.format() == QImage::Format_RGB666)
   246                 else if (image.format() == QImage::Format_RGB666)
   244                     toFormat = QImage::Format_ARGB6666_Premultiplied;
   247                     toFormat = QImage::Format_ARGB6666_Premultiplied;
   245                 else if (image.format() == QImage::Format_RGB555)
   248                 else if (image.format() == QImage::Format_RGB555)
   246                     toFormat = QImage::Format_ARGB8555_Premultiplied;
   249                     toFormat = QImage::Format_ARGB8555_Premultiplied;
   247                 else if (image.format() == QImage::Format_RGB444)
   250                 else if (image.format() == QImage::Format_RGB444)
   248                     toFormat = QImage::Format_ARGB4444_Premultiplied;
   251                     toFormat = QImage::Format_ARGB4444_Premultiplied;
   249                 else
   252                 else
       
   253 #endif
   250                     toFormat = QImage::Format_ARGB32_Premultiplied;
   254                     toFormat = QImage::Format_ARGB32_Premultiplied;
   251                 image = QImage(image.width(), image.height(), toFormat);
   255                 image = QImage(image.width(), image.height(), toFormat);
   252             }
   256             }
   253 
   257 
   254             switch (image.format()) {
   258             switch (image.format()) {