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 27 matching lines...) Expand all Loading... |
38 namespace blink { | 38 namespace blink { |
39 | 39 |
40 template <typename CharacterType> | 40 template <typename CharacterType> |
41 static inline TextRun constructTextRunInternal(const Font& font, | 41 static inline TextRun constructTextRunInternal(const Font& font, |
42 const CharacterType* characters, | 42 const CharacterType* characters, |
43 int length, | 43 int length, |
44 const ComputedStyle& style, | 44 const ComputedStyle& style, |
45 TextDirection direction) { | 45 TextDirection direction) { |
46 TextRun::ExpansionBehavior expansion = | 46 TextRun::ExpansionBehavior expansion = |
47 TextRun::AllowTrailingExpansion | TextRun::ForbidLeadingExpansion; | 47 TextRun::AllowTrailingExpansion | TextRun::ForbidLeadingExpansion; |
48 bool directionalOverride = style.rtlOrdering() == EOrder::Visual; | 48 bool directionalOverride = style.rtlOrdering() == EOrder::kVisual; |
49 TextRun run(characters, length, 0, 0, expansion, direction, | 49 TextRun run(characters, length, 0, 0, expansion, direction, |
50 directionalOverride); | 50 directionalOverride); |
51 return run; | 51 return run; |
52 } | 52 } |
53 | 53 |
54 template <typename CharacterType> | 54 template <typename CharacterType> |
55 static inline TextRun constructTextRunInternal(const Font& font, | 55 static inline TextRun constructTextRunInternal(const Font& font, |
56 const CharacterType* characters, | 56 const CharacterType* characters, |
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::Visual; | 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.unicodeBidi()); |
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, |
(...skipping 76 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 |