Ejemplo n.º 1
0
void SVGFilterPainter::finishEffect(const LayoutObject& object, SVGFilterRecordingContext& recordingContext)
{
    FilterData* filterData = m_filter.getFilterDataForLayoutObject(&object);
    if (filterData) {
        // A painting cycle can occur when an FeImage references a source that
        // makes use of the FeImage itself. This is the first place we would hit
        // the cycle so we reset the state and continue.
        if (filterData->m_state == FilterData::PaintingFilterCycleDetected)
            filterData->m_state = FilterData::PaintingFilter;

        // Check for RecordingContent here because we may can be re-painting
        // without re-recording the contents to be filtered.
        if (filterData->m_state == FilterData::RecordingContent)
            recordingContext.endContent(filterData);

        if (filterData->m_state == FilterData::RecordingContentCycleDetected)
            filterData->m_state = FilterData::RecordingContent;
    }

    GraphicsContext& context = recordingContext.paintingContext();
    if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(context, object, DisplayItem::SVGFilter, LayoutPoint()))
        return;

    // TODO(chrishtr): stop using an infinite rect, and instead bound the filter.
    LayoutObjectDrawingRecorder recorder(context, object, DisplayItem::SVGFilter, LayoutRect::infiniteIntRect(), LayoutPoint());
    if (filterData && filterData->m_state == FilterData::ReadyToPaint)
        paintFilteredContent(object, context, filterData);
}
Ejemplo n.º 2
0
void SVGFilterPainter::finishEffect(
    const LayoutObject& object,
    SVGFilterRecordingContext& recordingContext) {
  FilterData* filterData = m_filter.getFilterDataForLayoutObject(&object);
  if (filterData) {
    // A painting cycle can occur when an FeImage references a source that
    // makes use of the FeImage itself. This is the first place we would hit
    // the cycle so we reset the state and continue.
    if (filterData->m_state == FilterData::PaintingFilterCycleDetected)
      filterData->m_state = FilterData::PaintingFilter;

    // Check for RecordingContent here because we may can be re-painting
    // without re-recording the contents to be filtered.
    if (filterData->m_state == FilterData::RecordingContent)
      recordingContext.endContent(filterData);

    if (filterData->m_state == FilterData::RecordingContentCycleDetected)
      filterData->m_state = FilterData::RecordingContent;
  }
  paintFilteredContent(recordingContext.paintingContext(), object, filterData);
}