| Index: third_party/WebKit/Source/core/paint/SVGInlineTextBoxPainter.cpp
|
| diff --git a/third_party/WebKit/Source/core/paint/SVGInlineTextBoxPainter.cpp b/third_party/WebKit/Source/core/paint/SVGInlineTextBoxPainter.cpp
|
| index ea2921a029127240d2b3366bdfc5e5c5fa211eaf..c135ec20d9b3622a26a0c4bb5a41648cf579c357 100644
|
| --- a/third_party/WebKit/Source/core/paint/SVGInlineTextBoxPainter.cpp
|
| +++ b/third_party/WebKit/Source/core/paint/SVGInlineTextBoxPainter.cpp
|
| @@ -9,6 +9,7 @@
|
| #include "core/editing/markers/RenderedDocumentMarker.h"
|
| #include "core/frame/LocalFrame.h"
|
| #include "core/layout/LayoutTheme.h"
|
| +#include "core/layout/api/LineLayoutAPIShim.h"
|
| #include "core/layout/api/SelectionState.h"
|
| #include "core/layout/line/InlineFlowBox.h"
|
| #include "core/layout/svg/LayoutSVGInlineText.h"
|
| @@ -17,7 +18,6 @@
|
| #include "core/layout/svg/line/SVGInlineTextBox.h"
|
| #include "core/paint/InlineTextBoxPainter.h"
|
| #include "core/paint/LayoutObjectDrawingRecorder.h"
|
| -#include "core/paint/LineLayoutPaintShim.h"
|
| #include "core/paint/PaintInfo.h"
|
| #include "core/paint/SVGPaintContext.h"
|
| #include "core/style/ShadowList.h"
|
| @@ -51,13 +51,13 @@ void SVGInlineTextBoxPainter::paint(const PaintInfo& paintInfo, const LayoutPoin
|
| if (paintInfo.phase == PaintPhaseSelection && !shouldPaintSelection(paintInfo))
|
| return;
|
|
|
| - LayoutSVGInlineText& textLayoutObject = toLayoutSVGInlineText(*LineLayoutPaintShim::layoutObjectFrom(m_svgInlineTextBox.lineLayoutItem()));
|
| + LayoutSVGInlineText& textLayoutObject = toLayoutSVGInlineText(*LineLayoutAPIShim::layoutObjectFrom(m_svgInlineTextBox.lineLayoutItem()));
|
| if (!textShouldBePainted(textLayoutObject))
|
| return;
|
|
|
| DisplayItem::Type displayItemType = DisplayItem::paintPhaseToDrawingType(paintInfo.phase);
|
| if (!DrawingRecorder::useCachedDrawingIfPossible(paintInfo.context, m_svgInlineTextBox, displayItemType)) {
|
| - LayoutObject& parentLayoutObject = *LineLayoutPaintShim::layoutObjectFrom(m_svgInlineTextBox.parent()->lineLayoutItem());
|
| + LayoutObject& parentLayoutObject = *LineLayoutAPIShim::layoutObjectFrom(m_svgInlineTextBox.parent()->lineLayoutItem());
|
| const ComputedStyle& style = parentLayoutObject.styleRef();
|
|
|
| // TODO(chrishtr): passing the cull rect is incorrect.
|
| @@ -160,7 +160,7 @@ void SVGInlineTextBoxPainter::paintSelectionBackground(const PaintInfo& paintInf
|
| if (!backgroundColor.alpha())
|
| return;
|
|
|
| - LayoutSVGInlineText& textLayoutObject = toLayoutSVGInlineText(*LineLayoutPaintShim::layoutObjectFrom(m_svgInlineTextBox.lineLayoutItem()));
|
| + LayoutSVGInlineText& textLayoutObject = toLayoutSVGInlineText(*LineLayoutAPIShim::layoutObjectFrom(m_svgInlineTextBox.lineLayoutItem()));
|
| if (!textShouldBePainted(textLayoutObject))
|
| return;
|
|
|
| @@ -186,7 +186,7 @@ static inline LayoutObject* findLayoutObjectDefininingTextDecoration(InlineFlowB
|
| // Lookup first layout object in parent hierarchy which has text-decoration set.
|
| LayoutObject* layoutObject = 0;
|
| while (parentBox) {
|
| - layoutObject = LineLayoutPaintShim::layoutObjectFrom(parentBox->lineLayoutItem());
|
| + layoutObject = LineLayoutAPIShim::layoutObjectFrom(parentBox->lineLayoutItem());
|
|
|
| if (layoutObject->style() && layoutObject->style()->textDecoration() != TextDecorationNone)
|
| break;
|
| @@ -289,7 +289,7 @@ void SVGInlineTextBoxPainter::paintDecoration(const PaintInfo& paintInfo, TextDe
|
| bool SVGInlineTextBoxPainter::setupTextPaint(const PaintInfo& paintInfo, const ComputedStyle& style,
|
| LayoutSVGResourceMode resourceMode, SkPaint& paint)
|
| {
|
| - LayoutSVGInlineText& textLayoutObject = toLayoutSVGInlineText(*LineLayoutPaintShim::layoutObjectFrom(m_svgInlineTextBox.lineLayoutItem()));
|
| + LayoutSVGInlineText& textLayoutObject = toLayoutSVGInlineText(*LineLayoutAPIShim::layoutObjectFrom(m_svgInlineTextBox.lineLayoutItem()));
|
|
|
| float scalingFactor = textLayoutObject.scalingFactor();
|
| ASSERT(scalingFactor);
|
| @@ -308,7 +308,7 @@ bool SVGInlineTextBoxPainter::setupTextPaint(const PaintInfo& paintInfo, const C
|
| additionalPaintServerTransform = &paintServerTransform;
|
| }
|
|
|
| - if (!SVGPaintContext::paintForLayoutObject(paintInfo, style, *LineLayoutPaintShim::layoutObjectFrom(m_svgInlineTextBox.parent()->lineLayoutItem()), resourceMode, paint, additionalPaintServerTransform))
|
| + if (!SVGPaintContext::paintForLayoutObject(paintInfo, style, *LineLayoutAPIShim::layoutObjectFrom(m_svgInlineTextBox.parent()->lineLayoutItem()), resourceMode, paint, additionalPaintServerTransform))
|
| return false;
|
| paint.setAntiAlias(true);
|
|
|
| @@ -320,7 +320,7 @@ bool SVGInlineTextBoxPainter::setupTextPaint(const PaintInfo& paintInfo, const C
|
|
|
| if (resourceMode == ApplyToStrokeMode) {
|
| StrokeData strokeData;
|
| - SVGLayoutSupport::applyStrokeStyleToStrokeData(strokeData, style, *LineLayoutPaintShim::layoutObjectFrom(m_svgInlineTextBox.parent()->lineLayoutItem()));
|
| + SVGLayoutSupport::applyStrokeStyleToStrokeData(strokeData, style, *LineLayoutAPIShim::layoutObjectFrom(m_svgInlineTextBox.parent()->lineLayoutItem()));
|
| if (style.svgStyle().vectorEffect() != VE_NON_SCALING_STROKE)
|
| strokeData.setThickness(strokeData.thickness() * scalingFactor);
|
| strokeData.setupPaint(&paint);
|
| @@ -330,7 +330,7 @@ bool SVGInlineTextBoxPainter::setupTextPaint(const PaintInfo& paintInfo, const C
|
|
|
| void SVGInlineTextBoxPainter::paintText(const PaintInfo& paintInfo, TextRun& textRun, const SVGTextFragment& fragment, int startPosition, int endPosition, const SkPaint& paint)
|
| {
|
| - LayoutSVGInlineText& textLayoutObject = toLayoutSVGInlineText(*LineLayoutPaintShim::layoutObjectFrom(m_svgInlineTextBox.lineLayoutItem()));
|
| + LayoutSVGInlineText& textLayoutObject = toLayoutSVGInlineText(*LineLayoutAPIShim::layoutObjectFrom(m_svgInlineTextBox.lineLayoutItem()));
|
| const Font& scaledFont = textLayoutObject.scaledFont();
|
|
|
| float scalingFactor = textLayoutObject.scalingFactor();
|
| @@ -391,7 +391,7 @@ void SVGInlineTextBoxPainter::paintText(const PaintInfo& paintInfo, const Comput
|
| if (style != selectionStyle) {
|
| StyleDifference diff;
|
| diff.setNeedsPaintInvalidationObject();
|
| - SVGResourcesCache::clientStyleChanged(LineLayoutPaintShim::layoutObjectFrom(m_svgInlineTextBox.parent()->lineLayoutItem()), diff, selectionStyle);
|
| + SVGResourcesCache::clientStyleChanged(LineLayoutAPIShim::layoutObjectFrom(m_svgInlineTextBox.parent()->lineLayoutItem()), diff, selectionStyle);
|
| }
|
|
|
| SkPaint paint;
|
| @@ -401,7 +401,7 @@ void SVGInlineTextBoxPainter::paintText(const PaintInfo& paintInfo, const Comput
|
| if (style != selectionStyle) {
|
| StyleDifference diff;
|
| diff.setNeedsPaintInvalidationObject();
|
| - SVGResourcesCache::clientStyleChanged(LineLayoutPaintShim::layoutObjectFrom(m_svgInlineTextBox.parent()->lineLayoutItem()), diff, style);
|
| + SVGResourcesCache::clientStyleChanged(LineLayoutAPIShim::layoutObjectFrom(m_svgInlineTextBox.parent()->lineLayoutItem()), diff, style);
|
| }
|
|
|
| // Eventually draw text using regular style from the end position of the selection to the end of the current chunk part
|
| @@ -420,7 +420,7 @@ Vector<SVGTextFragmentWithRange> SVGInlineTextBoxPainter::collectTextMatches(Doc
|
| if (marker->type() != DocumentMarker::TextMatch)
|
| return emptyTextMatchList;
|
|
|
| - if (!LineLayoutPaintShim::layoutObjectFrom(m_svgInlineTextBox.lineLayoutItem())->frame()->editor().markedTextMatchesAreHighlighted())
|
| + if (!LineLayoutAPIShim::layoutObjectFrom(m_svgInlineTextBox.lineLayoutItem())->frame()->editor().markedTextMatchesAreHighlighted())
|
| return emptyTextMatchList;
|
|
|
| int markerStartPosition = std::max<int>(marker->startOffset() - m_svgInlineTextBox.start(), 0);
|
|
|