OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 Google Inc. All rights reserved. | 2 * Copyright (c) 2012 Google Inc. All rights reserved. |
3 * Copyright (C) 2013 BlackBerry Limited. All rights reserved. | 3 * Copyright (C) 2013 BlackBerry Limited. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
695 if (runs[j].script != USCRIPT_COMMON | 695 if (runs[j].script != USCRIPT_COMMON |
696 && runs[j].script != USCRIPT_INHERITED) { | 696 && runs[j].script != USCRIPT_INHERITED) { |
697 nextResolvedRun = j; | 697 nextResolvedRun = j; |
698 break; | 698 break; |
699 } | 699 } |
700 } | 700 } |
701 } | 701 } |
702 | 702 |
703 static inline bool resolveCandidateRuns(Vector<CandidateRun>& runs) | 703 static inline bool resolveCandidateRuns(Vector<CandidateRun>& runs) |
704 { | 704 { |
705 UScriptCode scriptExtensions[8]; | 705 UScriptCode scriptExtensions[USCRIPT_CODE_LIMIT]; |
706 UErrorCode errorCode = U_ZERO_ERROR; | 706 UErrorCode errorCode = U_ZERO_ERROR; |
707 size_t length = runs.size(); | 707 size_t length = runs.size(); |
708 size_t nextResolvedRun = 0; | 708 size_t nextResolvedRun = 0; |
709 for (size_t i = 0; i < length; i++) { | 709 for (size_t i = 0; i < length; i++) { |
710 CandidateRun& run = runs[i]; | 710 CandidateRun& run = runs[i]; |
711 nextResolvedRun = 0; | 711 nextResolvedRun = 0; |
712 | 712 |
713 if (run.script == USCRIPT_INHERITED) | 713 if (run.script == USCRIPT_INHERITED) |
714 run.script = i > 0 ? runs[i - 1].script : USCRIPT_COMMON; | 714 run.script = i > 0 ? runs[i - 1].script : USCRIPT_COMMON; |
715 | 715 |
716 int extensionsLength = uscript_getScriptExtensions(run.character, | 716 int extensionsLength = uscript_getScriptExtensions(run.character, |
717 scriptExtensions, sizeof(scriptExtensions), &errorCode); | 717 scriptExtensions, sizeof(scriptExtensions) / sizeof(scriptExtensions
[0]), |
| 718 &errorCode); |
718 if (U_FAILURE(errorCode)) | 719 if (U_FAILURE(errorCode)) |
719 return false; | 720 return false; |
720 | 721 |
721 resolveRunBasedOnScriptExtensions(runs, run, i, length, | 722 resolveRunBasedOnScriptExtensions(runs, run, i, length, |
722 scriptExtensions, extensionsLength, nextResolvedRun); | 723 scriptExtensions, extensionsLength, nextResolvedRun); |
723 resolveRunBasedOnScriptValue(runs, run, i, length, | 724 resolveRunBasedOnScriptValue(runs, run, i, length, |
724 nextResolvedRun); | 725 nextResolvedRun); |
725 for (size_t j = i; j < nextResolvedRun; j++) | 726 for (size_t j = i; j < nextResolvedRun; j++) |
726 runs[j].script = runs[nextResolvedRun].script; | 727 runs[j].script = runs[nextResolvedRun].script; |
727 | 728 |
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1199 // possibly invalid from, to arguments. | 1200 // possibly invalid from, to arguments. |
1200 if (!foundToX && !foundFromX) | 1201 if (!foundToX && !foundFromX) |
1201 fromX = toX = 0; | 1202 fromX = toX = 0; |
1202 | 1203 |
1203 if (fromX < toX) | 1204 if (fromX < toX) |
1204 return FloatRect(point.x() + fromX, point.y(), toX - fromX, height); | 1205 return FloatRect(point.x() + fromX, point.y(), toX - fromX, height); |
1205 return FloatRect(point.x() + toX, point.y(), fromX - toX, height); | 1206 return FloatRect(point.x() + toX, point.y(), fromX - toX, height); |
1206 } | 1207 } |
1207 | 1208 |
1208 } // namespace blink | 1209 } // namespace blink |
OLD | NEW |