Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(747)

Unified Diff: third_party/WebKit/Source/core/paint/SVGInlineTextBoxPainter.cpp

Issue 1549503002: Return AffineTransform from SVGTextFragment::buildFragmentTransform (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/layout/svg/line/SVGInlineTextBox.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 4bfb0af4813090ae52444ceb48a6d3ce142ca7d1..69be620cfce62d93f55eb34d0ae6eefb14618b38 100644
--- a/third_party/WebKit/Source/core/paint/SVGInlineTextBoxPainter.cpp
+++ b/third_party/WebKit/Source/core/paint/SVGInlineTextBoxPainter.cpp
@@ -105,16 +105,14 @@ void SVGInlineTextBoxPainter::paintTextFragments(const PaintInfo& paintInfo, Lay
hasVisibleStroke = false;
}
- AffineTransform fragmentTransform;
unsigned textFragmentsSize = m_svgInlineTextBox.textFragments().size();
for (unsigned i = 0; i < textFragmentsSize; ++i) {
const SVGTextFragment& fragment = m_svgInlineTextBox.textFragments().at(i);
GraphicsContextStateSaver stateSaver(paintInfo.context, false);
if (fragment.isTransformed()) {
- fragment.buildFragmentTransform(fragmentTransform);
stateSaver.save();
- paintInfo.context.concatCTM(fragmentTransform);
+ paintInfo.context.concatCTM(fragment.buildFragmentTransform());
}
// Spec: All text decorations except line-through should be drawn before the text is filled and stroked; thus, the text is rendered on top of these decorations.
@@ -172,15 +170,12 @@ void SVGInlineTextBoxPainter::paintSelectionBackground(const PaintInfo& paintInf
int startPosition, endPosition;
m_svgInlineTextBox.selectionStartEnd(startPosition, endPosition);
- AffineTransform fragmentTransform;
const Vector<SVGTextFragmentWithRange> fragmentInfoList = collectFragmentsInRange(startPosition, endPosition);
for (const SVGTextFragmentWithRange& fragmentWithRange : fragmentInfoList) {
const SVGTextFragment& fragment = fragmentWithRange.fragment;
GraphicsContextStateSaver stateSaver(paintInfo.context);
- if (fragment.isTransformed()) {
- fragment.buildFragmentTransform(fragmentTransform);
- paintInfo.context.concatCTM(fragmentTransform);
- }
+ if (fragment.isTransformed())
+ paintInfo.context.concatCTM(fragment.buildFragmentTransform());
paintInfo.context.setFillColor(backgroundColor);
paintInfo.context.fillRect(m_svgInlineTextBox.selectionRectForTextFragment(fragment, fragmentWithRange.startPosition, fragmentWithRange.endPosition, style), backgroundColor);
@@ -474,14 +469,11 @@ void SVGInlineTextBoxPainter::paintTextMatchMarkerForeground(const PaintInfo& pa
strokePaint.setColor(textColor.rgb());
}
- AffineTransform fragmentTransform;
for (const SVGTextFragmentWithRange& textMatchInfo : textMatchInfoList) {
const SVGTextFragment& fragment = textMatchInfo.fragment;
GraphicsContextStateSaver stateSaver(paintInfo.context);
- if (fragment.isTransformed()) {
- fragment.buildFragmentTransform(fragmentTransform);
- paintInfo.context.concatCTM(fragmentTransform);
- }
+ if (fragment.isTransformed())
+ paintInfo.context.concatCTM(fragment.buildFragmentTransform());
TextRun textRun = m_svgInlineTextBox.constructTextRun(style, fragment);
paintText(paintInfo, textRun, fragment, textMatchInfo.startPosition, textMatchInfo.endPosition, fillPaint);
@@ -497,15 +489,13 @@ void SVGInlineTextBoxPainter::paintTextMatchMarkerBackground(const PaintInfo& pa
return;
Color color = LayoutTheme::theme().platformTextSearchHighlightColor(marker->activeMatch());
- AffineTransform fragmentTransform;
for (const SVGTextFragmentWithRange& textMatchInfo : textMatchInfoList) {
const SVGTextFragment& fragment = textMatchInfo.fragment;
GraphicsContextStateSaver stateSaver(paintInfo.context, false);
if (fragment.isTransformed()) {
stateSaver.save();
- fragment.buildFragmentTransform(fragmentTransform);
- paintInfo.context.concatCTM(fragmentTransform);
+ paintInfo.context.concatCTM(fragment.buildFragmentTransform());
}
FloatRect fragmentRect = m_svgInlineTextBox.selectionRectForTextFragment(fragment, textMatchInfo.startPosition, textMatchInfo.endPosition, style);
paintInfo.context.setFillColor(color);
« no previous file with comments | « third_party/WebKit/Source/core/layout/svg/line/SVGInlineTextBox.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698