Beispiel #1
0
void WebViewEfl::setViewBackgroundColor(const WebCore::Color& color)
{
    CoordinatedGraphicsScene* scene = coordinatedGraphicsScene();
    if (!scene)
        return;

    scene->setViewBackgroundColor(color);
}
Beispiel #2
0
WebCore::Color WebViewEfl::viewBackgroundColor()
{
    CoordinatedGraphicsScene* scene = coordinatedGraphicsScene();
    if (!scene)
        return Color();

    return scene->viewBackgroundColor();
}
Beispiel #3
0
void WebView::setActive(bool active)
{
    CoordinatedGraphicsScene* scene = coordinatedGraphicsScene();
    if (!scene || scene->isActive() == active)
        return;

    scene->setActive(active);
    m_page->viewStateDidChange(ViewState::WindowIsActive);
}
Beispiel #4
0
void WebView::paintToCurrentGLContext()
{
    CoordinatedGraphicsScene* scene = coordinatedGraphicsScene();
    if (!scene)
        return;

    const FloatRect& viewport = m_userViewportTransform.mapRect(IntRect(IntPoint(), m_size));

    scene->paintToCurrentGLContext(transformToScene().toTransformationMatrix(), m_opacity, viewport, m_page->pageExtendedBackgroundColor(), m_page->drawsBackground(), m_contentPosition);
}
Beispiel #5
0
void WebView::paintToCurrentGLContext()
{
    CoordinatedGraphicsScene* scene = coordinatedGraphicsScene();
    if (!scene)
        return;

    // FIXME: We need to clean up this code as it is split over CoordGfx and Page.
    scene->setDrawsBackground(m_page->drawsBackground());
    const FloatRect& viewport = m_userViewportTransform.mapRect(IntRect(IntPoint(), m_size));

    scene->paintToCurrentGLContext(transformToScene().toTransformationMatrix(), m_opacity, viewport);
}
Beispiel #6
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);
}
Beispiel #7
0
void WebViewEfl::paintToCairoSurface(cairo_surface_t* surface)
{
    CoordinatedGraphicsScene* scene = coordinatedGraphicsScene();
    if (!scene)
        return;

    PlatformContextCairo context(cairo_create(surface));

    const FloatPoint& position = contentPosition();
    double effectiveScale = m_page->deviceScaleFactor() * contentScaleFactor();

    cairo_matrix_t transform = { effectiveScale, 0, 0, effectiveScale, - position.x() * m_page->deviceScaleFactor(), - position.y() * m_page->deviceScaleFactor() };
    cairo_set_matrix(context.cr(), &transform);
    scene->paintToGraphicsContext(&context, m_page->pageExtendedBackgroundColor(), m_page->drawsBackground());
}
    virtual void render(const RenderState& state)
    {
        TransformationMatrix renderMatrix;
        if (pageNode()->devicePixelRatio() != 1.0) {
            renderMatrix.scale(pageNode()->devicePixelRatio());
            if (matrix())
                renderMatrix.multiply(*matrix());
        } else if (matrix())
            renderMatrix = *matrix();

        // When rendering to an intermediate surface, Qt will
        // mirror the projection matrix to fit on the destination coordinate system.
        const QMatrix4x4* projection = state.projectionMatrix;
        bool mirrored = projection && (*projection)(0, 0) * (*projection)(1, 1) - (*projection)(0, 1) * (*projection)(1, 0) > 0;

        // FIXME: Support non-rectangular clippings.
        coordinatedGraphicsScene()->paintToCurrentGLContext(renderMatrix, inheritedOpacity(), clipRect(), mirrored ? TextureMapper::PaintingMirrored : 0);
    }
 ~ContentsSGNode()
 {
     coordinatedGraphicsScene()->purgeGLResources();
 }
 ContentsSGNode(PassRefPtr<CoordinatedGraphicsScene> scene)
     : m_scene(scene)
 {
     coordinatedGraphicsScene()->setActive(true);
 }
Beispiel #11
0
void WebView::initialize()
{
    m_page->initializeWebPage();
    if (CoordinatedGraphicsScene* scene = coordinatedGraphicsScene())
        scene->setActive(true);
}
Beispiel #12
0
void WebView::exitAcceleratedCompositingMode()
{
    if (CoordinatedGraphicsScene* scene = coordinatedGraphicsScene())
        scene->setActive(false);
}
Beispiel #13
0
void WebView::enterAcceleratedCompositingMode(const LayerTreeContext&)
{
    if (CoordinatedGraphicsScene* scene = coordinatedGraphicsScene())
        scene->setActive(true);
}
Beispiel #14
0
void WebViewNix::didRelaunchProcess()
{
    coordinatedGraphicsScene()->setActive(true);
    m_client.webProcessDidRelaunch(this);
}
Beispiel #15
0
void QRawWebView::setActive(bool active)
{
    d->m_active = active;
    d->m_webPageProxy->viewStateDidChange(WebKit::WebPageProxy::ViewWindowIsActive);
    coordinatedGraphicsScene()->setActive(active);
}