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

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

Issue 1545443002: Helper for checking if an SVGTextFragment is transformed (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 9811e5b8494634516ec607fa58e32d9f8c1bd1a8..4bfb0af4813090ae52444ceb48a6d3ce142ca7d1 100644
--- a/third_party/WebKit/Source/core/paint/SVGInlineTextBoxPainter.cpp
+++ b/third_party/WebKit/Source/core/paint/SVGInlineTextBoxPainter.cpp
@@ -111,8 +111,8 @@ void SVGInlineTextBoxPainter::paintTextFragments(const PaintInfo& paintInfo, Lay
const SVGTextFragment& fragment = m_svgInlineTextBox.textFragments().at(i);
GraphicsContextStateSaver stateSaver(paintInfo.context, false);
- fragment.buildFragmentTransform(fragmentTransform);
- if (!fragmentTransform.isIdentity()) {
+ if (fragment.isTransformed()) {
+ fragment.buildFragmentTransform(fragmentTransform);
stateSaver.save();
paintInfo.context.concatCTM(fragmentTransform);
}
@@ -177,9 +177,10 @@ void SVGInlineTextBoxPainter::paintSelectionBackground(const PaintInfo& paintInf
for (const SVGTextFragmentWithRange& fragmentWithRange : fragmentInfoList) {
const SVGTextFragment& fragment = fragmentWithRange.fragment;
GraphicsContextStateSaver stateSaver(paintInfo.context);
- fragment.buildFragmentTransform(fragmentTransform);
- if (!fragmentTransform.isIdentity())
+ if (fragment.isTransformed()) {
+ fragment.buildFragmentTransform(fragmentTransform);
paintInfo.context.concatCTM(fragmentTransform);
+ }
paintInfo.context.setFillColor(backgroundColor);
paintInfo.context.fillRect(m_svgInlineTextBox.selectionRectForTextFragment(fragment, fragmentWithRange.startPosition, fragmentWithRange.endPosition, style), backgroundColor);
@@ -477,9 +478,10 @@ void SVGInlineTextBoxPainter::paintTextMatchMarkerForeground(const PaintInfo& pa
for (const SVGTextFragmentWithRange& textMatchInfo : textMatchInfoList) {
const SVGTextFragment& fragment = textMatchInfo.fragment;
GraphicsContextStateSaver stateSaver(paintInfo.context);
- fragment.buildFragmentTransform(fragmentTransform);
- if (!fragmentTransform.isIdentity())
+ if (fragment.isTransformed()) {
+ fragment.buildFragmentTransform(fragmentTransform);
paintInfo.context.concatCTM(fragmentTransform);
+ }
TextRun textRun = m_svgInlineTextBox.constructTextRun(style, fragment);
paintText(paintInfo, textRun, fragment, textMatchInfo.startPosition, textMatchInfo.endPosition, fillPaint);
@@ -500,9 +502,9 @@ void SVGInlineTextBoxPainter::paintTextMatchMarkerBackground(const PaintInfo& pa
const SVGTextFragment& fragment = textMatchInfo.fragment;
GraphicsContextStateSaver stateSaver(paintInfo.context, false);
- fragment.buildFragmentTransform(fragmentTransform);
- if (!fragmentTransform.isIdentity()) {
+ if (fragment.isTransformed()) {
stateSaver.save();
+ fragment.buildFragmentTransform(fragmentTransform);
paintInfo.context.concatCTM(fragmentTransform);
}
FloatRect fragmentRect = m_svgInlineTextBox.selectionRectForTextFragment(fragment, textMatchInfo.startPosition, textMatchInfo.endPosition, style);
« 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