Home
last modified time | relevance | path

Searched refs:textBuf (Results 1 – 25 of 27) sorted by relevance

12

/frameworks/minikin/libs/minikin/
DLayoutUtils.cpp58 uint32_t getPrevWordBreakForCache(const U16StringPiece& textBuf, uint32_t offset) { in getPrevWordBreakForCache() argument
60 if (offset > textBuf.size()) offset = textBuf.size(); in getPrevWordBreakForCache()
61 if (isWordBreakBefore(textBuf[offset - 1])) { in getPrevWordBreakForCache()
65 if (isWordBreakBefore(textBuf[i]) || isWordBreakAfter(textBuf[i - 1])) { in getPrevWordBreakForCache()
75 uint32_t getNextWordBreakForCache(const U16StringPiece& textBuf, uint32_t offset) { in getNextWordBreakForCache() argument
76 if (offset >= textBuf.size()) return textBuf.size(); in getNextWordBreakForCache()
77 if (isWordBreakAfter(textBuf[offset])) { in getNextWordBreakForCache()
80 for (uint32_t i = offset + 1; i < textBuf.size(); i++) { in getNextWordBreakForCache()
84 if (isWordBreakBefore(textBuf[i])) { in getNextWordBreakForCache()
88 return textBuf.size(); in getNextWordBreakForCache()
DMeasuredText.cpp65 void StyleRun::getMetrics(const U16StringPiece& textBuf, std::vector<float>* advances, in getMetrics() argument
72 for (const BidiText::RunInfo info : BidiText(textBuf, mRange, bidiFlag)) { in getMetrics()
73 for (const auto[context, piece] : LayoutSplitter(textBuf, info.range, info.isRtl)) { in getMetrics()
77 textBuf.substr(context), piece - context.getStart(), mPaint, info.isRtl, in getMetrics()
81 precomputed->getOrCreate(textBuf, piece, context, mPaint, info.isRtl, in getMetrics()
106 float StyleRun::measureText(const U16StringPiece& textBuf) const { in measureText()
110 for (const BidiText::RunInfo info : BidiText(textBuf, Range(0, textBuf.length()), bidiFlag)) { in measureText()
111 for (const auto [context, piece] : LayoutSplitter(textBuf, info.range, info.isRtl)) { in measureText()
112 layoutCache.getOrCreate(textBuf.substr(context), piece - context.getStart(), mPaint, in measureText()
149 float StyleRun::measureHyphenPiece(const U16StringPiece& textBuf, const Range& range, in measureHyphenPiece() argument
[all …]
DLayout.cpp50 void adjustGlyphLetterSpacingEdge(const U16StringPiece& textBuf, const MinikinPaint& paint, in adjustGlyphLetterSpacingEdge() argument
60 const uint32_t cp = textBuf.codePointAt(cluster); in adjustGlyphLetterSpacingEdge()
68 const uint32_t cp = textBuf.codePointAt(cluster); in adjustGlyphLetterSpacingEdge()
80 const uint32_t cp = textBuf.codePointAt(cluster); in adjustGlyphLetterSpacingEdge()
99 float adjustAdvanceLetterSpacingEdge(const U16StringPiece& textBuf, const Range& range, in adjustAdvanceLetterSpacingEdge() argument
104 if (letterSpacing == 0 || textBuf.length() == 0) { in adjustAdvanceLetterSpacingEdge()
114 if (!u_iscntrl(textBuf.codePointAt(i)) && advances[i - advOffset] != 0) { in adjustAdvanceLetterSpacingEdge()
119 uint32_t cp = textBuf.codePointAt(lastNonCtrlCharIndex); in adjustAdvanceLetterSpacingEdge()
127 uint32_t cp = textBuf.codePointAt(i); in adjustAdvanceLetterSpacingEdge()
143 uint32_t cp = textBuf.codePointAt(i); in adjustAdvanceLetterSpacingEdge()
[all …]
DLayoutSplitter.h57 LayoutSplitter(const U16StringPiece& textBuf, const Range& range, bool isRtl) in LayoutSplitter() argument
58 : mTextBuf(textBuf), mRange(range), mIsRtl(isRtl) {} in LayoutSplitter()
71 const U16StringPiece& textBuf = mParent->mTextBuf; variable
75 mContextRange.setStart(getPrevWordBreakForCache(textBuf, mPos));
82 mContextRange.setEnd(getNextWordBreakForCache(textBuf, mPos));
93 const U16StringPiece& textBuf = mParent->mTextBuf; in iterator() local
96 mContextRange.setStart(getPrevWordBreakForCache(textBuf, pos)); in iterator()
97 mContextRange.setEnd(getNextWordBreakForCache(textBuf, pos == 0 ? 0 : pos - 1)); in iterator()
102 getPrevWordBreakForCache(textBuf, pos == range.getEnd() ? pos : pos + 1)); in iterator()
103 mContextRange.setEnd(getNextWordBreakForCache(textBuf, pos)); in iterator()
DOptimalLineBreaker.cpp189 std::vector<DesperateBreak> populateDesperatePoints(const U16StringPiece& textBuf, in populateDesperatePoints() argument
207 wb.setText(textBuf.data(), textBuf.length()); in populateDesperatePoints()
263 OptimizeContext populateCandidates(const U16StringPiece& textBuf, const MeasuredText& measured, in populateCandidates() argument
267 CharProcessor proc(textBuf); in populateCandidates()
301 MINIKIN_ASSERT(textBuf[i] != CHAR_TAB, "TAB is not supported in optimal line breaker"); in populateCandidates()
305 proc.feedChar(i, textBuf[i], measured.widths[i], canBreak); in populateCandidates()
323 desperateBreaks = populateDesperatePoints(textBuf, measured, contextRange, *run); in populateCandidates()
350 LineBreakResult computeBreaks(const OptimizeContext& context, const U16StringPiece& textBuf,
361 LineBreakResult finishBreaksOptimal(const U16StringPiece& textBuf, const MeasuredText& measured,
369 const U16StringPiece& textBuf, const MeasuredText& measured, in finishBreaksOptimal() argument
[all …]
DScriptUtils.h40 ScriptText(const U16StringPiece& textBuf, uint32_t start, uint32_t end) in ScriptText() argument
41 : mTextBuf(textBuf), mRange(start, end) {} in ScriptText()
43 explicit ScriptText(const U16StringPiece& textBuf) in ScriptText() argument
44 : mTextBuf(textBuf), mRange(0, textBuf.size()) {} in ScriptText()
DLayoutUtils.h38 uint32_t getPrevWordBreakForCache(const U16StringPiece& textBuf, uint32_t offset);
47 uint32_t getNextWordBreakForCache(const U16StringPiece& textBuf, uint32_t offset);
DLineBreakerUtil.h60 inline Range trimTrailingLineEndSpaces(const U16StringPiece& textBuf, const Range& range) { in trimTrailingLineEndSpaces() argument
62 if (!isLineEndSpace(textBuf[range.getEnd() - i - 1])) { in trimTrailingLineEndSpaces()
76 const U16StringPiece& textBuf, // A text buffer. in populateHyphenationPoints() argument
90 hyphenate(textBuf.substr(hyphenationTargetRange), hyphenator); in populateHyphenationPoints()
99 U16StringPiece firstText = textBuf.substr(hyphenPart.first); in populateHyphenationPoints()
100 U16StringPiece secondText = textBuf.substr(hyphenPart.second); in populateHyphenationPoints()
DLayoutCore.cpp278 LayoutPiece::LayoutPiece(const U16StringPiece& textBuf, const Range& range, bool isRtl, in LayoutPiece() argument
281 const uint16_t* buf = textBuf.data(); in LayoutPiece()
284 const size_t bufSize = textBuf.size(); in LayoutPiece()
295 U16StringPiece substr = textBuf.substr(range); in LayoutPiece()
363 for (const auto [range, script] : ScriptText(textBuf, run.start, run.end)) { in LayoutPiece()
417 const uint32_t cp = textBuf.codePointAt(advIndex + start); in LayoutPiece()
427 const uint32_t prevCp = textBuf.codePointAt(prevAdvIndex + start); in LayoutPiece()
428 const uint32_t cp = textBuf.codePointAt(clusterBaseIndex + start); in LayoutPiece()
474 const uint32_t lastCp = textBuf.codePointAt(lastAdvIndex + start); in LayoutPiece()
DBidiUtils.cpp75 BidiText::BidiText(const U16StringPiece& textBuf, const Range& range, Bidi bidiFlags) in BidiText() argument
96 ubidi_setPara(mBidi.get(), reinterpret_cast<const UChar*>(textBuf.data()), textBuf.size(), in BidiText()
DMeasurement.cpp240 MinikinExtent getFontExtent(const U16StringPiece& textBuf, const Range& range, Bidi bidiFlag, in getFontExtent() argument
243 for (const BidiText::RunInfo info : BidiText(textBuf, range, bidiFlag)) { in getFontExtent()
244 for (const auto [context, piece] : LayoutSplitter(textBuf, info.range, info.isRtl)) { in getFontExtent()
245 LayoutCache::getInstance().getOrCreate(textBuf.substr(context), in getFontExtent()
DGreedyLineBreaker.cpp41 GreedyLineBreaker(const U16StringPiece& textBuf, const MeasuredText& measured, in GreedyLineBreaker() argument
45 mTextBuf(textBuf), in GreedyLineBreaker()
551 LineBreakResult breakLineGreedy(const U16StringPiece& textBuf, const MeasuredText& measured, in breakLineGreedy() argument
554 if (textBuf.size() == 0) { in breakLineGreedy()
557 GreedyLineBreaker lineBreaker(textBuf, measured, lineWidthLimits, tabStops, enableHyphenation, in breakLineGreedy()
578 GreedyLineBreaker phLineBreaker(textBuf, measured, lineWidthLimits, tabStops, enableHyphenation, in breakLineGreedy()
DGreedyLineBreaker.h28 LineBreakResult breakLineGreedy(const U16StringPiece& textBuf, const MeasuredText& measured,
DOptimalLineBreaker.h26 LineBreakResult breakLineOptimal(const U16StringPiece& textBuf, const MeasuredText& measured,
DBidiUtils.h49 BidiText(const U16StringPiece& textBuf, const Range& range, Bidi bidiFlags);
/frameworks/minikin/tests/unittest/
DGreedyLineBreakerTest.cpp266 const std::vector<uint16_t> textBuf = utf8ToUtf16("This is an example text."); in TEST_F() local
277 const auto actual = doLineBreak(textBuf, NO_HYPHEN, LINE_WIDTH); in TEST_F()
280 << toString(textBuf, actual); in TEST_F()
288 const auto actual = doLineBreak(textBuf, NO_HYPHEN, LINE_WIDTH); in TEST_F()
291 << toString(textBuf, actual); in TEST_F()
302 const auto actual = doLineBreak(textBuf, NO_HYPHEN, LINE_WIDTH); in TEST_F()
305 << toString(textBuf, actual); in TEST_F()
318 const auto actual = doLineBreak(textBuf, NO_HYPHEN, LINE_WIDTH); in TEST_F()
321 << toString(textBuf, actual); in TEST_F()
334 const auto actual = doLineBreak(textBuf, NO_HYPHEN, LINE_WIDTH); in TEST_F()
[all …]
DOptimalLineBreakerTest.cpp229 const std::vector<uint16_t> textBuf = utf8ToUtf16("This is an example text."); in TEST_F() local
241 expectBreak(expect, textBuf, HIGH_QUALITY, NO_HYPHENATION, "en-US", LINE_WIDTH); in TEST_F()
242 expectBreak(expect, textBuf, HIGH_QUALITY, NORMAL_HYPHENATION, "en-US", LINE_WIDTH); in TEST_F()
243 expectBreak(expect, textBuf, BALANCED, NO_HYPHENATION, "en-US", LINE_WIDTH); in TEST_F()
244 expectBreak(expect, textBuf, BALANCED, NORMAL_HYPHENATION, "en-US", LINE_WIDTH); in TEST_F()
251 expectBreak(expect, textBuf, HIGH_QUALITY, NO_HYPHENATION, "en-US", LINE_WIDTH); in TEST_F()
252 expectBreak(expect, textBuf, HIGH_QUALITY, NORMAL_HYPHENATION, "en-US", LINE_WIDTH); in TEST_F()
253 expectBreak(expect, textBuf, BALANCED, NO_HYPHENATION, "en-US", LINE_WIDTH); in TEST_F()
254 expectBreak(expect, textBuf, BALANCED, NORMAL_HYPHENATION, "en-US", LINE_WIDTH); in TEST_F()
265 expectBreak(expect, textBuf, HIGH_QUALITY, NO_HYPHENATION, "en-US", LINE_WIDTH); in TEST_F()
[all …]
DLayoutSplitterTest.cpp74 std::string buildDebugString(const U16StringPiece& textBuf, const Range& context, in buildDebugString() argument
77 out.reserve(textBuf.size() + 4); in buildDebugString()
78 for (uint32_t i = 0; i < textBuf.size() + 1; ++i) { in buildDebugString()
91 if (i != textBuf.size()) { in buildDebugString()
92 out.push_back(textBuf[i]); in buildDebugString()
DLineBreakerTestHelper.h193 static std::string toString(const U16StringPiece& textBuf, const LineBreakResult& lines) { in toString() argument
201 std::string hyphenatedStr = utf16ToUtf8(textBuf.substr(textRange)); in toString()
/frameworks/base/libs/hwui/hwui/
DMinikinUtils.cpp70 const minikin::U16StringPiece textBuf(buf, bufSize); in doLayout() local
80 return minikin::Layout(textBuf.substr(contextRange), range - contextStart, bidiFlags, in doLayout()
83 return mt->buildLayout(textBuf, range, contextRange, minikinPaint, startHyphen, endHyphen); in doLayout()
91 const minikin::U16StringPiece textBuf(buf, bufSize); in getBounds() local
95 minikin::getBounds(textBuf, minikin::Range(0, textBuf.size()), bidiFlags, minikinPaint, in getBounds()
104 const minikin::U16StringPiece textBuf(buf, bufSize); in measureText() local
112 return minikin::Layout::measureText(textBuf, range, bidiFlags, minikinPaint, startHyphen, in measureText()
120 const minikin::U16StringPiece textBuf(buf, bufSize); in getFontExtent() local
123 return minikin::getFontExtent(textBuf, range, bidiFlags, minikinPaint); in getFontExtent()
/frameworks/av/cmds/screenrecord/
DOverlay.cpp238 char textBuf[64]; in processFrame_l() local
239 getTimeString_l(monotonicNsec, textBuf, sizeof(textBuf)); in processFrame_l()
241 textBuf, frameNumber, mTotalDroppedFrames)); in processFrame_l()
/frameworks/minikin/include/minikin/
DAndroidLineBreakerHelper.h89 LineBreakResult computeBreaks(const U16StringPiece& textBuf, const MeasuredText& measuredText, in computeBreaks() argument
98 return breakIntoLines(textBuf, mStrategy, mFrequency, mIsJustified, measuredText, lineWidth, in computeBreaks()
DLayoutPieces.h93 void getOrCreate(const U16StringPiece& textBuf, const Range& range, const Range& context, in getOrCreate()
109 LayoutCache::getInstance().getOrCreate(textBuf.substr(context), range - context.getStart(), in getOrCreate()
DLayoutCore.h41 LayoutPiece(const U16StringPiece& textBuf, const Range& range, bool isRtl,
/frameworks/minikin/fuzz/hyphenator_fuzzer/
Dhyphenator_fuzzer.cpp112 auto textBuf = generateStringPiece(&fdp); in LLVMFuzzerTestOneInput() local
115 hyphenator->hyphenate(textBuf, &result); in LLVMFuzzerTestOneInput()

12