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();
}
Example #2
0
void PageClientQGraphicsWidget::update(const QRect& dirtyRect)
{
    view->update(dirtyRect);

    createOrDeleteOverlay();
    if (overlay)
        overlay->update(QRectF(dirtyRect));
#if USE(ACCELERATED_COMPOSITING) && !USE(TEXTURE_MAPPER)
    syncLayers();
#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
}
Example #5
0
void PageClientQGraphicsWidget::setRootGraphicsLayer(GraphicsLayer* layer)
{
    if (rootGraphicsLayer) {
        rootGraphicsLayer.data()->setParentItem(0);
        view->scene()->removeItem(rootGraphicsLayer.data());
        QWebFramePrivate::core(page->mainFrame())->view()->syncCompositingStateIncludingSubframes();
    }

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

    if (rootGraphicsLayer) {
        rootGraphicsLayer.data()->setParentItem(view);
        rootGraphicsLayer.data()->setZValue(RootGraphicsLayerZValue);
    }
    createOrDeleteOverlay();
}
Example #6
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();
}
Example #7
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();
}