Пример #1
0
void QRawWebView::paint(const QMatrix4x4& transform, float opacity, unsigned paintFlags)
{
    WebKit::LayerTreeRenderer* renderer = layerTreeRenderer();
    if (!renderer)
        return;

    renderer->setActive(true);

    WebCore::FloatRect rect(0, 0, d->m_size.width(), d->m_size.height());

    renderer->paintToCurrentGLContext(transform, opacity, transform.mapRect(rect), paintFlags);
}
Пример #2
0
void QRawWebView::paint(const QMatrix4x4& transform, float opacity, unsigned paintFlags)
{
    WebCore::CoordinatedGraphicsScene* scene = coordinatedGraphicsScene();
    if (!scene)
        return;

    scene->setActive(true);

    WebCore::FloatRect rect(0, 0, d->m_size.width(), d->m_size.height());

    scene->paintToCurrentGLContext(transform, opacity, transform.mapRect(rect), paintFlags);
}
Пример #3
0
    QRectF clipRect() const
    {
        // Start with an invalid rect.
        QRectF resultRect(0, 0, -1, -1);

        for (const QSGClipNode* clip = clipList(); clip; clip = clip->clipList()) {
            QMatrix4x4 clipMatrix;
            if (pageNode()->devicePixelRatio() != 1.0) {
                clipMatrix.scale(pageNode()->devicePixelRatio());
                if (clip->matrix())
                    clipMatrix *= (*clip->matrix());
            } else if (clip->matrix())
                clipMatrix = *clip->matrix();

            QRectF currentClip;

            if (clip->isRectangular())
                currentClip = clipMatrix.mapRect(clip->clipRect());
            else {
                const QSGGeometry* geometry = clip->geometry();
                // Assume here that clipNode has only coordinate data.
                const QSGGeometry::Point2D* geometryPoints = geometry->vertexDataAsPoint2D();

                // Clip region should be at least triangle to make valid clip.
                if (geometry->vertexCount() < 3)
                    continue;

                QPolygonF polygon;

                for (int i = 0; i < geometry->vertexCount(); i++)
                    polygon.append(clipMatrix.map(QPointF(geometryPoints[i].x, geometryPoints[i].y)));
                currentClip = polygon.boundingRect();
            }

            if (currentClip.isEmpty())
                continue;

            if (resultRect.isValid())
                resultRect &= currentClip;
            else
                resultRect = currentClip;
        }

        return resultRect;
    }
Пример #4
0
void QRawWebView::paint(const QMatrix4x4& transform, float opacity, unsigned paintFlags)
{
    WebKit::DrawingAreaProxy* drawingArea = d->m_webPageProxy->drawingArea();
    if (!drawingArea)
        return;

    WebKit::LayerTreeCoordinatorProxy* coordinatorProxy = drawingArea->layerTreeCoordinatorProxy();
    if (!coordinatorProxy)
        return;

    WebKit::LayerTreeRenderer* renderer = coordinatorProxy->layerTreeRenderer();
    if (!renderer)
        return;

    renderer->setActive(true);
    renderer->syncRemoteContent();

    WebCore::FloatRect rect(0, 0, d->m_size.width(), d->m_size.height());

    renderer->paintToCurrentGLContext(transform, opacity, transform.mapRect(rect), paintFlags);
}