コード例 #1
0
void GraphicsLayerChromium::setupContentsLayer(LayerChromium* contentsLayer)
{
    if (contentsLayer == m_contentsLayer)
        return;

    if (m_contentsLayer) {
        m_contentsLayer->removeFromParent();
        m_contentsLayer = 0;
    }

    if (contentsLayer) {
        m_contentsLayer = contentsLayer;

        m_contentsLayer->setAnchorPoint(FloatPoint(0, 0));

        // It is necessary to update setIsDrawable as soon as we receive the new contentsLayer, for
        // the correctness of early exit conditions in setDrawsContent() and setContentsVisible().
        m_contentsLayer->setIsDrawable(m_contentsVisible);

        // Insert the content layer first. Video elements require this, because they have
        // shadow content that must display in front of the video.
        m_layer->insertChild(m_contentsLayer.get(), 0);

        if (showDebugBorders()) {
            m_contentsLayer->setDebugBorderColor(Color(0, 0, 128, 180));
            m_contentsLayer->setDebugBorderWidth(1);
        }
    }
    updateDebugIndicators();
    updateNames();
}
コード例 #2
0
void GraphicsLayerChromium::setupContentsLayer(LayerChromium* contentsLayer)
{
    if (contentsLayer == m_contentsLayer)
        return;

    if (m_contentsLayer) {
        m_contentsLayer->removeFromSuperlayer();
        m_contentsLayer = 0;
    }

    if (contentsLayer) {
        m_contentsLayer = contentsLayer;

        m_contentsLayer->setAnchorPoint(FloatPoint(0, 0));

        // Insert the content layer first. Video elements require this, because they have
        // shadow content that must display in front of the video.
        m_layer->insertSublayer(m_contentsLayer.get(), 0);

        updateContentsRect();

        if (showDebugBorders()) {
            setLayerBorderColor(*m_contentsLayer, Color(0, 0, 128, 180));
            m_contentsLayer->setBorderWidth(1);
        }
    }
    updateDebugIndicators();
}
コード例 #3
0
void GraphicsLayerBlackBerry::setupContentsLayer(LayerWebKitThread* contentsLayer)
{
    if (contentsLayer == m_contentsLayer)
        return;

    if (m_contentsLayer) {
        m_contentsLayer->removeFromSuperlayer();
        m_contentsLayer = 0;
    }

    if (contentsLayer) {
        m_contentsLayer = contentsLayer;

        m_contentsLayer->setAnchorPoint(FloatPoint::zero());

        // It is necessary to update setDrawable as soon as we receive the new contentsLayer, for
        // the correctness of early exit conditions in setDrawsContent() and setContentsVisible().
        m_contentsLayer->setDrawable(m_contentsVisible);

        // Insert the content layer first. Video elements require this, because they have
        // shadow content that must display in front of the video.
        m_layer->insertSublayer(m_contentsLayer.get(), 0);

        updateContentsRect();

        if (showDebugBorders()) {
            setLayerBorderColor(*m_contentsLayer, Color(0, 0, 128, 180));
            m_contentsLayer->setBorderWidth(1);
        }
    }
    updateDebugIndicators();
}
コード例 #4
0
void GraphicsLayerChromium::setupContentsLayer(WebLayer contentsLayer)
{
    if (contentsLayer == m_contentsLayer)
        return;

    if (!m_contentsLayer.isNull()) {
        m_contentsLayer.setUseParentBackfaceVisibility(false);
        m_contentsLayer.removeFromParent();
        m_contentsLayer.reset();
    }

    m_contentsLayer = contentsLayer;

    if (!m_contentsLayer.isNull()) {
        m_contentsLayer.setAnchorPoint(FloatPoint(0, 0));
        m_contentsLayer.setUseParentBackfaceVisibility(true);

        // It is necessary to call setDrawsContent as soon as we receive the new contentsLayer, for
        // the correctness of early exit conditions in setDrawsContent() and setContentsVisible().
        m_contentsLayer.setDrawsContent(m_contentsVisible);

        // Insert the content layer first. Video elements require this, because they have
        // shadow content that must display in front of the video.
        m_layer.insertChild(m_contentsLayer, 0);

        if (showDebugBorders()) {
            m_contentsLayer.setDebugBorderColor(Color(0, 0, 128, 180).rgb());
            m_contentsLayer.setDebugBorderWidth(1);
        }
    }
    updateDebugIndicators();
    updateNames();
}
コード例 #5
0
void GraphicsLayerCACF::setupContentsLayer(WKCACFLayer* contentsLayer)
{
    if (contentsLayer == m_contentsLayer)
        return;

    if (m_contentsLayer) {
        m_contentsLayer->removeFromSuperlayer();
        m_contentsLayer = 0;
    }
    
    if (contentsLayer) {
        m_contentsLayer = contentsLayer;

        if (defaultContentsOrientation() == CompositingCoordinatesBottomUp) {
            CATransform3D flipper = {
                1.0f, 0.0f, 0.0f, 0.0f,
                0.0f, -1.0f, 0.0f, 0.0f,
                0.0f, 0.0f, 1.0f, 0.0f,
                0.0f, 0.0f, 0.0f, 1.0f};
            m_contentsLayer->setTransform(flipper);
            m_contentsLayer->setAnchorPoint(CGPointMake(0.0f, 1.0f));
        } else
            m_contentsLayer->setAnchorPoint(CGPointMake(0.0f, 0.0f));

        // Insert the content layer first. Video elements require this, because they have
        // shadow content that must display in front of the video.
        m_layer->insertSublayer(m_contentsLayer.get(), 0);

        updateContentsRect();

        if (showDebugBorders()) {
            setLayerBorderColor(m_contentsLayer.get(), Color(0, 0, 128, 180));
            m_contentsLayer->setBorderWidth(1.0f);
        }
    }
    updateDebugIndicators();
}