Ignore:
Timestamp:
May 5, 2011, 5:36:53 AM (14 years ago)
Author:
Dmitry A. Kuminov
Message:

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

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

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

    r769 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    15551555        }
    15561556    }
    1557     if (!region.isEmpty()) {
    1558         solidFill(d_ptr->backgroundColor, region);
    1559     }
     1557
     1558    solidFill(d_ptr->backgroundColor, region);
    15601559
    15611560    while (idx > 0) {
     
    16301629    Q_UNUSED(region);
    16311630#else
     1631    QDirectFBScreen::solidFill(d_ptr->primarySurface, color, region);
     1632#endif
     1633}
     1634
     1635static inline void clearRect(IDirectFBSurface *surface, const QColor &color, const QRect &rect)
     1636{
     1637    Q_ASSERT(surface);
     1638    const DFBRegion region = { rect.left(), rect.top(), rect.right(), rect.bottom() };
     1639    // could just reinterpret_cast this to a DFBRegion
     1640    surface->SetClip(surface, &region);
     1641    surface->Clear(surface, color.red(), color.green(), color.blue(), color.alpha());
     1642}
     1643
     1644void QDirectFBScreen::solidFill(IDirectFBSurface *surface, const QColor &color, const QRegion &region)
     1645{
    16321646    if (region.isEmpty())
    16331647        return;
    16341648
    1635     d_ptr->primarySurface->SetColor(d_ptr->primarySurface,
    1636                                     color.red(), color.green(), color.blue(),
    1637                                     color.alpha());
    16381649    const int n = region.rectCount();
    16391650    if (n == 1) {
    1640         const QRect r = region.boundingRect();
    1641         d_ptr->primarySurface->FillRectangle(d_ptr->primarySurface, r.x(), r.y(), r.width(), r.height());
     1651        clearRect(surface, color, region.boundingRect());
    16421652    } else {
    16431653        const QVector<QRect> rects = region.rects();
    1644         QVarLengthArray<DFBRectangle, 32> rectArray(n);
    16451654        for (int i=0; i<n; ++i) {
    1646             const QRect &r = rects.at(i);
    1647             rectArray[i].x = r.x();
    1648             rectArray[i].y = r.y();
    1649             rectArray[i].w = r.width();
    1650             rectArray[i].h = r.height();
    1651         }
    1652         d_ptr->primarySurface->FillRectangles(d_ptr->primarySurface, rectArray.constData(), n);
    1653     }
    1654 #endif
     1655            clearRect(surface, color, rects.at(i));
     1656        }
     1657    }
     1658    surface->SetClip(surface, 0);
    16551659}
    16561660
     
    17911795#endif
    17921796
    1793 #ifndef QT_DIRECTFB_PLUGIN
    17941797Q_GUI_EXPORT IDirectFBSurface *qt_directfb_surface_for_widget(const QWidget *widget, QRect *rect)
    17951798{
     
    18091812
    18101813#endif
    1811 #endif
    18121814
    18131815QT_END_NAMESPACE
Note: See TracChangeset for help on using the changeset viewer.