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

Unified Diff: third_party/WebKit/Source/platform/fonts/shaping/ShapeResultBuffer.cpp

Issue 2702853002: [LayoutNG] Shape items with context (Closed)
Patch Set: Add null check Created 3 years, 10 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
« no previous file with comments | « third_party/WebKit/Source/platform/fonts/shaping/ShapeResultBuffer.h ('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/platform/fonts/shaping/ShapeResultBuffer.cpp
diff --git a/third_party/WebKit/Source/platform/fonts/shaping/ShapeResultBuffer.cpp b/third_party/WebKit/Source/platform/fonts/shaping/ShapeResultBuffer.cpp
index 4514c13c4f7e91938145952753180d6fc6ca11e9..801017f91b2e7c3c8134a54d5b79f7b4cda593b5 100644
--- a/third_party/WebKit/Source/platform/fonts/shaping/ShapeResultBuffer.cpp
+++ b/third_party/WebKit/Source/platform/fonts/shaping/ShapeResultBuffer.cpp
@@ -312,7 +312,22 @@ float ShapeResultBuffer::fillGlyphBufferForTextEmphasis(
return advance;
}
+// TODO(eae): This is a bit of a hack to allow reuse of the implementation
+// for both ShapeResultBuffer and single ShapeResult use cases. Ideally the
+// logic should move into ShapeResult itself and then the ShapeResultBuffer
+// implementation may wrap that.
CharacterRange ShapeResultBuffer::getCharacterRange(
+ RefPtr<const ShapeResult> result,
+ TextDirection direction,
+ float totalWidth,
+ unsigned from,
+ unsigned to) {
+ Vector<RefPtr<const ShapeResult>, 64> results;
+ results.push_back(result);
+ return getCharacterRangeInternal(results, direction, totalWidth, from, to);
+}
+
+CharacterRange ShapeResultBuffer::getCharacterRangeInternal(
const Vector<RefPtr<const ShapeResult>, 64>& results,
TextDirection direction,
float totalWidth,
@@ -404,7 +419,7 @@ CharacterRange ShapeResultBuffer::getCharacterRange(TextDirection direction,
float totalWidth,
unsigned from,
unsigned to) const {
- return getCharacterRange(m_results, direction, totalWidth, from, to);
+ return getCharacterRangeInternal(m_results, direction, totalWidth, from, to);
}
void ShapeResultBuffer::addRunInfoRanges(const ShapeResult::RunInfo& runInfo,
« no previous file with comments | « third_party/WebKit/Source/platform/fonts/shaping/ShapeResultBuffer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698