OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "core/paint/InlineTextBoxPainter.h" | 5 #include "core/paint/InlineTextBoxPainter.h" |
6 | 6 |
7 #include "core/editing/CompositionUnderline.h" | 7 #include "core/editing/CompositionUnderline.h" |
8 #include "core/editing/Editor.h" | 8 #include "core/editing/Editor.h" |
| 9 #include "core/editing/markers/CompositionMarker.h" |
9 #include "core/editing/markers/DocumentMarkerController.h" | 10 #include "core/editing/markers/DocumentMarkerController.h" |
10 #include "core/editing/markers/TextMatchMarker.h" | 11 #include "core/editing/markers/TextMatchMarker.h" |
11 #include "core/frame/LocalFrame.h" | 12 #include "core/frame/LocalFrame.h" |
12 #include "core/layout/LayoutTextCombine.h" | 13 #include "core/layout/LayoutTextCombine.h" |
13 #include "core/layout/LayoutTheme.h" | 14 #include "core/layout/LayoutTheme.h" |
14 #include "core/layout/api/LineLayoutAPIShim.h" | 15 #include "core/layout/api/LineLayoutAPIShim.h" |
15 #include "core/layout/api/LineLayoutBox.h" | 16 #include "core/layout/api/LineLayoutBox.h" |
16 #include "core/layout/line/InlineTextBox.h" | 17 #include "core/layout/line/InlineTextBox.h" |
17 #include "core/paint/AppliedDecorationPainter.h" | 18 #include "core/paint/AppliedDecorationPainter.h" |
18 #include "core/paint/DecorationInfo.h" | 19 #include "core/paint/DecorationInfo.h" |
(...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
669 case DocumentMarker::kTextMatch: | 670 case DocumentMarker::kTextMatch: |
670 if (marker_paint_phase == DocumentMarkerPaintPhase::kBackground) { | 671 if (marker_paint_phase == DocumentMarkerPaintPhase::kBackground) { |
671 inline_text_box_.PaintTextMatchMarkerBackground( | 672 inline_text_box_.PaintTextMatchMarkerBackground( |
672 paint_info, box_origin, ToTextMatchMarker(marker), style, font); | 673 paint_info, box_origin, ToTextMatchMarker(marker), style, font); |
673 } else { | 674 } else { |
674 inline_text_box_.PaintTextMatchMarkerForeground( | 675 inline_text_box_.PaintTextMatchMarkerForeground( |
675 paint_info, box_origin, ToTextMatchMarker(marker), style, font); | 676 paint_info, box_origin, ToTextMatchMarker(marker), style, font); |
676 } | 677 } |
677 break; | 678 break; |
678 case DocumentMarker::kComposition: { | 679 case DocumentMarker::kComposition: { |
679 CompositionUnderline underline(marker.StartOffset(), marker.EndOffset(), | 680 const CompositionMarker& composition_marker = |
680 marker.UnderlineColor(), marker.Thick(), | 681 ToCompositionMarker(marker); |
681 marker.BackgroundColor()); | 682 CompositionUnderline underline( |
| 683 composition_marker.StartOffset(), composition_marker.EndOffset(), |
| 684 composition_marker.UnderlineColor(), composition_marker.Thick(), |
| 685 composition_marker.BackgroundColor()); |
682 if (marker_paint_phase == DocumentMarkerPaintPhase::kBackground) | 686 if (marker_paint_phase == DocumentMarkerPaintPhase::kBackground) |
683 PaintSingleCompositionBackgroundRun( | 687 PaintSingleCompositionBackgroundRun( |
684 paint_info.context, box_origin, style, font, | 688 paint_info.context, box_origin, style, font, |
685 underline.BackgroundColor(), UnderlinePaintStart(underline), | 689 underline.BackgroundColor(), UnderlinePaintStart(underline), |
686 UnderlinePaintEnd(underline)); | 690 UnderlinePaintEnd(underline)); |
687 else | 691 else |
688 PaintCompositionUnderline(paint_info.context, box_origin, underline); | 692 PaintCompositionUnderline(paint_info.context, box_origin, underline); |
689 } break; | 693 } break; |
690 default: | 694 default: |
691 NOTREACHED(); | 695 NOTREACHED(); |
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1172 | 1176 |
1173 LayoutRect box_rect(box_origin, LayoutSize(inline_text_box_.LogicalWidth(), | 1177 LayoutRect box_rect(box_origin, LayoutSize(inline_text_box_.LogicalWidth(), |
1174 inline_text_box_.LogicalHeight())); | 1178 inline_text_box_.LogicalHeight())); |
1175 context.Clip(FloatRect(box_rect)); | 1179 context.Clip(FloatRect(box_rect)); |
1176 context.DrawHighlightForText(font, run, FloatPoint(box_origin), | 1180 context.DrawHighlightForText(font, run, FloatPoint(box_origin), |
1177 box_rect.Height().ToInt(), color, | 1181 box_rect.Height().ToInt(), color, |
1178 paint_offsets.first, paint_offsets.second); | 1182 paint_offsets.first, paint_offsets.second); |
1179 } | 1183 } |
1180 | 1184 |
1181 } // namespace blink | 1185 } // namespace blink |
OLD | NEW |