Home
last modified time | relevance | path

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

/frameworks/minikin/tests/unittest/
DOptimalLineBreakerTest.cpp107 const std::vector<uint16_t> textBuf = utf8ToUtf16("This is an example text."); in TEST_F() local
119 auto actual = doLineBreak(textBuf, HIGH_QUALITY, NO_HYPHENATION, LINE_WIDTH); in TEST_F()
122 << toString(textBuf, actual); in TEST_F()
123 actual = doLineBreak(textBuf, HIGH_QUALITY, NORMAL_HYPHENATION, LINE_WIDTH); in TEST_F()
126 << toString(textBuf, actual); in TEST_F()
127 actual = doLineBreak(textBuf, BALANCED, NO_HYPHENATION, LINE_WIDTH); in TEST_F()
130 << toString(textBuf, actual); in TEST_F()
131 actual = doLineBreak(textBuf, BALANCED, NORMAL_HYPHENATION, LINE_WIDTH); in TEST_F()
134 << toString(textBuf, actual); in TEST_F()
141 auto actual = doLineBreak(textBuf, HIGH_QUALITY, NO_HYPHENATION, LINE_WIDTH); in TEST_F()
[all …]
DGreedyLineBreakerTest.cpp98 const std::vector<uint16_t> textBuf = utf8ToUtf16("This is an example text."); in TEST_F() local
109 const auto actual = doLineBreak(textBuf, NO_HYPHEN, LINE_WIDTH); in TEST_F()
112 << toString(textBuf, actual); in TEST_F()
120 const auto actual = doLineBreak(textBuf, NO_HYPHEN, LINE_WIDTH); in TEST_F()
123 << toString(textBuf, actual); in TEST_F()
134 const auto actual = doLineBreak(textBuf, NO_HYPHEN, LINE_WIDTH); in TEST_F()
137 << toString(textBuf, actual); in TEST_F()
150 const auto actual = doLineBreak(textBuf, NO_HYPHEN, LINE_WIDTH); in TEST_F()
153 << toString(textBuf, actual); in TEST_F()
166 const auto actual = doLineBreak(textBuf, NO_HYPHEN, 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.h177 static std::string toString(const U16StringPiece& textBuf, const LineBreakResult& lines) { in toString() argument
185 std::string hyphenatedStr = utf16ToUtf8(textBuf.substr(textRange)); in toString()
/frameworks/minikin/libs/minikin/
DLayoutUtils.cpp51 uint32_t getPrevWordBreakForCache(const U16StringPiece& textBuf, uint32_t offset) { in getPrevWordBreakForCache() argument
53 if (offset > textBuf.size()) offset = textBuf.size(); in getPrevWordBreakForCache()
54 if (isWordBreakBefore(textBuf[offset - 1])) { in getPrevWordBreakForCache()
58 if (isWordBreakBefore(textBuf[i]) || isWordBreakAfter(textBuf[i - 1])) { in getPrevWordBreakForCache()
68 uint32_t getNextWordBreakForCache(const U16StringPiece& textBuf, uint32_t offset) { in getNextWordBreakForCache() argument
69 if (offset >= textBuf.size()) return textBuf.size(); in getNextWordBreakForCache()
70 if (isWordBreakAfter(textBuf[offset])) { in getNextWordBreakForCache()
73 for (uint32_t i = offset + 1; i < textBuf.size(); i++) { in getNextWordBreakForCache()
77 if (isWordBreakBefore(textBuf[i])) { in getNextWordBreakForCache()
81 return textBuf.size(); in getNextWordBreakForCache()
DMeasuredText.cpp56 void StyleRun::getMetrics(const U16StringPiece& textBuf, std::vector<float>* advances, in getMetrics() argument
62 for (const BidiText::RunInfo info : BidiText(textBuf, mRange, bidiFlag)) { in getMetrics()
63 for (const auto[context, piece] : LayoutSplitter(textBuf, info.range, info.isRtl)) { in getMetrics()
67 textBuf.substr(context), piece - context.getStart(), mPaint, info.isRtl, in getMetrics()
70 precomputed->getOrCreate(textBuf, piece, context, mPaint, info.isRtl, in getMetrics()
106 float StyleRun::measureHyphenPiece(const U16StringPiece& textBuf, const Range& range, in measureHyphenPiece() argument
111 for (const BidiText::RunInfo info : BidiText(textBuf, range, bidiFlag)) { in measureHyphenPiece()
112 for (const auto[context, piece] : LayoutSplitter(textBuf, info.range, info.isRtl)) { in measureHyphenPiece()
119 LayoutCache::getInstance().getOrCreate(textBuf.substr(context), in measureHyphenPiece()
127 void MeasuredText::measure(const U16StringPiece& textBuf, bool computeHyphenation, in measure() argument
[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()
DLayout.cpp48 void Layout::doLayout(const U16StringPiece& textBuf, const Range& range, Bidi bidiFlags, in doLayout() argument
54 for (const BidiText::RunInfo& runInfo : BidiText(textBuf, range, bidiFlags)) { in doLayout()
55 doLayoutRunCached(textBuf, runInfo.range, runInfo.isRtl, paint, range.getStart(), in doLayout()
60 float Layout::measureText(const U16StringPiece& textBuf, const Range& range, Bidi bidiFlags, in measureText() argument
64 for (const BidiText::RunInfo& runInfo : BidiText(textBuf, range, bidiFlags)) { in measureText()
67 advance += doLayoutRunCached(textBuf, runInfo.range, runInfo.isRtl, paint, 0, startHyphen, in measureText()
73 float Layout::doLayoutRunCached(const U16StringPiece& textBuf, const Range& range, bool isRtl, in doLayoutRunCached() argument
81 for (const auto[context, piece] : LayoutSplitter(textBuf, range, isRtl)) { in doLayoutRunCached()
89 advance += doLayoutWord(textBuf.data() + context.getStart(), in doLayoutRunCached()
135 const U16StringPiece textBuf(buf, bufSize); in doLayoutWord() local
[all …]
DOptimalLineBreaker.cpp207 OptimizeContext populateCandidates(const U16StringPiece& textBuf, const MeasuredText& measured, in populateCandidates() argument
211 CharProcessor proc(textBuf); in populateCandidates()
233 MINIKIN_ASSERT(textBuf[i] != CHAR_TAB, "TAB is not supported in optimal line breaker"); in populateCandidates()
234 proc.feedChar(i, textBuf[i], measured.widths[i], run->canBreak()); in populateCandidates()
274 LineBreakResult computeBreaks(const OptimizeContext& context, const U16StringPiece& textBuf,
285 LineBreakResult finishBreaksOptimal(const U16StringPiece& textBuf, const MeasuredText& measured,
292 const U16StringPiece& textBuf, const MeasuredText& measured, in finishBreaksOptimal() argument
305 MinikinExtent extent = measured.getExtent(textBuf, Range(prev.offset, cand.offset)); in finishBreaksOptimal()
318 const U16StringPiece& textBuf, in computeBreaks() argument
399 return finishBreaksOptimal(textBuf, measured, breaksData, candidates); in computeBreaks()
[all …]
DLayoutUtils.h38 uint32_t getPrevWordBreakForCache(const U16StringPiece& textBuf, uint32_t offset);
47 uint32_t getNextWordBreakForCache(const U16StringPiece& textBuf, uint32_t offset);
DLineBreakerUtil.h65 const U16StringPiece& textBuf, // A text buffer. in populateHyphenationPoints() argument
77 hyphenate(textBuf.substr(hyphenationTargetRange), hyphenator); in populateHyphenationPoints()
85 U16StringPiece firstText = textBuf.substr(hyphenPart.first); in populateHyphenationPoints()
86 U16StringPiece secondText = textBuf.substr(hyphenPart.second); in populateHyphenationPoints()
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()
DGreedyLineBreaker.cpp41 GreedyLineBreaker(const U16StringPiece& textBuf, const MeasuredText& measured, in GreedyLineBreaker() argument
45 mTextBuf(textBuf), in GreedyLineBreaker()
388 LineBreakResult breakLineGreedy(const U16StringPiece& textBuf, const MeasuredText& measured, in breakLineGreedy() argument
391 if (textBuf.size() == 0) { in breakLineGreedy()
394 GreedyLineBreaker lineBreaker(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.h47 BidiText(const U16StringPiece& textBuf, const Range& range, Bidi bidiFlags);
DLayoutCore.cpp342 LayoutPiece::LayoutPiece(const U16StringPiece& textBuf, const Range& range, bool isRtl, in LayoutPiece() argument
345 const uint16_t* buf = textBuf.data(); in LayoutPiece()
348 const size_t bufSize = textBuf.size(); in LayoutPiece()
359 textBuf.substr(range), paint.fontStyle, paint.localeListId, paint.familyVariant); in LayoutPiece()
/frameworks/minikin/include/minikin/
DMeasuredText.h194 Layout buildLayout(const U16StringPiece& textBuf, const Range& range, const Range& contextRange,
197 MinikinRect getBounds(const U16StringPiece& textBuf, const Range& range) const;
198 MinikinExtent getExtent(const U16StringPiece& textBuf, const Range& range) const;
208 void measure(const U16StringPiece& textBuf, bool computeHyphenation, bool computeLayout,
212 MeasuredText(const U16StringPiece& textBuf, std::vector<std::unique_ptr<Run>>&& runs, in MeasuredText() argument
214 : widths(textBuf.size()), runs(std::move(runs)) { in MeasuredText()
215 measure(textBuf, computeHyphenation, computeLayout, hint); in MeasuredText()
237 std::unique_ptr<MeasuredText> build(const U16StringPiece& textBuf, bool computeHyphenation, in build() argument
241 textBuf, std::move(mRuns), computeHyphenation, computeLayout, hint)); in build()
DAndroidLineBreakerHelper.h83 LineBreakResult computeBreaks(const U16StringPiece& textBuf, const MeasuredText& measuredText, in computeBreaks() argument
92 return breakIntoLines(textBuf, mStrategy, mFrequency, mIsJustified, measuredText, lineWidth, in computeBreaks()
DLayoutPieces.h88 void getOrCreate(const U16StringPiece& textBuf, const Range& range, const Range& context, in getOrCreate()
94 LayoutCache::getInstance().getOrCreate(textBuf.substr(context), in getOrCreate()
DLayoutCore.h47 LayoutPiece(const U16StringPiece& textBuf, const Range& range, bool isRtl,
DLayout.h116 static float doLayoutRunCached(const U16StringPiece& textBuf, const Range& range, bool isRtl,
/frameworks/base/libs/hwui/hwui/
DMinikinUtils.cpp58 const minikin::U16StringPiece textBuf(buf, bufSize); in doLayout() local
65 return minikin::Layout(textBuf.substr(contextRange), range - contextStart, bidiFlags, in doLayout()
68 return mt->buildLayout(textBuf, range, contextRange, minikinPaint, startHyphen, endHyphen); in doLayout()
76 const minikin::U16StringPiece textBuf(buf, bufSize); in measureText() local
81 return minikin::Layout::measureText(textBuf, range, bidiFlags, minikinPaint, startHyphen, in measureText()
/frameworks/av/cmds/screenrecord/
DOverlay.cpp235 char textBuf[64]; in processFrame_l() local
236 getTimeString_l(monotonicNsec, textBuf, sizeof(textBuf)); in processFrame_l()
238 textBuf, frameNumber, mTotalDroppedFrames)); in processFrame_l()