void PageClientQGraphicsWidget::scroll(int dx, int dy, const QRect& rectToScroll)
{
    view->scroll(qreal(dx), qreal(dy), rectToScroll);

#if USE(ACCELERATED_COMPOSITING)
    updateCompositingScrollPosition();
#endif
}
void QGraphicsWebViewPrivate::scroll(int dx, int dy, const QRect& rectToScroll)
{
    q->scroll(qreal(dx), qreal(dy), QRectF(rectToScroll));

#if USE(ACCELERATED_COMPOSITING)
    updateCompositingScrollPosition();
#endif
}
void QGraphicsWebViewPrivate::update(const QRect & dirtyRect)
{
    q->update(QRectF(dirtyRect));

    createOrDeleteOverlay();
    if (overlay)
        overlay->update(QRectF(dirtyRect));
#if USE(ACCELERATED_COMPOSITING)
    updateCompositingScrollPosition();
    syncLayers();
#endif
}
void PageClientQGraphicsWidget::update(const QRect& dirtyRect)
{
    view->update(dirtyRect);

    createOrDeleteOverlay();
    if (overlay)
        overlay->update(QRectF(dirtyRect));
#if USE(ACCELERATED_COMPOSITING)
    syncLayers();
    // This might be a slow-scroll. We ensure that the compositing layers are in the right position.
    updateCompositingScrollPosition();
#endif
}
Exemplo n.º 5
0
void PageClientQGraphicsWidget::setRootGraphicsLayer(QGraphicsItem* layer)
{
    if (rootGraphicsLayer) {
        rootGraphicsLayer.data()->setParentItem(0);
        view->scene()->removeItem(rootGraphicsLayer.data());
        QWebFramePrivate::core(page->mainFrame())->view()->syncCompositingStateRecursive();
    }

    rootGraphicsLayer = layer ? layer->toGraphicsObject() : 0;

    if (layer) {
        layer->setFlag(QGraphicsItem::ItemClipsChildrenToShape, true);
        layer->setParentItem(view);
        layer->setZValue(RootGraphicsLayerZValue);
        updateCompositingScrollPosition();
    }
    createOrDeleteOverlay();
}
Exemplo n.º 6
0
void QGraphicsWebViewPrivate::setRootGraphicsLayer(QGraphicsItem* layer)
{
    if (rootGraphicsLayer) {
        rootGraphicsLayer->setParentItem(0);
        q->scene()->removeItem(rootGraphicsLayer);
        QWebFramePrivate::core(q->page()->mainFrame())->view()->syncCompositingStateRecursive();
    }

    rootGraphicsLayer = layer;

    if (layer) {
        layer->setFlag(QGraphicsItem::ItemClipsChildrenToShape, true);
        layer->setParentItem(q);
        layer->setZValue(RootGraphicsLayerZValue);
        updateCompositingScrollPosition();
    }
    createOrDeleteOverlay();
}
void PageClientQGraphicsWidget::setRootGraphicsLayer(TextureMapperPlatformLayer* layer)
{
    if (rootGraphicsLayer && !layer) {
        delete rootGraphicsLayer;
        rootGraphicsLayer = 0;
        QWebFramePrivate::core(page->mainFrame())->view()->syncCompositingStateRecursive();
        createOrDeleteOverlay();
        return;
    }

    if (!rootGraphicsLayer)
        rootGraphicsLayer = new PlatformLayerQGraphicsItem();

    rootGraphicsLayer->setPlatformLayer(static_cast<TextureMapperContentLayer*>(layer));
    rootGraphicsLayer->setParentItem(view);
    rootGraphicsLayer->setZValue(RootGraphicsLayerZValue);
    updateCompositingScrollPosition();
    createOrDeleteOverlay();
}