示例#1
0
void LayerTreeRenderer::setLayerAnimations(CoordinatedLayerID id, const GraphicsLayerAnimations& animations)
{
    GraphicsLayerTextureMapper* layer = toGraphicsLayerTextureMapper(layerByID(id));
#if ENABLE(CSS_SHADERS)
    for (size_t i = 0; i < animations.animations().size(); ++i) {
        const KeyframeValueList& keyframes = animations.animations().at(i).keyframes();
        if (keyframes.property() != AnimatedPropertyWebkitFilter)
            continue;
        for (size_t j = 0; j < keyframes.size(); ++j) {
            const FilterAnimationValue* filterValue = static_cast<const FilterAnimationValue*>(keyframes.at(i));
            injectCachedCustomFilterPrograms(*filterValue->value());
        }
    }
#endif
    layer->setAnimations(animations);
}
void CoordinatedGraphicsScene::setLayerAnimationsIfNeeded(GraphicsLayer* graphicsLayer, const CoordinatedGraphicsLayerState& state)
{
    if (!state.animationsChanged)
        return;

    GraphicsLayerTextureMapper* layer = toGraphicsLayerTextureMapper(graphicsLayer);

#if ENABLE(CSS_SHADERS)
    for (size_t i = 0; i < state.animations.animations().size(); ++i) {
        const KeyframeValueList& keyframes = state.animations.animations().at(i).keyframes();
        if (keyframes.property() != AnimatedPropertyWebkitFilter)
            continue;
        for (size_t j = 0; j < keyframes.size(); ++j) {
            const FilterAnimationValue* filterValue = static_cast<const FilterAnimationValue*>(keyframes.at(i));
            injectCachedCustomFilterPrograms(*filterValue->value());
        }
    }
#endif
    layer->setAnimations(state.animations);
}
PassOwnPtr<GraphicsLayer> LayerTreeRenderer::createLayer(WebLayerID)
{
    GraphicsLayerTextureMapper* newLayer = new GraphicsLayerTextureMapper(this);
    newLayer->setHasOwnBackingStore(false);
    return adoptPtr(newLayer);
}