Home
last modified time | relevance | path

Searched refs:advances (Results 1 – 25 of 29) sorted by relevance

12

/frameworks/minikin/tests/unittest/
DLayoutCoreTest.cpp99 EXPECT_EQ(1u, layout.advances().size()); in TEST()
100 EXPECT_EQ(10.0f, layout.advances()[0]); in TEST()
115 EXPECT_EQ(2u, layout.advances().size()); in TEST()
116 EXPECT_EQ(10.0f, layout.advances()[0]); in TEST()
117 EXPECT_EQ(10.0f, layout.advances()[1]); in TEST()
132 EXPECT_EQ(2u, layout.advances().size()); in TEST()
133 EXPECT_EQ(10.0f, layout.advances()[0]); in TEST()
134 EXPECT_EQ(50.0f, layout.advances()[1]); in TEST()
160 EXPECT_EQ(2u, layout.advances().size()); in TEST()
161 EXPECT_EQ(10.0f, layout.advances()[0]); in TEST()
[all …]
DMeasurementTests.cpp25 float getAdvance(const float* advances, const char* src) { in getAdvance() argument
31 return getRunAdvance(advances, buf, 0, size, offset); in getAdvance()
34 void distributeAdvances(float* advances, const char* src, int count) { in distributeAdvances() argument
40 distributeAdvances(advances, buf, offset, count); in distributeAdvances()
133 float advances[] = {20.0, 0.0, 0.0, 0.0}; in TEST() local
134 distributeAdvances(advances, "| U+D83D U+DE00 U+2066 U+202C", 4); in TEST()
135 EXPECT_EQ(advances[0], 20.0); in TEST()
136 EXPECT_EQ(advances[1], 0.0); in TEST()
137 EXPECT_EQ(advances[2], 0.0); in TEST()
138 EXPECT_EQ(advances[3], 0.0); in TEST()
DLayoutTest.cpp30 static void expectAdvances(const std::vector<float>& expected, const std::vector<float>& advances) { in expectAdvances() argument
31 EXPECT_LE(expected.size(), advances.size()); in expectAdvances()
33 EXPECT_EQ(expected[i], advances[i]) in expectAdvances()
35 << ", Actual: " << advances[i]; in expectAdvances()
449 std::vector<float> advances(text.size()); in TEST_F() local
453 EndHyphenEdit::NO_EDIT, advances.data(), nullptr, in TEST_F()
456 ASSERT_EQ(1u, advances.size()); in TEST_F()
457 EXPECT_EQ(1.0f, advances[0]); in TEST_F()
462 std::vector<float> advances(text.size()); in TEST_F() local
466 EndHyphenEdit::NO_EDIT, advances.data(), nullptr, in TEST_F()
[all …]
DLayoutLetterSpacingTest.cpp55 std::vector<float> advances(text.size()); in LayoutTest() local
57 EndHyphenEdit::NO_EDIT, advances.data(), nullptr, nullptr, in LayoutTest()
71 EXPECT_EQ(advances, layout.getAdvances()); in LayoutTest()
75 EXPECT_EQ(expect_advances, advances); in LayoutTest()
78 total_advance += advances[i]; in LayoutTest()
DLineBreakerTestHelper.h59 virtual void getMetrics(const U16StringPiece&, std::vector<float>* advances, in getMetrics() argument
62 std::fill(advances->begin() + mRange.getStart(), advances->begin() + mRange.getEnd(), in getMetrics()
DGraphemeBreakTests.cpp36 bool IsBreakWithAdvances(const float* advances, const char* src) { in IsBreakWithAdvances() argument
42 return GraphemeBreak::isGraphemeBreak(advances, buf, 0, size, offset); in IsBreakWithAdvances()
/frameworks/base/core/tests/coretests/src/android/text/
DTextLineTest.java367 float[] advances = new float[6]; in testMeasureAllBounds_LTR() local
368 tl.measureAllBounds(bounds, advances); in testMeasureAllBounds_LTR()
371 assertArrayEquals(new float[] {10.0f, 10.0f, 10.0f, 10.0f, 10.0f, 50.0f}, advances, 0.0f); in testMeasureAllBounds_LTR()
384 float[] advances = new float[6]; in testMeasureAllBounds_LTR_StyledText() local
385 tl.measureAllBounds(bounds, advances); in testMeasureAllBounds_LTR_StyledText()
388 assertArrayEquals(new float[] {10.0f, 5.0f, 5.0f, 10.0f, 10.0f, 50.0f}, advances, 0.0f); in testMeasureAllBounds_LTR_StyledText()
399 float[] advances = new float[6]; in testMeasureAllBounds_RTL() local
400 tl.measureAllBounds(bounds, advances); in testMeasureAllBounds_RTL()
403 assertArrayEquals(new float[] {10.0f, 10.0f, 10.0f, 10.0f, 10.0f, 50.0f}, advances, 0.0f); in testMeasureAllBounds_RTL()
417 float[] advances = new float[6]; in testMeasureAllBounds_RTL_StyledText() local
[all …]
/frameworks/minikin/libs/minikin/
DLayout.cpp101 RunFlag runFlag, float advance, float* advances) { in adjustAdvanceLetterSpacingEdge() argument
114 if (!u_iscntrl(textBuf.codePointAt(i)) && advances[i - advOffset] != 0) { in adjustAdvanceLetterSpacingEdge()
121 advances[lastNonCtrlCharIndex - advOffset] -= letterSpacingHalf; in adjustAdvanceLetterSpacingEdge()
128 if (!u_iscntrl(cp) && advances[i - advOffset] != 0) { in adjustAdvanceLetterSpacingEdge()
130 advances[i - advOffset] -= letterSpacingHalf; in adjustAdvanceLetterSpacingEdge()
144 if (!u_iscntrl(cp) && advances[i - advOffset] != 0) { in adjustAdvanceLetterSpacingEdge()
146 advances[i - advOffset] -= letterSpacingHalf; in adjustAdvanceLetterSpacingEdge()
155 if (!u_iscntrl(textBuf.codePointAt(i)) && advances[i - advOffset] != 0) { in adjustAdvanceLetterSpacingEdge()
162 advances[lastNonCtrlCharIndex - advOffset] -= letterSpacingHalf; in adjustAdvanceLetterSpacingEdge()
212 EndHyphenEdit endHyphen, float* advances, MinikinRect* bounds, in measureText() argument
[all …]
DMeasurement.cpp54 static float getRunAdvance(const float* advances, const uint16_t* buf, size_t layoutStart, in getRunAdvance() argument
60 float charAdvance = advances[i - layoutStart]; in getRunAdvance()
68 advances[offset - layoutStart] == 0.0f) { in getRunAdvance()
74 if (advances[nextCluster - layoutStart] != 0.0f || in getRunAdvance()
83 if (GraphemeBreak::isGraphemeBreak(advances + (start - layoutStart), buf, start, count, in getRunAdvance()
111 void distributeAdvances(float* advances, const uint16_t* buf, size_t start, size_t count) { in distributeAdvances() argument
114 float clusterAdvance = advances[clusterStart - start]; in distributeAdvances()
117 if (advances[clusterEnd - start] != 0.0f || in distributeAdvances()
124 if (GraphemeBreak::isGraphemeBreak(advances, buf, start, count, i)) { in distributeAdvances()
132 if (GraphemeBreak::isGraphemeBreak(advances, buf, start, count, i)) { in distributeAdvances()
[all …]
DGraphemeBreak.cpp62 bool GraphemeBreak::isGraphemeBreak(const float* advances, const uint16_t* buf, size_t start, in isGraphemeBreak() argument
112 const bool c2_has_advance = (advances != nullptr && advances[offset - start] != 0.0); in isGraphemeBreak()
155 if (advances != nullptr) { in isGraphemeBreak()
188 size_t GraphemeBreak::getTextRunCursor(const float* advances, const uint16_t* buf, size_t start, in getTextRunCursor() argument
197 while (!isGraphemeBreak(advances, buf, start, count, offset)) { in getTextRunCursor()
207 while (!isGraphemeBreak(advances, buf, start, count, offset)) { in getTextRunCursor()
212 if (!isGraphemeBreak(advances, buf, start, count, offset)) { in getTextRunCursor()
DMeasuredText.cpp43 const std::vector<float>& advances = layoutPiece.advances(); in operator ()() local
44 std::copy(advances.begin(), advances.end(), mOutAdvances->begin() + mRange.getStart()); in operator ()()
65 void StyleRun::getMetrics(const U16StringPiece& textBuf, std::vector<float>* advances, in getMetrics() argument
68 AdvancesCompositor compositor(advances, flags, outPieces); in getMetrics()
95 for (float w : layoutPiece.advances()) { in operator ()()
DLayoutCore.cpp91 hb_position_t* advances = first_advance; in harfbuzzGetGlyphHorizontalAdvances() local
93 *advances = HBFloatToFixed(advVec[i]); in harfbuzzGetGlyphHorizontalAdvances()
94 advances = reinterpret_cast<hb_position_t*>(reinterpret_cast<uint8_t*>(advances) + in harfbuzzGetGlyphHorizontalAdvances()
/frameworks/base/graphics/java/android/graphics/text/
DGraphemeBreak.java38 public static void isGraphemeBreak(float[] advances, char[] text, int start, int end, in isGraphemeBreak() argument
44 if (advances.length < end) { in isGraphemeBreak()
46 + "advances.length = " + advances.length in isGraphemeBreak()
54 nIsGraphemeBreak(advances, text, start, end, isGraphemeBreak); in isGraphemeBreak()
57 private static native void nIsGraphemeBreak(float[] advances, char[] text, int start, int end, in nIsGraphemeBreak() argument
/frameworks/minikin/fuzz/measurement_fuzzer/
Dmeasurement_fuzzer.cpp44 float advances[advances_size]; in LLVMFuzzerTestOneInput() local
45 for (int i = 0; i < advances_size; i++) advances[i] = fdp.ConsumeFloatingPoint<float>(); in LLVMFuzzerTestOneInput()
46 float advance_run = getRunAdvance(advances, buf, start, count, offset); in LLVMFuzzerTestOneInput()
47 size_t advance_offset = getOffsetForAdvance(advances, buf, start, count, advance); in LLVMFuzzerTestOneInput()
/frameworks/minikin/include/minikin/
DLayout.h110 EndHyphenEdit endHyphen, float* advances) { in measureText() argument
111 return measureText(str, range, bidiFlags, paint, startHyphen, endHyphen, advances, nullptr, in measureText()
118 EndHyphenEdit endHyphen, float* advances, MinikinRect* bounds, in measureText() argument
120 return measureText(str, range, bidiFlags, paint, startHyphen, endHyphen, advances, bounds, in measureText()
126 EndHyphenEdit endHyphen, float* advances, MinikinRect* bounds,
129 const std::vector<float>& advances() const { return mAdvances; } in advances() function
188 Layout* layout, float* advances, MinikinRect* bounds,
195 float* advances, MinikinRect* bounds, uint32_t* clusterCount);
DMeasurement.h28 float getRunAdvance(const float* advances, const uint16_t* buf, size_t start, size_t count,
31 void distributeAdvances(float* advances, const uint16_t* buf, size_t start, size_t count);
33 size_t getOffsetForAdvance(const float* advances, const uint16_t* buf, size_t start, size_t count,
DGraphemeBreak.h33 static bool isGraphemeBreak(const float* advances, const uint16_t* buf, size_t start,
38 static size_t getTextRunCursor(const float* advances, const uint16_t* buf, size_t start,
DMeasuredText.h79 virtual void getMetrics(const U16StringPiece& text, std::vector<float>* advances,
152 void getMetrics(const U16StringPiece& text, std::vector<float>* advances,
197 void getMetrics(const U16StringPiece& /* text */, std::vector<float>* advances, in getMetrics() argument
200 (*advances)[mRange.getStart()] = mWidth; in getMetrics()
/frameworks/base/libs/hwui/jni/text/
DGraphemeBreak.cpp24 static void nIsGraphemeBreak(JNIEnv* env, jclass, jfloatArray advances, jcharArray text, jint start, in nIsGraphemeBreak() argument
26 if (start > end || env->GetArrayLength(advances) < end || in nIsGraphemeBreak()
35 ScopedFloatArrayRO advancesArray(env, advances); in nIsGraphemeBreak()
/frameworks/base/core/java/android/text/
DGraphemeClusterSegmentFinder.java55 float[] advances = sTempAdvances.getRawArray(); in GraphemeClusterSegmentFinder() local
60 textPaint.getTextWidths(chars, 0, text.length(), advances); in GraphemeClusterSegmentFinder()
62 GraphemeBreak.isGraphemeBreak(advances, chars, /* start= */ 0, /* end= */ text.length(), in GraphemeClusterSegmentFinder()
DTextLine.java673 public void measureAllBounds(@NonNull float[] bounds, @Nullable float[] advances) {
681 if (advances == null) {
682 advances = new float[mLen];
684 if (advances.length < mLen) {
686 + "result, needed: " + mLen + " had: " + advances.length);
702 measureRun(segStart, j, j, runIsRtl, null, null, advances, segStart, 0,
711 currh -= advances[offset];
715 currh += advances[offset];
734 advances[j] = rightX - leftX;
874 @Nullable FontMetricsInt fmi, @Nullable RectF drawBounds, @Nullable float[] advances,
[all …]
DGraphicsOperations.java56 boolean isRtl, float[] advances, int advancesIndex, Paint paint); in getTextRunAdvances() argument
/frameworks/base/graphics/java/android/graphics/
DPaint.java3014 @IntRange(from = 0) int contextCount, boolean isRtl, @Nullable float[] advances, in getTextRunAdvances() argument
3023 | (advances == null ? 0 : in getTextRunAdvances()
3024 (advances.length - (advancesIndex + count)))) < 0) { in getTextRunAdvances()
3033 isRtl ? BIDI_FORCE_RTL : BIDI_FORCE_LTR, advances, in getTextRunAdvances()
3040 contextCount, isRtl ? BIDI_FORCE_RTL : BIDI_FORCE_LTR, advances, advancesIndex); in getTextRunAdvances()
3043 if (advances != null) { in getTextRunAdvances()
3045 advances[i] *= mInvCompatScaling; in getTextRunAdvances()
3423 @Nullable float[] advances, int advancesIndex) { in getRunCharacterAdvance() argument
3425 advances, advancesIndex, null, null); in getRunCharacterAdvance()
3450 @Nullable float[] advances, int advancesIndex, @Nullable RectF drawBounds, in getRunCharacterAdvance() argument
[all …]
/frameworks/base/libs/hwui/jni/
DPaint.cpp186 jfloatArray advances, jint advancesIndex) { in doTextAdvances() argument
196 if (advances) { in doTextAdvances()
197 size_t advancesLength = env->GetArrayLength(advances); in doTextAdvances()
204 if (advances) { in doTextAdvances()
210 if (advances) { in doTextAdvances()
211 env->SetFloatArrayRegion(advances, advancesIndex, count, advancesArray.get()); in doTextAdvances()
218 jint bidiFlags, jfloatArray advances, jint advancesIndex) { in getTextAdvances___CIIIII_FI() argument
223 index - contextIndex, count, contextCount, bidiFlags, advances, advancesIndex); in getTextAdvances___CIIIII_FI()
230 jfloatArray advances, jint advancesIndex) { in getTextAdvances__StringIIIII_FI() argument
236 advances, advancesIndex); in getTextAdvances__StringIIIII_FI()
[all …]
/frameworks/base/libs/hwui/hwui/
DMinikinUtils.cpp101 size_t count, size_t bufSize, float* advances, in measureText() argument
113 endHyphen, advances, bounds, clusterCount, minikinRunFlag); in measureText()

12