OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) |
3 * Copyright (C) 2003, 2004, 2006, 2007, 2008 Apple Inc. All right reserved. | 3 * Copyright (C) 2003, 2004, 2006, 2007, 2008 Apple Inc. All right reserved. |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
(...skipping 30 matching lines...) Expand all Loading... |
41 public: | 41 public: |
42 MidpointState() { Reset(); } | 42 MidpointState() { Reset(); } |
43 | 43 |
44 void Reset() { | 44 void Reset() { |
45 num_midpoints_ = 0; | 45 num_midpoints_ = 0; |
46 current_midpoint_ = 0; | 46 current_midpoint_ = 0; |
47 between_midpoints_ = false; | 47 between_midpoints_ = false; |
48 } | 48 } |
49 | 49 |
50 void StartIgnoringSpaces(const Iterator& midpoint) { | 50 void StartIgnoringSpaces(const Iterator& midpoint) { |
51 ASSERT(!(num_midpoints_ % 2)); | 51 DCHECK(!(num_midpoints_ % 2)); |
52 AddMidpoint(midpoint); | 52 AddMidpoint(midpoint); |
53 } | 53 } |
54 | 54 |
55 void StopIgnoringSpaces(const Iterator& midpoint) { | 55 void StopIgnoringSpaces(const Iterator& midpoint) { |
56 ASSERT(num_midpoints_ % 2); | 56 DCHECK(num_midpoints_ % 2); |
57 AddMidpoint(midpoint); | 57 AddMidpoint(midpoint); |
58 } | 58 } |
59 | 59 |
60 // Adding a pair of midpoints before a character will split it out into a new | 60 // Adding a pair of midpoints before a character will split it out into a new |
61 // line box. | 61 // line box. |
62 void EnsureCharacterGetsLineBox(Iterator& text_paragraph_separator) { | 62 void EnsureCharacterGetsLineBox(Iterator& text_paragraph_separator) { |
63 StartIgnoringSpaces(Iterator(0, | 63 StartIgnoringSpaces(Iterator(0, |
64 text_paragraph_separator.GetLineLayoutItem(), | 64 text_paragraph_separator.GetLineLayoutItem(), |
65 text_paragraph_separator.Offset() - 1)); | 65 text_paragraph_separator.Offset() - 1)); |
66 StopIgnoringSpaces(Iterator(0, text_paragraph_separator.GetLineLayoutItem(), | 66 StopIgnoringSpaces(Iterator(0, text_paragraph_separator.GetLineLayoutItem(), |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 void SetLastStrongDir(WTF::Unicode::CharDirection last_strong_dir) { | 249 void SetLastStrongDir(WTF::Unicode::CharDirection last_strong_dir) { |
250 status_.last_strong = last_strong_dir; | 250 status_.last_strong = last_strong_dir; |
251 } | 251 } |
252 void SetEorDir(WTF::Unicode::CharDirection eor_dir) { status_.eor = eor_dir; } | 252 void SetEorDir(WTF::Unicode::CharDirection eor_dir) { status_.eor = eor_dir; } |
253 | 253 |
254 WTF::Unicode::CharDirection Dir() const { return direction_; } | 254 WTF::Unicode::CharDirection Dir() const { return direction_; } |
255 void SetDir(WTF::Unicode::CharDirection d) { direction_ = d; } | 255 void SetDir(WTF::Unicode::CharDirection d) { direction_ = d; } |
256 | 256 |
257 const BidiStatus& Status() const { return status_; } | 257 const BidiStatus& Status() const { return status_; } |
258 void SetStatus(const BidiStatus s) { | 258 void SetStatus(const BidiStatus s) { |
259 ASSERT(s.context); | 259 DCHECK(s.context); |
260 status_ = s; | 260 status_ = s; |
261 paragraph_directionality_ = s.context->Dir() == WTF::Unicode::kLeftToRight | 261 paragraph_directionality_ = s.context->Dir() == WTF::Unicode::kLeftToRight |
262 ? TextDirection::kLtr | 262 ? TextDirection::kLtr |
263 : TextDirection::kRtl; | 263 : TextDirection::kRtl; |
264 } | 264 } |
265 | 265 |
266 MidpointState<Iterator>& GetMidpointState() { return midpoint_state_; } | 266 MidpointState<Iterator>& GetMidpointState() { return midpoint_state_; } |
267 | 267 |
268 // The current algorithm handles nested isolates one layer of nesting at a | 268 // The current algorithm handles nested isolates one layer of nesting at a |
269 // time. But when we layout each isolated span, we will walk into (and | 269 // time. But when we layout each isolated span, we will walk into (and |
270 // ignore) all child isolated spans. | 270 // ignore) all child isolated spans. |
271 void EnterIsolate() { nested_isolate_count_++; } | 271 void EnterIsolate() { nested_isolate_count_++; } |
272 void ExitIsolate() { | 272 void ExitIsolate() { |
273 ASSERT(nested_isolate_count_ >= 1); | 273 DCHECK_GE(nested_isolate_count_, 1u); |
274 nested_isolate_count_--; | 274 nested_isolate_count_--; |
275 } | 275 } |
276 bool InIsolate() const { return nested_isolate_count_; } | 276 bool InIsolate() const { return nested_isolate_count_; } |
277 | 277 |
278 void Embed(WTF::Unicode::CharDirection, BidiEmbeddingSource); | 278 void Embed(WTF::Unicode::CharDirection, BidiEmbeddingSource); |
279 bool CommitExplicitEmbedding(BidiRunList<Run>&); | 279 bool CommitExplicitEmbedding(BidiRunList<Run>&); |
280 | 280 |
281 void CreateBidiRunsForLine(const Iterator& end, | 281 void CreateBidiRunsForLine(const Iterator& end, |
282 VisualDirectionOverride = kNoVisualOverride, | 282 VisualDirectionOverride = kNoVisualOverride, |
283 bool hard_line_break = false, | 283 bool hard_line_break = false, |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
378 bool* has_strong_directionality); | 378 bool* has_strong_directionality); |
379 | 379 |
380 Vector<BidiEmbedding, 8> current_explicit_embedding_sequence_; | 380 Vector<BidiEmbedding, 8> current_explicit_embedding_sequence_; |
381 HashMap<Run*, MidpointState<Iterator>> midpoint_state_for_isolated_run_; | 381 HashMap<Run*, MidpointState<Iterator>> midpoint_state_for_isolated_run_; |
382 }; | 382 }; |
383 | 383 |
384 #if DCHECK_IS_ON() | 384 #if DCHECK_IS_ON() |
385 template <class Iterator, class Run, class IsolatedRun> | 385 template <class Iterator, class Run, class IsolatedRun> |
386 BidiResolver<Iterator, Run, IsolatedRun>::~BidiResolver() { | 386 BidiResolver<Iterator, Run, IsolatedRun>::~BidiResolver() { |
387 // The owner of this resolver should have handled the isolated runs. | 387 // The owner of this resolver should have handled the isolated runs. |
388 ASSERT(isolated_runs_.IsEmpty()); | 388 DCHECK(isolated_runs_.IsEmpty()); |
389 ASSERT(!runs_.RunCount()); | 389 DCHECK(!runs_.RunCount()); |
390 } | 390 } |
391 #endif | 391 #endif |
392 | 392 |
393 template <class Iterator, class Run, class IsolatedRun> | 393 template <class Iterator, class Run, class IsolatedRun> |
394 void BidiResolver<Iterator, Run, IsolatedRun>::AppendRun( | 394 void BidiResolver<Iterator, Run, IsolatedRun>::AppendRun( |
395 BidiRunList<Run>& runs) { | 395 BidiRunList<Run>& runs) { |
396 if (!empty_run_ && !eor_.AtEnd()) { | 396 if (!empty_run_ && !eor_.AtEnd()) { |
397 unsigned start_offset = sor_.Offset(); | 397 unsigned start_offset = sor_.Offset(); |
398 unsigned end_offset = eor_.Offset(); | 398 unsigned end_offset = eor_.Offset(); |
399 | 399 |
(...skipping 27 matching lines...) Expand all Loading... |
427 direction_ = WTF::Unicode::kOtherNeutral; | 427 direction_ = WTF::Unicode::kOtherNeutral; |
428 status_.eor = WTF::Unicode::kOtherNeutral; | 428 status_.eor = WTF::Unicode::kOtherNeutral; |
429 } | 429 } |
430 | 430 |
431 template <class Iterator, class Run, class IsolatedRun> | 431 template <class Iterator, class Run, class IsolatedRun> |
432 void BidiResolver<Iterator, Run, IsolatedRun>::Embed( | 432 void BidiResolver<Iterator, Run, IsolatedRun>::Embed( |
433 WTF::Unicode::CharDirection dir, | 433 WTF::Unicode::CharDirection dir, |
434 BidiEmbeddingSource source) { | 434 BidiEmbeddingSource source) { |
435 // Isolated spans compute base directionality during their own UBA run. | 435 // Isolated spans compute base directionality during their own UBA run. |
436 // Do not insert fake embed characters once we enter an isolated span. | 436 // Do not insert fake embed characters once we enter an isolated span. |
437 ASSERT(!InIsolate()); | 437 DCHECK(!InIsolate()); |
438 using namespace WTF::Unicode; | 438 using namespace WTF::Unicode; |
439 | 439 |
440 ASSERT(dir == kPopDirectionalFormat || dir == kLeftToRightEmbedding || | 440 DCHECK(dir == kPopDirectionalFormat || dir == kLeftToRightEmbedding || |
441 dir == kLeftToRightOverride || dir == kRightToLeftEmbedding || | 441 dir == kLeftToRightOverride || dir == kRightToLeftEmbedding || |
442 dir == kRightToLeftOverride); | 442 dir == kRightToLeftOverride); |
443 current_explicit_embedding_sequence_.push_back(BidiEmbedding(dir, source)); | 443 current_explicit_embedding_sequence_.push_back(BidiEmbedding(dir, source)); |
444 } | 444 } |
445 | 445 |
446 template <class Iterator, class Run, class IsolatedRun> | 446 template <class Iterator, class Run, class IsolatedRun> |
447 void BidiResolver<Iterator, Run, IsolatedRun>:: | 447 void BidiResolver<Iterator, Run, IsolatedRun>:: |
448 CheckDirectionInLowerRaiseEmbeddingLevel() { | 448 CheckDirectionInLowerRaiseEmbeddingLevel() { |
449 using namespace WTF::Unicode; | 449 using namespace WTF::Unicode; |
450 | 450 |
451 ASSERT(status_.eor != kOtherNeutral || eor_.AtEnd()); | 451 DCHECK(status_.eor != kOtherNeutral || eor_.AtEnd()); |
452 ASSERT(status_.last != kNonSpacingMark && status_.last != kBoundaryNeutral && | 452 DCHECK_NE(status_.last, kNonSpacingMark); |
453 status_.last != kRightToLeftEmbedding && | 453 DCHECK_NE(status_.last, kBoundaryNeutral); |
454 status_.last != kLeftToRightEmbedding && | 454 DCHECK_NE(status_.last, kRightToLeftEmbedding); |
455 status_.last != kRightToLeftOverride && | 455 DCHECK_NE(status_.last, kLeftToRightEmbedding); |
456 status_.last != kLeftToRightOverride && | 456 DCHECK_NE(status_.last, kRightToLeftOverride); |
457 status_.last != kPopDirectionalFormat); | 457 DCHECK_NE(status_.last, kLeftToRightOverride); |
| 458 DCHECK_NE(status_.last, kPopDirectionalFormat); |
458 if (direction_ == kOtherNeutral) | 459 if (direction_ == kOtherNeutral) |
459 direction_ = | 460 direction_ = |
460 status_.last_strong == kLeftToRight ? kLeftToRight : kRightToLeft; | 461 status_.last_strong == kLeftToRight ? kLeftToRight : kRightToLeft; |
461 } | 462 } |
462 | 463 |
463 template <class Iterator, class Run, class IsolatedRun> | 464 template <class Iterator, class Run, class IsolatedRun> |
464 void BidiResolver<Iterator, Run, IsolatedRun>::LowerExplicitEmbeddingLevel( | 465 void BidiResolver<Iterator, Run, IsolatedRun>::LowerExplicitEmbeddingLevel( |
465 BidiRunList<Run>& runs, | 466 BidiRunList<Run>& runs, |
466 WTF::Unicode::CharDirection from) { | 467 WTF::Unicode::CharDirection from) { |
467 using namespace WTF::Unicode; | 468 using namespace WTF::Unicode; |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
542 empty_run_ = true; | 543 empty_run_ = true; |
543 | 544 |
544 SetLastDir(to); | 545 SetLastDir(to); |
545 SetLastStrongDir(to); | 546 SetLastStrongDir(to); |
546 eor_ = Iterator(); | 547 eor_ = Iterator(); |
547 } | 548 } |
548 | 549 |
549 template <class Iterator, class Run, class IsolatedRun> | 550 template <class Iterator, class Run, class IsolatedRun> |
550 void BidiResolver<Iterator, Run, IsolatedRun>::ComputeTrailingSpace( | 551 void BidiResolver<Iterator, Run, IsolatedRun>::ComputeTrailingSpace( |
551 BidiRunList<Run>& runs) { | 552 BidiRunList<Run>& runs) { |
552 ASSERT(runs.RunCount()); | 553 DCHECK(runs.RunCount()); |
553 | 554 |
554 Run* trailing_space_run = runs.LogicallyLastRun(); | 555 Run* trailing_space_run = runs.LogicallyLastRun(); |
555 | 556 |
556 int first_space = FindFirstTrailingSpaceAtRun(trailing_space_run); | 557 int first_space = FindFirstTrailingSpaceAtRun(trailing_space_run); |
557 if (first_space == trailing_space_run->Stop()) | 558 if (first_space == trailing_space_run->Stop()) |
558 return; | 559 return; |
559 | 560 |
560 bool should_reorder = | 561 bool should_reorder = |
561 trailing_space_run != (paragraph_directionality_ == TextDirection::kLtr | 562 trailing_space_run != (paragraph_directionality_ == TextDirection::kLtr |
562 ? runs.LastRun() | 563 ? runs.LastRun() |
563 : runs.FirstRun()); | 564 : runs.FirstRun()); |
564 if (first_space != trailing_space_run->Start()) { | 565 if (first_space != trailing_space_run->Start()) { |
565 BidiContext* base_context = Context(); | 566 BidiContext* base_context = Context(); |
566 while (BidiContext* parent = base_context->Parent()) | 567 while (BidiContext* parent = base_context->Parent()) |
567 base_context = parent; | 568 base_context = parent; |
568 | 569 |
569 trailing_space_run_ = AddTrailingRun( | 570 trailing_space_run_ = AddTrailingRun( |
570 runs, first_space, trailing_space_run->stop_, trailing_space_run, | 571 runs, first_space, trailing_space_run->stop_, trailing_space_run, |
571 base_context, paragraph_directionality_); | 572 base_context, paragraph_directionality_); |
572 ASSERT(trailing_space_run_); | 573 DCHECK(trailing_space_run_); |
573 trailing_space_run->stop_ = first_space; | 574 trailing_space_run->stop_ = first_space; |
574 return; | 575 return; |
575 } | 576 } |
576 if (!should_reorder) { | 577 if (!should_reorder) { |
577 trailing_space_run_ = trailing_space_run; | 578 trailing_space_run_ = trailing_space_run; |
578 return; | 579 return; |
579 } | 580 } |
580 | 581 |
581 // Apply L1 rule. | 582 // Apply L1 rule. |
582 if (paragraph_directionality_ == TextDirection::kLtr) { | 583 if (paragraph_directionality_ == TextDirection::kLtr) { |
583 runs.MoveRunToEnd(trailing_space_run); | 584 runs.MoveRunToEnd(trailing_space_run); |
584 trailing_space_run->level_ = 0; | 585 trailing_space_run->level_ = 0; |
585 } else { | 586 } else { |
586 runs.MoveRunToBeginning(trailing_space_run); | 587 runs.MoveRunToBeginning(trailing_space_run); |
587 trailing_space_run->level_ = 1; | 588 trailing_space_run->level_ = 1; |
588 } | 589 } |
589 trailing_space_run_ = trailing_space_run; | 590 trailing_space_run_ = trailing_space_run; |
590 } | 591 } |
591 | 592 |
592 template <class Iterator, class Run, class IsolatedRun> | 593 template <class Iterator, class Run, class IsolatedRun> |
593 bool BidiResolver<Iterator, Run, IsolatedRun>::CommitExplicitEmbedding( | 594 bool BidiResolver<Iterator, Run, IsolatedRun>::CommitExplicitEmbedding( |
594 BidiRunList<Run>& runs) { | 595 BidiRunList<Run>& runs) { |
595 // When we're "inIsolate()" we're resolving the parent context which | 596 // When we're "inIsolate()" we're resolving the parent context which |
596 // ignores (skips over) the isolated content, including embedding levels. | 597 // ignores (skips over) the isolated content, including embedding levels. |
597 // We should never accrue embedding levels while skipping over isolated | 598 // We should never accrue embedding levels while skipping over isolated |
598 // content. | 599 // content. |
599 ASSERT(!InIsolate() || current_explicit_embedding_sequence_.IsEmpty()); | 600 DCHECK(!InIsolate() || current_explicit_embedding_sequence_.IsEmpty()); |
600 | 601 |
601 using namespace WTF::Unicode; | 602 using namespace WTF::Unicode; |
602 | 603 |
603 unsigned char from_level = Context()->Level(); | 604 unsigned char from_level = Context()->Level(); |
604 RefPtr<BidiContext> to_context = Context(); | 605 RefPtr<BidiContext> to_context = Context(); |
605 | 606 |
606 for (size_t i = 0; i < current_explicit_embedding_sequence_.size(); ++i) { | 607 for (size_t i = 0; i < current_explicit_embedding_sequence_.size(); ++i) { |
607 BidiEmbedding embedding = current_explicit_embedding_sequence_[i]; | 608 BidiEmbedding embedding = current_explicit_embedding_sequence_[i]; |
608 if (embedding.Direction() == kPopDirectionalFormat) { | 609 if (embedding.Direction() == kPopDirectionalFormat) { |
609 if (BidiContext* parent_context = to_context->Parent()) | 610 if (BidiContext* parent_context = to_context->Parent()) |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
784 } | 785 } |
785 | 786 |
786 template <class Iterator, class Run, class IsolatedRun> | 787 template <class Iterator, class Run, class IsolatedRun> |
787 void BidiResolver<Iterator, Run, IsolatedRun>::CreateBidiRunsForLine( | 788 void BidiResolver<Iterator, Run, IsolatedRun>::CreateBidiRunsForLine( |
788 const Iterator& end, | 789 const Iterator& end, |
789 VisualDirectionOverride override, | 790 VisualDirectionOverride override, |
790 bool hard_line_break, | 791 bool hard_line_break, |
791 bool reorder_runs) { | 792 bool reorder_runs) { |
792 using namespace WTF::Unicode; | 793 using namespace WTF::Unicode; |
793 | 794 |
794 ASSERT(direction_ == kOtherNeutral); | 795 DCHECK_EQ(direction_, kOtherNeutral); |
795 trailing_space_run_ = 0; | 796 trailing_space_run_ = 0; |
796 | 797 |
797 end_of_line_ = end; | 798 end_of_line_ = end; |
798 | 799 |
799 if (override != kNoVisualOverride) { | 800 if (override != kNoVisualOverride) { |
800 empty_run_ = false; | 801 empty_run_ = false; |
801 sor_ = current_; | 802 sor_ = current_; |
802 eor_ = Iterator(); | 803 eor_ = Iterator(); |
803 while (current_ != end && !current_.AtEnd()) { | 804 while (current_ != end && !current_.AtEnd()) { |
804 eor_ = current_; | 805 eor_ = current_; |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
870 dir_current = Context()->Dir(); | 871 dir_current = Context()->Dir(); |
871 else if (dir_current == kNonSpacingMark) | 872 else if (dir_current == kNonSpacingMark) |
872 dir_current = status_.last; | 873 dir_current = status_.last; |
873 } | 874 } |
874 | 875 |
875 // We ignore all character directionality while in unicode-bidi: isolate | 876 // We ignore all character directionality while in unicode-bidi: isolate |
876 // spans. We'll handle ordering the isolated characters in a second pass. | 877 // spans. We'll handle ordering the isolated characters in a second pass. |
877 if (InIsolate()) | 878 if (InIsolate()) |
878 dir_current = kOtherNeutral; | 879 dir_current = kOtherNeutral; |
879 | 880 |
880 ASSERT(status_.eor != kOtherNeutral || eor_.AtEnd()); | 881 DCHECK(status_.eor != kOtherNeutral || eor_.AtEnd()); |
881 switch (dir_current) { | 882 switch (dir_current) { |
882 // embedding and overrides (X1-X9 in the Bidi specs) | 883 // embedding and overrides (X1-X9 in the Bidi specs) |
883 case kRightToLeftEmbedding: | 884 case kRightToLeftEmbedding: |
884 case kLeftToRightEmbedding: | 885 case kLeftToRightEmbedding: |
885 case kRightToLeftOverride: | 886 case kRightToLeftOverride: |
886 case kLeftToRightOverride: | 887 case kLeftToRightOverride: |
887 case kPopDirectionalFormat: | 888 case kPopDirectionalFormat: |
888 Embed(dir_current, kFromUnicode); | 889 Embed(dir_current, kFromUnicode); |
889 CommitExplicitEmbedding(runs_); | 890 CommitExplicitEmbedding(runs_); |
890 break; | 891 break; |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1153 case kLeftToRight: | 1154 case kLeftToRight: |
1154 case kRightToLeft: | 1155 case kRightToLeft: |
1155 case kArabicNumber: | 1156 case kArabicNumber: |
1156 direction_ = status_.eor; | 1157 direction_ = status_.eor; |
1157 break; | 1158 break; |
1158 case kEuropeanNumber: | 1159 case kEuropeanNumber: |
1159 direction_ = status_.last_strong == kLeftToRight ? kLeftToRight | 1160 direction_ = status_.last_strong == kLeftToRight ? kLeftToRight |
1160 : kEuropeanNumber; | 1161 : kEuropeanNumber; |
1161 break; | 1162 break; |
1162 default: | 1163 default: |
1163 ASSERT_NOT_REACHED(); | 1164 NOTREACHED(); |
1164 } | 1165 } |
1165 AppendRun(runs_); | 1166 AppendRun(runs_); |
1166 } | 1167 } |
1167 current_ = end; | 1168 current_ = end; |
1168 status_ = state_at_end.status_; | 1169 status_ = state_at_end.status_; |
1169 sor_ = state_at_end.sor_; | 1170 sor_ = state_at_end.sor_; |
1170 eor_ = state_at_end.eor_; | 1171 eor_ = state_at_end.eor_; |
1171 last_ = state_at_end.last_; | 1172 last_ = state_at_end.last_; |
1172 reached_end_of_line_ = state_at_end.reached_end_of_line_; | 1173 reached_end_of_line_ = state_at_end.reached_end_of_line_; |
1173 last_before_et_ = state_at_end.last_before_et_; | 1174 last_before_et_ = state_at_end.last_before_et_; |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1210 | 1211 |
1211 if (!hard_line_break && runs_.RunCount() && NeedsTrailingSpace(runs_)) { | 1212 if (!hard_line_break && runs_.RunCount() && NeedsTrailingSpace(runs_)) { |
1212 ComputeTrailingSpace(runs_); | 1213 ComputeTrailingSpace(runs_); |
1213 } | 1214 } |
1214 } | 1215 } |
1215 | 1216 |
1216 template <class Iterator, class Run, class IsolatedRun> | 1217 template <class Iterator, class Run, class IsolatedRun> |
1217 void BidiResolver<Iterator, Run, IsolatedRun>::SetMidpointStateForIsolatedRun( | 1218 void BidiResolver<Iterator, Run, IsolatedRun>::SetMidpointStateForIsolatedRun( |
1218 Run& run, | 1219 Run& run, |
1219 const MidpointState<Iterator>& midpoint) { | 1220 const MidpointState<Iterator>& midpoint) { |
1220 ASSERT(!midpoint_state_for_isolated_run_.Contains(&run)); | 1221 DCHECK(!midpoint_state_for_isolated_run_.Contains(&run)); |
1221 midpoint_state_for_isolated_run_.insert(&run, midpoint); | 1222 midpoint_state_for_isolated_run_.insert(&run, midpoint); |
1222 } | 1223 } |
1223 | 1224 |
1224 template <class Iterator, class Run, class IsolatedRun> | 1225 template <class Iterator, class Run, class IsolatedRun> |
1225 MidpointState<Iterator> | 1226 MidpointState<Iterator> |
1226 BidiResolver<Iterator, Run, IsolatedRun>::MidpointStateForIsolatedRun( | 1227 BidiResolver<Iterator, Run, IsolatedRun>::MidpointStateForIsolatedRun( |
1227 Run& run) { | 1228 Run& run) { |
1228 return midpoint_state_for_isolated_run_.Take(&run); | 1229 return midpoint_state_for_isolated_run_.Take(&run); |
1229 } | 1230 } |
1230 | 1231 |
1231 } // namespace blink | 1232 } // namespace blink |
1232 | 1233 |
1233 #endif // BidiResolver_h | 1234 #endif // BidiResolver_h |
OLD | NEW |