Lines Matching defs:levels

28      * This means that there is a Bidi object with a levels
31 * Only if the length of the text is zero, then levels==dirProps==NULL.
44 * Here, the levels array is scanned as soon as necessary, and a vector of
53 * In a further attempt to save memory, the levels array is never changed
58 * which is not reflected in the levels array.
59 * This allows a line Bidi object to use the same levels array as
63 * paragraph's levels and dirProps arrays are reused by way of setting
65 * change the now shared levels for (L1).
73 * the paragraph's levels array that we just point into.
86 byte[] levels = bidi.levels;
107 while (start > 0 && levels[start - 1] == paraLevel) {
151 lineBidi.levels = lineBidi.levelsMemory;
152 System.arraycopy(paraBidi.levels, start, lineBidi.levels, 0,
161 * The parent's levels are all either
173 byte[] levels = lineBidi.levels;
182 /* all levels are at paraLevel */
186 level = (byte)(levels[0] & 1);
193 levels[0] */
196 /* see if levels[1..trailingWSStart-1] have the same
197 direction as levels[0] and paraLevel */
203 } else if ((levels[i] & 1) != level) {
217 /* all levels are implicitly at paraLevel (important for
225 /* all levels are implicitly at paraLevel (important for
243 return bidi.levels[charIndex];
253 /* the current levels array does not reflect the WS run */
255 * After the previous if(), we know that the levels array
257 * reflect itself all the levels.
259 * we need to create a new levels array.
263 Arrays.fill(bidi.levels, start, length, bidi.paraLevel);
265 /* this new levels array is set for the line and reflects the WS run */
268 if (length < bidi.levels.length) {
269 byte[] levels = new byte[length];
270 System.arraycopy(bidi.levels, 0, levels, 0, length);
271 return levels;
273 return bidi.levels;
278 /* this is done based on runs rather than on levels since levels have
351 * reflected in levels[] if this is not a paragraph object.
370 byte[] levels;
381 levels = bidi.levels;
396 while (firstRun < runCount && levels[runs[firstRun].start] < maxLevel) {
405 levels[runs[limitRun].start]>=maxLevel; ) {}
466 * Compute the runs array from the levels array.
491 byte[] levels = bidi.levels;
500 * modify the levels array which a line Bidi object shares
503 * levels[]!=paraLevel but we have to treat it like it were so.
510 if (levels[i] != level) {
512 level = levels[i];
522 getSingleRun(bidi, levels[0]);
552 level = levels[i];
561 while (++i < limit && levels[i] == level) {}
588 runs[i].level = levels[runs[i].start];
628 static int[] prepareReorder(byte[] levels, byte[] pMinLevel, byte[] pMaxLevel)
633 if (levels == null || levels.length <= 0) {
640 for (start = levels.length; start>0; ) {
641 level = levels[--start];
659 int[] indexMap = new int[levels.length];
660 for (start = levels.length; start > 0; ) {
668 static int[] reorderLogical(byte[] levels)
674 int[] indexMap = prepareReorder(levels, aMinLevel, aMaxLevel);
694 /* loop for all sequences of levels to reorder at the current maxLevel */
696 /* look for a sequence of levels that are all at >=maxLevel */
698 while (start < levels.length && levels[start] < maxLevel) {
701 if (start >= levels.length) {
706 for (limit = start; ++limit < levels.length && levels[limit] >= maxLevel; ) {}
727 if (limit == levels.length) {
737 static int[] reorderVisual(byte[] levels)
744 int[] indexMap = prepareReorder(levels, aMinLevel, aMaxLevel);
764 /* loop for all sequences of levels to reorder at the current maxLevel */
766 /* look for a sequence of levels that are all at >=maxLevel */
768 while (start < levels.length && levels[start] < maxLevel) {
771 if (start >= levels.length) {
776 for (limit = start; ++limit < levels.length && levels[limit] >= maxLevel; ) {}
780 * We don't need to swap the levels for the purpose of this
781 * algorithm: the sequence of levels that we look at does not
794 if (limit == levels.length) {