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

Unified Diff: third_party/WebKit/Source/core/layout/svg/SVGTextMetrics.cpp

Issue 1829713002: Move SVGTextMetrics::constructTextRun to SVGTextMetricsBuilder (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months 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
Index: third_party/WebKit/Source/core/layout/svg/SVGTextMetrics.cpp
diff --git a/third_party/WebKit/Source/core/layout/svg/SVGTextMetrics.cpp b/third_party/WebKit/Source/core/layout/svg/SVGTextMetrics.cpp
index b0cf3a1ad1fa86cf9dae88dd340c715ca389c290..4dad1811862aebd0465376caff1b8c373fd49aec 100644
--- a/third_party/WebKit/Source/core/layout/svg/SVGTextMetrics.cpp
+++ b/third_party/WebKit/Source/core/layout/svg/SVGTextMetrics.cpp
@@ -20,7 +20,6 @@
#include "core/layout/svg/SVGTextMetrics.h"
#include "core/layout/api/LineLayoutSVGInlineText.h"
-#include "core/layout/svg/LayoutSVGInlineText.h"
#include "platform/fonts/FontOrientation.h"
namespace blink {
@@ -39,34 +38,6 @@ SVGTextMetrics::SVGTextMetrics(SVGTextMetrics::MetricsType)
{
}
-TextRun SVGTextMetrics::constructTextRun(LineLayoutSVGInlineText textLayoutItem, unsigned position, unsigned length, TextDirection textDirection)
-{
- const ComputedStyle& style = textLayoutItem.styleRef();
-
- TextRun run(static_cast<const LChar*>(nullptr) // characters, will be set below if non-zero.
- , 0 // length, will be set below if non-zero.
- , 0 // xPos, only relevant with allowTabs=true
- , 0 // padding, only relevant for justified text, not relevant for SVG
- , TextRun::AllowTrailingExpansion
- , textDirection
- , isOverride(style.unicodeBidi()) /* directionalOverride */);
-
- if (length) {
- if (textLayoutItem.is8Bit())
- run.setText(textLayoutItem.characters8() + position, length);
- else
- run.setText(textLayoutItem.characters16() + position, length);
- }
-
- // We handle letter & word spacing ourselves.
- run.disableSpacing();
-
- // Propagate the maximum length of the characters buffer to the TextRun, even when we're only processing a substring.
- run.setCharactersLength(textLayoutItem.textLength() - position);
- ASSERT(run.charactersLength() >= run.length());
- return run;
-}
-
SVGTextMetrics::SVGTextMetrics(LineLayoutSVGInlineText textLayoutItem, unsigned length, float width)
{
ASSERT(textLayoutItem);

Powered by Google App Engine
This is Rietveld 408576698