OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 int length, | 57 int length, |
58 const ComputedStyle& style, | 58 const ComputedStyle& style, |
59 TextDirection direction, | 59 TextDirection direction, |
60 TextRunFlags flags) { | 60 TextRunFlags flags) { |
61 TextDirection textDirection = direction; | 61 TextDirection textDirection = direction; |
62 bool directionalOverride = style.rtlOrdering() == EOrder::kVisual; | 62 bool directionalOverride = style.rtlOrdering() == EOrder::kVisual; |
63 if (flags != DefaultTextRunFlags) { | 63 if (flags != DefaultTextRunFlags) { |
64 if (flags & RespectDirection) | 64 if (flags & RespectDirection) |
65 textDirection = style.direction(); | 65 textDirection = style.direction(); |
66 if (flags & RespectDirectionOverride) | 66 if (flags & RespectDirectionOverride) |
67 directionalOverride |= isOverride(style.unicodeBidi()); | 67 directionalOverride |= isOverride(style.getUnicodeBidi()); |
68 } | 68 } |
69 | 69 |
70 TextRun::ExpansionBehavior expansion = | 70 TextRun::ExpansionBehavior expansion = |
71 TextRun::AllowTrailingExpansion | TextRun::ForbidLeadingExpansion; | 71 TextRun::AllowTrailingExpansion | TextRun::ForbidLeadingExpansion; |
72 TextRun run(characters, length, 0, 0, expansion, textDirection, | 72 TextRun run(characters, length, 0, 0, expansion, textDirection, |
73 directionalOverride); | 73 directionalOverride); |
74 return run; | 74 return run; |
75 } | 75 } |
76 | 76 |
77 TextRun constructTextRun(const Font& font, | 77 TextRun constructTextRun(const Font& font, |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 style, TextDirection::kLtr); | 149 style, TextDirection::kLtr); |
150 } | 150 } |
151 | 151 |
152 TextRun run = constructTextRunInternal(font, text.characters16() + offset, | 152 TextRun run = constructTextRunInternal(font, text.characters16() + offset, |
153 length, style, TextDirection::kLtr); | 153 length, style, TextDirection::kLtr); |
154 run.setDirection(directionForRun(run)); | 154 run.setDirection(directionForRun(run)); |
155 return run; | 155 return run; |
156 } | 156 } |
157 | 157 |
158 } // namespace blink | 158 } // namespace blink |
OLD | NEW |