std::unique_ptr<SVGFilterBuilder> RenderSVGResourceFilter::buildPrimitives(SVGFilter& filter) const
{
    static const unsigned maxCountChildNodes = 200;
    if (filterElement().countChildNodes() > maxCountChildNodes)
        return nullptr;

    FloatRect targetBoundingBox = filter.targetBoundingBox();

    // Add effects to the builder
    auto builder = std::make_unique<SVGFilterBuilder>(SourceGraphic::create(filter));
    for (auto& element : childrenOfType<SVGFilterPrimitiveStandardAttributes>(filterElement())) {
        RefPtr<FilterEffect> effect = element.build(builder.get(), filter);
        if (!effect) {
            builder->clearEffects();
            return nullptr;
        }
        builder->appendEffectToEffectReferences(effect.copyRef(), element.renderer());
        element.setStandardAttributes(effect.get());
        effect->setEffectBoundaries(SVGLengthContext::resolveRectangle<SVGFilterPrimitiveStandardAttributes>(&element, filterElement().primitiveUnits(), targetBoundingBox));
        if (element.renderer())
            effect->setOperatingColorSpace(element.renderer()->style().svgStyle().colorInterpolationFilters() == CI_LINEARRGB ? ColorSpaceLinearRGB : ColorSpaceSRGB);
        builder->add(element.result(), WTFMove(effect));
    }
    return builder;
}
Example #2
0
void CPixmap::addEffect(const CEffect & effect) {
    switch (effect.effect) {
    case CEffect::ClearEffects:
        clearEffects();
        break;
    case CEffect::FlipH:
        toHFlip();
        break;
    case CEffect::FlipV:
        toVFlip();
        break;
    case CEffect::InvertColors:
        toInvertedColors();
        break;
    case CEffect::NVG:
        toNVG();
        break;
    case CEffect::BlackAndWhite:
        toBlackAndWhite();
        break;
    case CEffect::Glow:
        toGlow((int)effect.param);
        break;
    case CEffect::Sepia:
        toSepia();
        break;
    }
}
Example #3
0
void Animation::willDetach()
{
    if (m_target)
        m_target->activeAnimations()->players().remove(player());
    if (m_activeInAnimationStack)
        clearEffects();
}
void KeyframeEffectReadOnly::detach() {
  if (m_target)
    m_target->elementAnimations()->animations().remove(animation());
  if (m_sampledEffect)
    clearEffects();
  AnimationEffectReadOnly::detach();
}
Example #5
0
void CPixmap::addEffect(const PictureEffect & effect) {
    switch (effect.effect) {
        case PictureEffect::ClearEffects:
            clearEffects();
            break;
        case PictureEffect::FlipH:
            toHFlip();
            break;
        case PictureEffect::FlipV:
            toVFlip();
            break;
        case PictureEffect::InvertColors:
            toInvertedColors();
            break;
        case PictureEffect::NVG:
            toNVG();
            break;
        case PictureEffect::BlackAndWhite:
            toBlackAndWhite();
            break;
        case PictureEffect::Glow:
            toGlow((int)effect.param);
            break;
        case PictureEffect::Sepia:
            toSepia();
            break;
        case PictureEffect::Opacity:
            m_effects.push_back(PictureEffect(PictureEffect::Opacity, (qreal)effect.param));
            break;
        case PictureEffect::Crop:
            crop(effect.cropingRect);
            break;
    }
}
Example #6
0
void Animation::detach()
{
    if (m_target)
        m_target->activeAnimations()->players().remove(player());
    if (m_sampledEffect)
        clearEffects();
    AnimationNode::detach();
}
//Clears everything
void Simulation::reset()
{
	memset(u, 0, size);
	memset(v, 0, size);
	memset(w, 0, size);
	memset(dens, 0, size);
	clearEffects();
}
Example #8
0
void EffectsManager::show()
{
    if (!showed)
    {
        clearEffects();
    view.setFlags(Qt::CustomizeWindowHint | Qt::FramelessWindowHint | Qt::WindowTitleHint);

    if (QGuiApplication::platformName() == QLatin1String("qnx") || \
            QGuiApplication::platformName() == QLatin1String("eglfs")) {\
        view.showFullScreen();\
    } else {\
        view.show();\
    }\
    emit showSignal();
    showed=true;
    }
}
Example #9
0
std::unique_ptr<SVGFilterBuilder> RenderSVGResourceFilter::buildPrimitives(SVGFilter* filter)
{
    FloatRect targetBoundingBox = filter->targetBoundingBox();

    // Add effects to the builder
    auto builder = std::make_unique<SVGFilterBuilder>(SourceGraphic::create(filter), SourceAlpha::create(filter));
    auto children = childrenOfType<SVGFilterPrimitiveStandardAttributes>(filterElement());
    for (auto element = children.begin(), end = children.end(); element != end; ++element) {
        RefPtr<FilterEffect> effect = element->build(builder.get(), filter);
        if (!effect) {
            builder->clearEffects();
            return nullptr;
        }
        builder->appendEffectToEffectReferences(effect, element->renderer());
        element->setStandardAttributes(effect.get());
        effect->setEffectBoundaries(SVGLengthContext::resolveRectangle<SVGFilterPrimitiveStandardAttributes>(&*element, filterElement().primitiveUnits(), targetBoundingBox));
        effect->setOperatingColorSpace(element->renderer()->style()->svgStyle()->colorInterpolationFilters() == CI_LINEARRGB ? ColorSpaceLinearRGB : ColorSpaceDeviceRGB);
        builder->add(element->result(), effect.release());
    }
    return builder;
}