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/SVGInlineTextBoxPainter.h" | 5 #include "core/paint/SVGInlineTextBoxPainter.h" |
6 | 6 |
7 #include "core/editing/Editor.h" | 7 #include "core/editing/Editor.h" |
8 #include "core/editing/markers/DocumentMarkerController.h" | 8 #include "core/editing/markers/DocumentMarkerController.h" |
9 #include "core/frame/LocalFrame.h" | 9 #include "core/frame/LocalFrame.h" |
10 #include "core/layout/LayoutTheme.h" | 10 #include "core/layout/LayoutTheme.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 | 38 |
39 bool SVGInlineTextBoxPainter::ShouldPaintSelection( | 39 bool SVGInlineTextBoxPainter::ShouldPaintSelection( |
40 const PaintInfo& paint_info) const { | 40 const PaintInfo& paint_info) const { |
41 // Don't paint selections when printing. | 41 // Don't paint selections when printing. |
42 if (paint_info.IsPrinting()) | 42 if (paint_info.IsPrinting()) |
43 return false; | 43 return false; |
44 // Don't paint selections when rendering a mask, clip-path (as a mask), | 44 // Don't paint selections when rendering a mask, clip-path (as a mask), |
45 // pattern or feImage (element reference.) | 45 // pattern or feImage (element reference.) |
46 if (paint_info.IsRenderingResourceSubtree()) | 46 if (paint_info.IsRenderingResourceSubtree()) |
47 return false; | 47 return false; |
48 return svg_inline_text_box_.GetSelectionState() != SelectionNone; | 48 return svg_inline_text_box_.GetSelectionState() != SelectionState::kNone; |
49 } | 49 } |
50 | 50 |
51 static bool HasShadow(const PaintInfo& paint_info, const ComputedStyle& style) { | 51 static bool HasShadow(const PaintInfo& paint_info, const ComputedStyle& style) { |
52 // Text shadows are disabled when printing. http://crbug.com/258321 | 52 // Text shadows are disabled when printing. http://crbug.com/258321 |
53 return style.TextShadow() && !paint_info.IsPrinting(); | 53 return style.TextShadow() && !paint_info.IsPrinting(); |
54 } | 54 } |
55 | 55 |
56 FloatRect SVGInlineTextBoxPainter::BoundsForDrawingRecorder( | 56 FloatRect SVGInlineTextBoxPainter::BoundsForDrawingRecorder( |
57 const PaintInfo& paint_info, | 57 const PaintInfo& paint_info, |
58 const ComputedStyle& style, | 58 const ComputedStyle& style, |
(...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
654 } | 654 } |
655 FloatRect fragment_rect = svg_inline_text_box_.SelectionRectForTextFragment( | 655 FloatRect fragment_rect = svg_inline_text_box_.SelectionRectForTextFragment( |
656 fragment, text_match_info.start_position, text_match_info.end_position, | 656 fragment, text_match_info.start_position, text_match_info.end_position, |
657 style); | 657 style); |
658 paint_info.context.SetFillColor(color); | 658 paint_info.context.SetFillColor(color); |
659 paint_info.context.FillRect(fragment_rect); | 659 paint_info.context.FillRect(fragment_rect); |
660 } | 660 } |
661 } | 661 } |
662 | 662 |
663 } // namespace blink | 663 } // namespace blink |
OLD | NEW |