Ejemplo n.º 1
0
static void endDeferredFilter(GraphicsContext* context, FilterData* filterData)
{
    // FIXME: maybe filterData should just hold onto SourceGraphic after creation?
    SourceGraphic* sourceGraphic = static_cast<SourceGraphic*>(filterData->builder->getEffectById(SourceGraphic::effectName()));
    ASSERT(sourceGraphic);
    sourceGraphic->setPicture(context->endRecording());
}
Ejemplo n.º 2
0
void SVGFilterRecordingContext::endContent(FilterData* filterData)
{
    ASSERT(filterData->m_state == FilterData::RecordingContent);

    SourceGraphic* sourceGraphic = filterData->filter->sourceGraphic();
    ASSERT(sourceGraphic);

    GraphicsContext* context = &paintingContext();

    // Use the context that contains the filtered content.
    ASSERT(m_paintController);
    ASSERT(m_context);
    context = m_context.get();
    context->beginRecording(filterData->filter->filterRegion());
    m_paintController->commitNewDisplayItems();
    m_paintController->paintArtifact().replay(*context);

    sourceGraphic->setPicture(context->endRecording());

    // Content is cached by the source graphic so temporaries can be freed.
    m_paintController = nullptr;
    m_context = nullptr;

    filterData->m_state = FilterData::ReadyToPaint;
}