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 581 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
592 const LayoutPoint& point, | 592 const LayoutPoint& point, |
593 const DocumentMarker& marker, | 593 const DocumentMarker& marker, |
594 const ComputedStyle& style, | 594 const ComputedStyle& style, |
595 const Font& font) { | 595 const Font& font) { |
596 const Vector<SVGTextFragmentWithRange> textMatchInfoList = | 596 const Vector<SVGTextFragmentWithRange> textMatchInfoList = |
597 collectTextMatches(marker); | 597 collectTextMatches(marker); |
598 if (textMatchInfoList.isEmpty()) | 598 if (textMatchInfoList.isEmpty()) |
599 return; | 599 return; |
600 | 600 |
601 Color textColor = | 601 Color textColor = |
602 LayoutTheme::theme().platformTextSearchColor(marker.activeMatch()); | 602 LayoutTheme::theme().platformTextSearchColor(marker.IsActiveMatch()); |
603 | 603 |
604 PaintFlags fillFlags; | 604 PaintFlags fillFlags; |
605 fillFlags.setColor(textColor.rgb()); | 605 fillFlags.setColor(textColor.rgb()); |
606 fillFlags.setAntiAlias(true); | 606 fillFlags.setAntiAlias(true); |
607 | 607 |
608 PaintFlags strokeFlags; | 608 PaintFlags strokeFlags; |
609 bool shouldPaintStroke = false; | 609 bool shouldPaintStroke = false; |
610 if (setupTextPaint(paintInfo, style, ApplyToStrokeMode, strokeFlags)) { | 610 if (setupTextPaint(paintInfo, style, ApplyToStrokeMode, strokeFlags)) { |
611 shouldPaintStroke = true; | 611 shouldPaintStroke = true; |
612 strokeFlags.setLooper(nullptr); | 612 strokeFlags.setLooper(nullptr); |
(...skipping 21 matching lines...) Expand all Loading... |
634 const LayoutPoint& point, | 634 const LayoutPoint& point, |
635 const DocumentMarker& marker, | 635 const DocumentMarker& marker, |
636 const ComputedStyle& style, | 636 const ComputedStyle& style, |
637 const Font& font) { | 637 const Font& font) { |
638 const Vector<SVGTextFragmentWithRange> textMatchInfoList = | 638 const Vector<SVGTextFragmentWithRange> textMatchInfoList = |
639 collectTextMatches(marker); | 639 collectTextMatches(marker); |
640 if (textMatchInfoList.isEmpty()) | 640 if (textMatchInfoList.isEmpty()) |
641 return; | 641 return; |
642 | 642 |
643 Color color = LayoutTheme::theme().platformTextSearchHighlightColor( | 643 Color color = LayoutTheme::theme().platformTextSearchHighlightColor( |
644 marker.activeMatch()); | 644 marker.IsActiveMatch()); |
645 for (const SVGTextFragmentWithRange& textMatchInfo : textMatchInfoList) { | 645 for (const SVGTextFragmentWithRange& textMatchInfo : textMatchInfoList) { |
646 const SVGTextFragment& fragment = textMatchInfo.fragment; | 646 const SVGTextFragment& fragment = textMatchInfo.fragment; |
647 | 647 |
648 GraphicsContextStateSaver stateSaver(paintInfo.context, false); | 648 GraphicsContextStateSaver stateSaver(paintInfo.context, false); |
649 if (fragment.isTransformed()) { | 649 if (fragment.isTransformed()) { |
650 stateSaver.save(); | 650 stateSaver.save(); |
651 paintInfo.context.concatCTM(fragment.buildFragmentTransform()); | 651 paintInfo.context.concatCTM(fragment.buildFragmentTransform()); |
652 } | 652 } |
653 FloatRect fragmentRect = m_svgInlineTextBox.selectionRectForTextFragment( | 653 FloatRect fragmentRect = m_svgInlineTextBox.selectionRectForTextFragment( |
654 fragment, textMatchInfo.startPosition, textMatchInfo.endPosition, | 654 fragment, textMatchInfo.startPosition, textMatchInfo.endPosition, |
655 style); | 655 style); |
656 paintInfo.context.setFillColor(color); | 656 paintInfo.context.setFillColor(color); |
657 paintInfo.context.fillRect(fragmentRect); | 657 paintInfo.context.fillRect(fragmentRect); |
658 } | 658 } |
659 } | 659 } |
660 | 660 |
661 } // namespace blink | 661 } // namespace blink |
OLD | NEW |