コード例 #1
0
void SVGInlineTextBoxPainter::paint(const PaintInfo& paintInfo, const LayoutPoint& paintOffset)
{
    ASSERT(paintInfo.shouldPaintWithinRoot(&m_svgInlineTextBox.layoutObject()));
    ASSERT(paintInfo.phase == PaintPhaseForeground || paintInfo.phase == PaintPhaseSelection);
    ASSERT(m_svgInlineTextBox.truncation() == cNoTruncation);

    if (m_svgInlineTextBox.layoutObject().style()->visibility() != VISIBLE)
        return;

    // We're explicitly not supporting composition & custom underlines and custom highlighters -- unlike InlineTextBox.
    // If we ever need that for SVG, it's very easy to refactor and reuse the code.

    if (paintInfo.phase == PaintPhaseSelection && !shouldPaintSelection())
        return;

    LayoutSVGInlineText& textLayoutObject = toLayoutSVGInlineText(m_svgInlineTextBox.layoutObject());
    if (!textShouldBePainted(textLayoutObject))
        return;

    DisplayItem::Type displayItemType = DisplayItem::paintPhaseToDrawingType(paintInfo.phase);
    if (!DrawingRecorder::useCachedDrawingIfPossible(*paintInfo.context, m_svgInlineTextBox, displayItemType)) {
        LayoutObject& parentLayoutObject = m_svgInlineTextBox.parent()->layoutObject();
        const ComputedStyle& style = parentLayoutObject.styleRef();

        DrawingRecorder recorder(*paintInfo.context, m_svgInlineTextBox, displayItemType, paintInfo.rect);
        InlineTextBoxPainter(m_svgInlineTextBox).paintDocumentMarkers(
            paintInfo.context, paintOffset, style,
            textLayoutObject.scaledFont(), true);

        if (!m_svgInlineTextBox.textFragments().isEmpty())
            paintTextFragments(paintInfo, parentLayoutObject);
    }
}
コード例 #2
0
void InlineTextBox::paintTextMatchMarkerBackground(const PaintInfo& paintInfo,
                                                   const LayoutPoint& boxOrigin,
                                                   DocumentMarker* marker,
                                                   const ComputedStyle& style,
                                                   const Font& font) const {
  InlineTextBoxPainter(*this).paintTextMatchMarkerBackground(
      paintInfo, boxOrigin, marker, style, font);
}
コード例 #3
0
void InlineTextBox::paintDocumentMarker(GraphicsContext& pt,
                                        const LayoutPoint& boxOrigin,
                                        DocumentMarker* marker,
                                        const ComputedStyle& style,
                                        const Font& font,
                                        bool grammar) const {
  InlineTextBoxPainter(*this).paintDocumentMarker(pt, boxOrigin, marker, style,
                                                  font, grammar);
}
コード例 #4
0
void InlineTextBox::paint(const PaintInfo& paintInfo, const LayoutPoint& paintOffset, LayoutUnit /*lineTop*/, LayoutUnit /*lineBottom*/) const
{
    InlineTextBoxPainter(*this).paint(paintInfo, paintOffset);
}