Ignore:
Timestamp:
Aug 2, 2010, 9:27:30 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.6.3 sources from branches/vendor/nokia/qt.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp

    r651 r769  
    175175                                   Qt::ImageConversionFlags flags)
    176176{
     177    if (!QFile::exists(filename))
     178        return false;
    177179    if (flags == Qt::AutoColor) {
    178180        if (filename.startsWith(QLatin1Char(':'))) { // resource
     
    289291                                    Qt::ImageConversionFlags flags)
    290292{
    291     if (img.depth() == 1 || img.format() == QImage::Format_RGB32) {
    292         fromImage(img.convertToFormat(screen->alphaPixmapFormat()), flags);
    293         return;
    294     }
    295 
    296     if (img.hasAlphaChannel()
     293    if (img.depth() == 1) {
     294        alpha = true;
    297295#ifndef QT_NO_DIRECTFB_OPAQUE_DETECTION
    298         && (flags & Qt::NoOpaqueDetection || QDirectFBPixmapData::hasAlphaChannel(img))
    299 #endif
    300         ) {
     296    } else if (flags & Qt::NoOpaqueDetection || QDirectFBPixmapData::hasAlphaChannel(img)) {
    301297        alpha = true;
    302         imageFormat = screen->alphaPixmapFormat();
    303     } else {
    304         alpha = false;
    305         imageFormat = screen->pixelFormat();
    306     }
     298#else
     299    } else if (img.hasAlphaChannel()) {
     300        alpha = true;
     301#endif
     302    }
     303    imageFormat = alpha ? screen->alphaPixmapFormat() : screen->pixelFormat();
    307304    QImage image;
    308     if (flags != Qt::AutoColor) {
     305    if ((flags & ~Qt::NoOpaqueDetection) != Qt::AutoColor) {
    309306        image = img.convertToFormat(imageFormat, flags);
    310307        flags = Qt::AutoColor;
    311     } else if (img.format() == QImage::Format_RGB32) {
     308    } else if (img.format() == QImage::Format_RGB32 || img.depth() == 1) {
    312309        image = img.convertToFormat(imageFormat, flags);
    313310    } else {
     
    426423    Q_ASSERT(dfbSurface);
    427424
    428     alpha = (color.alpha() < 255);
     425    alpha |= (color.alpha() < 255);
    429426
    430427    if (alpha && isOpaqueFormat(imageFormat)) {
     
    594591}
    595592
     593#ifndef QT_DIRECTFB_PLUGIN
     594Q_GUI_EXPORT IDirectFBSurface *qt_directfb_surface_for_pixmap(const QPixmap &pixmap)
     595{
     596    const QPixmapData *data = pixmap.pixmapData();
     597    if (!data || data->classId() != QPixmapData::DirectFBClass)
     598        return 0;
     599    const QDirectFBPixmapData *dfbData = static_cast<const QDirectFBPixmapData*>(data);
     600    return dfbData->directFBSurface();
     601}
     602#endif
     603
    596604QT_END_NAMESPACE
    597605
Note: See TracChangeset for help on using the changeset viewer.