| 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/editing/markers/RenderedDocumentMarker.h" | 9 #include "core/editing/markers/RenderedDocumentMarker.h" |
| 10 #include "core/frame/LocalFrame.h" | 10 #include "core/frame/LocalFrame.h" |
| (...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 568 Vector<SVGTextFragmentWithRange> fragmentInfoList; | 568 Vector<SVGTextFragmentWithRange> fragmentInfoList; |
| 569 const Vector<SVGTextFragment>& fragments = m_svgInlineTextBox.textFragments(); | 569 const Vector<SVGTextFragment>& fragments = m_svgInlineTextBox.textFragments(); |
| 570 for (const SVGTextFragment& fragment : fragments) { | 570 for (const SVGTextFragment& fragment : fragments) { |
| 571 // TODO(ramya.v): If these can't be negative we should use unsigned. | 571 // TODO(ramya.v): If these can't be negative we should use unsigned. |
| 572 int fragmentStartPosition = startPosition; | 572 int fragmentStartPosition = startPosition; |
| 573 int fragmentEndPosition = endPosition; | 573 int fragmentEndPosition = endPosition; |
| 574 if (!m_svgInlineTextBox.mapStartEndPositionsIntoFragmentCoordinates( | 574 if (!m_svgInlineTextBox.mapStartEndPositionsIntoFragmentCoordinates( |
| 575 fragment, fragmentStartPosition, fragmentEndPosition)) | 575 fragment, fragmentStartPosition, fragmentEndPosition)) |
| 576 continue; | 576 continue; |
| 577 | 577 |
| 578 fragmentInfoList.append(SVGTextFragmentWithRange( | 578 fragmentInfoList.push_back(SVGTextFragmentWithRange( |
| 579 fragment, fragmentStartPosition, fragmentEndPosition)); | 579 fragment, fragmentStartPosition, fragmentEndPosition)); |
| 580 } | 580 } |
| 581 return fragmentInfoList; | 581 return fragmentInfoList; |
| 582 } | 582 } |
| 583 | 583 |
| 584 void SVGInlineTextBoxPainter::paintTextMatchMarkerForeground( | 584 void SVGInlineTextBoxPainter::paintTextMatchMarkerForeground( |
| 585 const PaintInfo& paintInfo, | 585 const PaintInfo& paintInfo, |
| 586 const LayoutPoint& point, | 586 const LayoutPoint& point, |
| 587 const DocumentMarker& marker, | 587 const DocumentMarker& marker, |
| 588 const ComputedStyle& style, | 588 const ComputedStyle& style, |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 645 } | 645 } |
| 646 FloatRect fragmentRect = m_svgInlineTextBox.selectionRectForTextFragment( | 646 FloatRect fragmentRect = m_svgInlineTextBox.selectionRectForTextFragment( |
| 647 fragment, textMatchInfo.startPosition, textMatchInfo.endPosition, | 647 fragment, textMatchInfo.startPosition, textMatchInfo.endPosition, |
| 648 style); | 648 style); |
| 649 paintInfo.context.setFillColor(color); | 649 paintInfo.context.setFillColor(color); |
| 650 paintInfo.context.fillRect(fragmentRect); | 650 paintInfo.context.fillRect(fragmentRect); |
| 651 } | 651 } |
| 652 } | 652 } |
| 653 | 653 |
| 654 } // namespace blink | 654 } // namespace blink |
| OLD | NEW |