Ejemplo n.º 1
0
QRect KisQPainterCanvas::updateCanvasProjection(KisUpdateInfoSP info)
{
    /**
    * It might happen that the canvas type is switched while the
    * update info is being stuck in the Qt's signals queue. Than a wrong
    * type of the info may come. So just check it here.
    */
    bool isPPUpdateInfo = dynamic_cast<KisPPUpdateInfo*>(info.data());
    if (isPPUpdateInfo) {
        m_d->prescaledProjection->recalculateCache(info);
        return info->dirtyViewportRect();
    } else {
        return QRect();
    }
}
Ejemplo n.º 2
0
QRect KisOpenGLCanvas2::updateCanvasProjection(KisUpdateInfoSP info)
{
    // See KisQPainterCanvas::updateCanvasProjection for more info
    bool isOpenGLUpdateInfo = dynamic_cast<KisOpenGLUpdateInfo*>(info.data());
    if (isOpenGLUpdateInfo) {
        d->openGLImageTextures->recalculateCache(info);
    }

#ifdef Q_OS_OSX
    /**
     * There is a bug on OSX: if we issue frame redraw before the tiles finished
     * uploading, the tiles will become corrupted. Depending on the GPU/driver
     * version either the tile itself, or its mipmaps will become totally
     * transparent.
     */

    glFinish();
#endif

    return QRect(); // FIXME: Implement dirty rect for OpenGL
}