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/DocumentMarkerController.h" | 9 #include "core/editing/markers/DocumentMarkerController.h" |
10 #include "core/frame/LocalFrame.h" | 10 #include "core/frame/LocalFrame.h" |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 return; | 280 return; |
281 } else { | 281 } else { |
282 if (!paint_info.GetCullRect().IntersectsVerticalRange( | 282 if (!paint_info.GetCullRect().IntersectsVerticalRange( |
283 logical_start, logical_start + logical_extent)) | 283 logical_start, logical_start + logical_extent)) |
284 return; | 284 return; |
285 } | 285 } |
286 | 286 |
287 bool is_printing = paint_info.IsPrinting(); | 287 bool is_printing = paint_info.IsPrinting(); |
288 | 288 |
289 // Determine whether or not we're selected. | 289 // Determine whether or not we're selected. |
290 bool have_selection = !is_printing && | 290 bool have_selection = |
291 paint_info.phase != kPaintPhaseTextClip && | 291 !is_printing && paint_info.phase != kPaintPhaseTextClip && |
292 inline_text_box_.GetSelectionState() != SelectionNone; | 292 inline_text_box_.GetSelectionState() != SelectionState::kNone; |
293 if (!have_selection && paint_info.phase == kPaintPhaseSelection) { | 293 if (!have_selection && paint_info.phase == kPaintPhaseSelection) { |
294 // When only painting the selection, don't bother to paint if there is none. | 294 // When only painting the selection, don't bother to paint if there is none. |
295 return; | 295 return; |
296 } | 296 } |
297 | 297 |
298 // The text clip phase already has a LayoutObjectDrawingRecorder. Text clips | 298 // The text clip phase already has a LayoutObjectDrawingRecorder. Text clips |
299 // are initiated only in BoxPainter::paintFillLayer, which is already within a | 299 // are initiated only in BoxPainter::paintFillLayer, which is already within a |
300 // LayoutObjectDrawingRecorder. | 300 // LayoutObjectDrawingRecorder. |
301 Optional<DrawingRecorder> drawing_recorder; | 301 Optional<DrawingRecorder> drawing_recorder; |
302 if (paint_info.phase != kPaintPhaseTextClip) { | 302 if (paint_info.phase != kPaintPhaseTextClip) { |
(...skipping 878 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1181 | 1181 |
1182 LayoutRect box_rect(box_origin, LayoutSize(inline_text_box_.LogicalWidth(), | 1182 LayoutRect box_rect(box_origin, LayoutSize(inline_text_box_.LogicalWidth(), |
1183 inline_text_box_.LogicalHeight())); | 1183 inline_text_box_.LogicalHeight())); |
1184 context.Clip(FloatRect(box_rect)); | 1184 context.Clip(FloatRect(box_rect)); |
1185 context.DrawHighlightForText(font, run, FloatPoint(box_origin), | 1185 context.DrawHighlightForText(font, run, FloatPoint(box_origin), |
1186 box_rect.Height().ToInt(), color, | 1186 box_rect.Height().ToInt(), color, |
1187 paint_offsets.first, paint_offsets.second); | 1187 paint_offsets.first, paint_offsets.second); |
1188 } | 1188 } |
1189 | 1189 |
1190 } // namespace blink | 1190 } // namespace blink |
OLD | NEW |