Exemple #1
0
void QMultiScreen::blit(QWSWindow *bs, const QRegion &clip)
{
    const int n = d_ptr->screens.size();
    for (int i = 0; i < n; ++i) {
        QScreen *screen = d_ptr->screens.at(i);
        const QRegion r = clip & screen->region();
        if (r.isEmpty())
            continue;
        screen->blit(bs, r);
    }
}
Exemple #2
0
void QMultiScreen::blit(const QImage &img, const QPoint &topLeft,
                        const QRegion &region)
{
    const int n = d_ptr->screens.size();
    for (int i = 0; i < n; ++i) {
        QScreen *screen = d_ptr->screens.at(i);
        const QRegion r = region & screen->region();
        if (r.isEmpty())
            continue;
        screen->blit(img, topLeft, r);
    }
}
void QWSWindowSurface::flush(QWidget *widget, const QRegion &region,
                             const QPoint &offset)
{
    const QWidget *win = window();
    if (!win)
        return;

#ifndef QT_NO_GRAPHICSVIEW
    QWExtra *extra = win->d_func()->extra;
    if (extra && extra->proxyWidget)
        return;
#endif //QT_NO_GRAPHICSVIEW

    Q_UNUSED(offset);

    const bool opaque = isOpaque();
#ifdef QT_QWS_DISABLE_FLUSHCLIPPING
    QRegion toFlush = region;
#else
    QRegion toFlush = region & d_ptr->clip;
#endif

    if (!toFlush.isEmpty()) {
        flushUpdate(widget, toFlush, QPoint(0, 0));
        QPoint globalZero = win->mapToGlobal(QPoint(0, 0));
        toFlush.translate(globalZero);

#ifdef QT_QWS_CLIENTBLIT
        bool needRepaint = true;
        if (opaque) {
            QScreen* widgetScreen = getScreen(widget);
            if (widgetScreen->supportsBlitInClients()) {

                QWSDisplay::grab();
                if(directRegion().intersected(toFlush) == toFlush) {
                    QPoint translate = -globalZero + painterOffset() + geometry().topLeft();
                    QRegion flushRegion = toFlush.translated(translate);
                    widgetScreen->blit(image(), geometry().topLeft(), flushRegion);
                    widgetScreen->setDirty(toFlush.boundingRect());
                    needRepaint = false;
                }
                QWSDisplay::ungrab();
            }
        }

        if(needRepaint)
#endif
            win->qwsDisplay()->repaintRegion(winId(), win->windowFlags(), opaque, toFlush);
    }
}