Exemplo n.º 1
0
void GraphicsLayerChromium::updateAnchorPoint()
{
    primaryLayer()->setAnchorPoint(FloatPoint(m_anchorPoint.x(), m_anchorPoint.y()));
    primaryLayer()->setAnchorPointZ(m_anchorPoint.z());

    updateLayerPosition();
}
Exemplo n.º 2
0
void GraphicsLayerChromium::setReplicatedByLayer(GraphicsLayer* layer)
{
    GraphicsLayerChromium* layerChromium = static_cast<GraphicsLayerChromium*>(layer);
    GraphicsLayer::setReplicatedByLayer(layer);
    LayerChromium* replicaLayer = layerChromium ? layerChromium->primaryLayer() : 0;
    primaryLayer()->setReplicaLayer(replicaLayer);
}
Exemplo n.º 3
0
void GraphicsLayerBlackBerry::setReplicatedByLayer(GraphicsLayer* layer)
{
    GraphicsLayerBlackBerry* layerWebKit = static_cast<GraphicsLayerBlackBerry*>(layer);
    GraphicsLayer::setReplicatedByLayer(layer);
    LayerWebKitThread* replicaLayer = layerWebKit ? layerWebKit->primaryLayer() : 0;
    primaryLayer()->setReplicaLayer(replicaLayer);
}
Exemplo n.º 4
0
void GraphicsLayerChromium::suspendAnimations(double wallClockTime)
{
    // |wallClockTime| is in the wrong time base. Need to convert here.
    // FIXME: find a more reliable way to do this.
    double monotonicTime = wallClockTime + monotonicallyIncreasingTime() - currentTime();
    primaryLayer().suspendAnimations(monotonicTime);
}
Exemplo n.º 5
0
void GraphicsLayerBlackBerry::updateFilters()
{
    if (!m_filters.size())
        return;

    primaryLayer()->setFilters(m_filters);
}
Exemplo n.º 6
0
bool GraphicsLayerChromium::addAnimation(const KeyframeValueList& values, const IntSize& boxSize, const Animation* animation, const String& animationName, double timeOffset)
{
    primaryLayer().setAnimationDelegate(this);

    int animationId = mapAnimationNameToId(animationName);
    int groupId = AnimationIdVendor::getNextGroupId();

    OwnPtr<WebKit::WebAnimation> toAdd(createWebAnimation(values, animation, animationId, groupId, timeOffset, boxSize));

    if (toAdd.get()) {
        // Remove any existing animations with the same animation id and target property.
        primaryLayer().removeAnimation(animationId, toAdd->targetProperty());
        return primaryLayer().addAnimation(*toAdd);
    }

    return false;
}
Exemplo n.º 7
0
void GraphicsLayerChromium::updateLayerPosition()
{
    // Position is offset on the layer by the layer anchor point.
    FloatPoint layerPosition(m_position.x() + m_anchorPoint.x() * m_size.width(),
                             m_position.y() + m_anchorPoint.y() * m_size.height());

    primaryLayer()->setPosition(layerPosition);
}
void GraphicsLayerCACF::updateLayerPosition()
{
    // Position is offset on the layer by the layer anchor point.
    CGPoint posPoint = CGPointMake(m_position.x() + m_anchorPoint.x() * m_size.width(),
                                   m_position.y() + m_anchorPoint.y() * m_size.height());
    
    primaryLayer()->setPosition(posPoint);
}
Exemplo n.º 9
0
void GraphicsLayerChromium::updateLayerPreserves3D()
{
    if (m_preserves3D && m_transformLayer.isNull()) {
        // Create the transform layer.
        m_transformLayer = WebLayer::create();
        m_transformLayer.setPreserves3D(true);
        m_transformLayer.setAnimationDelegate(this);
        m_layer.transferAnimationsTo(&m_transformLayer);

        // Copy the position from this layer.
        updateLayerPosition();
        updateLayerSize();
        updateAnchorPoint();
        updateTransform();
        updateChildrenTransform();

        m_layer.setPosition(FloatPoint::zero());

        m_layer.setAnchorPoint(FloatPoint(0.5f, 0.5f));
        m_layer.setTransform(SkMatrix44());

        // Set the old layer to opacity of 1. Further down we will set the opacity on the transform layer.
        m_layer.setOpacity(1);

        m_layer.setContentsScale(contentsScale());

        // Move this layer to be a child of the transform layer.
        if (!m_layer.parent().isNull())
            m_layer.parent().replaceChild(m_layer, m_transformLayer);
        m_transformLayer.addChild(m_layer);

        updateChildList();
    } else if (!m_preserves3D && !m_transformLayer.isNull()) {
        // Relace the transformLayer in the parent with this layer.
        m_layer.removeFromParent();
        if (!m_transformLayer.parent().isNull())
            m_transformLayer.parent().replaceChild(m_transformLayer, m_layer);

        m_layer.setAnimationDelegate(this);
        m_transformLayer.transferAnimationsTo(&m_layer);

        // Release the transform layer.
        m_transformLayer.setAnimationDelegate(0);
        m_transformLayer.reset();

        updateLayerPosition();
        updateLayerSize();
        updateAnchorPoint();
        updateTransform();
        updateChildrenTransform();

        updateChildList();
    }

    m_layer.setPreserves3D(m_preserves3D);
    primaryLayer().setOpacity(m_opacity);
    updateNames();
}
Exemplo n.º 10
0
void GraphicsLayerChromium::setOpacity(float opacity)
{
    float clampedOpacity = max(min(opacity, 1.0f), 0.0f);

    if (m_opacity == clampedOpacity)
        return;

    GraphicsLayer::setOpacity(clampedOpacity);
    primaryLayer()->setOpacity(opacity);
}
Exemplo n.º 11
0
void GraphicsLayerBlackBerry::setOpacity(float opacity)
{
    float clampedOpacity = clampTo(opacity, 0.0f, 1.0f);

    if (m_opacity == clampedOpacity)
        return;

    GraphicsLayer::setOpacity(clampedOpacity);
    primaryLayer()->setOpacity(opacity);
}
Exemplo n.º 12
0
void GraphicsLayerChromium::setReplicatedByLayer(GraphicsLayer* layer)
{
    GraphicsLayerChromium* layerChromium = static_cast<GraphicsLayerChromium*>(layer);
    GraphicsLayer::setReplicatedByLayer(layer);

    WebLayer webReplicaLayer;
    if (layerChromium)
        webReplicaLayer = layerChromium->primaryLayer();
    primaryLayer().setReplicaLayer(webReplicaLayer);
}
Exemplo n.º 13
0
void GraphicsLayerChromium::updateLayerPreserves3D()
{
    if (m_preserves3D && !m_transformLayer) {
        // Create the transform layer.
        m_transformLayer = LayerChromium::create();
        m_transformLayer->setPreserves3D(true);
        m_transformLayer->setLayerAnimationDelegate(this);

        // Copy the position from this layer.
        updateLayerPosition();
        updateLayerSize();
        updateAnchorPoint();
        updateTransform();
        updateChildrenTransform();

        m_layer->setPosition(FloatPoint(m_size.width() / 2.0f, m_size.height() / 2.0f));

        m_layer->setAnchorPoint(FloatPoint(0.5f, 0.5f));
        TransformationMatrix identity;
        m_layer->setTransform(identity);

        // Set the old layer to opacity of 1. Further down we will set the opacity on the transform layer.
        m_layer->setOpacity(1);

        m_layer->setContentsScale(contentsScale());

        // Move this layer to be a child of the transform layer.
        if (m_layer->parent())
            m_layer->parent()->replaceChild(m_layer.get(), m_transformLayer.get());
        m_transformLayer->addChild(m_layer.get());

        updateChildList();
    } else if (!m_preserves3D && m_transformLayer) {
        // Relace the transformLayer in the parent with this layer.
        m_layer->removeFromParent();
        if (m_transformLayer->parent())
            m_transformLayer->parent()->replaceChild(m_transformLayer.get(), m_layer.get());

        // Release the transform layer.
        m_transformLayer->setLayerAnimationDelegate(0);
        m_transformLayer = 0;

        updateLayerPosition();
        updateLayerSize();
        updateAnchorPoint();
        updateTransform();
        updateChildrenTransform();

        updateChildList();
    }

    m_layer->setPreserves3D(m_preserves3D);
    primaryLayer()->setOpacity(m_opacity);
    updateNames();
}
Exemplo n.º 14
0
void GraphicsLayerBlackBerry::updateAnimations()
{
    // When there is a transform layer, the transform must be set on that layer
    // instead of the content layer. Opacity can be set on the transform layer or the
    // layer with equal outcome, but currently it is also set on the transform
    // layer. Since we only accelerate animations of these two properties, it
    // is safe to move all accelerated animations to the transform layer, and
    // remove them from the layer proper.
    // So the following code, while it looks strange, is correct:
    // we transfer all animations to the transform layer if it exists.
    // FIXME: If other properties become animated, it may not be equivalent to
    // move them to the transform layer. Then this code needs to be revisited
    // to only move the transform animations to the transform layer.
    primaryLayer()->setRunningAnimations(m_runningAnimations);
    primaryLayer()->setSuspendedAnimations(m_suspendedAnimations);

    // We need to move the animations to the transform layer if there is one.
    if (m_transformLayer) {
        m_layer->setRunningAnimations(Vector<RefPtr<LayerAnimation> >());
        m_layer->setSuspendedAnimations(Vector<RefPtr<LayerAnimation> >());
    }
}
Exemplo n.º 15
0
void GraphicsLayerChromium::updateTransform()
{
    primaryLayer()->setTransform(m_transform);
}
void GraphicsLayerCACF::updateChildrenTransform()
{
    CATransform3D transform;
    copyTransform(transform, m_childrenTransform);
    primaryLayer()->setSublayerTransform(transform);
}
Exemplo n.º 17
0
PlatformLayer* GraphicsLayerBlackBerry::platformLayer() const
{
    return primaryLayer();
}
Exemplo n.º 18
0
PlatformLayer* GraphicsLayerChromium::platformLayer() const
{
    return primaryLayer();
}
Exemplo n.º 19
0
void GraphicsLayerChromium::resumeAnimations()
{
    primaryLayer()->resumeAnimations();
}
Exemplo n.º 20
0
void GraphicsLayerChromium::suspendAnimations(double time)
{
    primaryLayer()->suspendAnimations(time);
}
Exemplo n.º 21
0
// This function simply mimics the operation of GraphicsLayerCA
void GraphicsLayerBlackBerry::updateOpacityOnLayer()
{
    primaryLayer()->setOpacity(m_opacity);
}
Exemplo n.º 22
0
void GraphicsLayerChromium::pauseAnimation(const String& animationName, double timeOffset)
{
    primaryLayer()->pauseAnimation(mapAnimationNameToId(animationName), timeOffset);
}
Exemplo n.º 23
0
bool GraphicsLayerChromium::addAnimation(const KeyframeValueList& values, const IntSize& boxSize, const Animation* animation, const String& animationName, double timeOffset)
{
    primaryLayer()->setLayerAnimationDelegate(this);
    return primaryLayer()->addAnimation(values, boxSize, animation, mapAnimationNameToId(animationName), s_nextGroupId++, timeOffset);
}
Exemplo n.º 24
0
void GraphicsLayerBlackBerry::updateBoundsOrigin()
{
    primaryLayer()->setBoundsOrigin(m_boundsOrigin);
}
Exemplo n.º 25
0
// This function simply mimics the operation of GraphicsLayerCA
void GraphicsLayerChromium::updateOpacityOnLayer()
{
    primaryLayer()->setOpacity(m_opacity);
}
Exemplo n.º 26
0
void GraphicsLayerBlackBerry::updateTransform()
{
    primaryLayer()->setTransform(m_transform);
}
Exemplo n.º 27
0
void GraphicsLayerBlackBerry::updateChildrenTransform()
{
    primaryLayer()->setSublayerTransform(m_childrenTransform);
}
Exemplo n.º 28
0
void GraphicsLayerChromium::updateChildrenTransform()
{
    primaryLayer()->setSublayerTransform(m_childrenTransform);
}
Exemplo n.º 29
0
void GraphicsLayerClutter::updateTransform()
{
    CoglMatrix matrix = m_transform;
    graphicsLayerActorSetTransform(primaryLayer(), &matrix);
}
Exemplo n.º 30
0
void GraphicsLayerChromium::removeAnimation(const String& animationName)
{
    primaryLayer()->removeAnimation(mapAnimationNameToId(animationName));
}