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/CompositionMarker.h" |
10 #include "core/editing/markers/DocumentMarkerController.h" | 10 #include "core/editing/markers/DocumentMarkerController.h" |
(...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
674 } else { | 674 } else { |
675 inline_text_box_.PaintTextMatchMarkerForeground( | 675 inline_text_box_.PaintTextMatchMarkerForeground( |
676 paint_info, box_origin, ToTextMatchMarker(marker), style, font); | 676 paint_info, box_origin, ToTextMatchMarker(marker), style, font); |
677 } | 677 } |
678 break; | 678 break; |
679 case DocumentMarker::kComposition: { | 679 case DocumentMarker::kComposition: { |
680 const CompositionMarker& composition_marker = | 680 const CompositionMarker& composition_marker = |
681 ToCompositionMarker(marker); | 681 ToCompositionMarker(marker); |
682 CompositionUnderline underline( | 682 CompositionUnderline underline( |
683 composition_marker.StartOffset(), composition_marker.EndOffset(), | 683 composition_marker.StartOffset(), composition_marker.EndOffset(), |
684 composition_marker.UnderlineColor(), composition_marker.Thick(), | 684 composition_marker.UnderlineColor(), composition_marker.IsThick(), |
685 composition_marker.BackgroundColor()); | 685 composition_marker.BackgroundColor()); |
686 if (marker_paint_phase == DocumentMarkerPaintPhase::kBackground) | 686 if (marker_paint_phase == DocumentMarkerPaintPhase::kBackground) |
687 PaintSingleCompositionBackgroundRun( | 687 PaintSingleCompositionBackgroundRun( |
688 paint_info.context, box_origin, style, font, | 688 paint_info.context, box_origin, style, font, |
689 underline.BackgroundColor(), UnderlinePaintStart(underline), | 689 underline.BackgroundColor(), UnderlinePaintStart(underline), |
690 UnderlinePaintEnd(underline)); | 690 UnderlinePaintEnd(underline)); |
691 else | 691 else |
692 PaintCompositionUnderline(paint_info.context, box_origin, underline); | 692 PaintCompositionUnderline(paint_info.context, box_origin, underline); |
693 } break; | 693 } break; |
694 default: | 694 default: |
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1176 | 1176 |
1177 LayoutRect box_rect(box_origin, LayoutSize(inline_text_box_.LogicalWidth(), | 1177 LayoutRect box_rect(box_origin, LayoutSize(inline_text_box_.LogicalWidth(), |
1178 inline_text_box_.LogicalHeight())); | 1178 inline_text_box_.LogicalHeight())); |
1179 context.Clip(FloatRect(box_rect)); | 1179 context.Clip(FloatRect(box_rect)); |
1180 context.DrawHighlightForText(font, run, FloatPoint(box_origin), | 1180 context.DrawHighlightForText(font, run, FloatPoint(box_origin), |
1181 box_rect.Height().ToInt(), color, | 1181 box_rect.Height().ToInt(), color, |
1182 paint_offsets.first, paint_offsets.second); | 1182 paint_offsets.first, paint_offsets.second); |
1183 } | 1183 } |
1184 | 1184 |
1185 } // namespace blink | 1185 } // namespace blink |
OLD | NEW |