Ejemplo n.º 1
0
void QVGLiteWindowSurface::flush(QWidget *widget, const QRegion &region, const QPoint &offset)
{
    Q_UNUSED(widget);
    Q_UNUSED(region);
    Q_UNUSED(offset);
    QEglContext *context = graphicsSystem->context;
    if (context) {
        if (!isPaintingActive)
            qt_vg_make_current(context, graphicsSystem->rootWindow);
        context->swapBuffers();
        qt_vg_done_current(context);
        context->setSurface(EGL_NO_SURFACE);
        isPaintingActive = false;
    }
}
void QVGEGLWindowSurfaceDirect::endPaint
        (QWidget *widget, const QRegion& region, QImage *image)
{
    Q_UNUSED(region);
    Q_UNUSED(image);
    QEglContext *context = ensureContext(widget);
    if (context) {
        if (needToSwap) {
            if (!isPaintingActive)
                context->makeCurrent(windowSurface);
            context->swapBuffers(windowSurface);
            context->lazyDoneCurrent();
        } else if (isPaintingActive) {
            vgFlush();
            context->lazyDoneCurrent();
        }
        isPaintingActive = false;
    }
}