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 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
439 paintInfo.context, m_inlineTextBox, | 439 paintInfo.context, m_inlineTextBox, |
440 DisplayItem::paintPhaseToDrawingType(paintInfo.phase), | 440 DisplayItem::paintPhaseToDrawingType(paintInfo.phase), |
441 FloatRect(paintRect)); | 441 FloatRect(paintRect)); |
442 } | 442 } |
443 | 443 |
444 GraphicsContext& context = paintInfo.context; | 444 GraphicsContext& context = paintInfo.context; |
445 const ComputedStyle& styleToUse = | 445 const ComputedStyle& styleToUse = |
446 m_inlineTextBox.getLineLayoutItem().styleRef( | 446 m_inlineTextBox.getLineLayoutItem().styleRef( |
447 m_inlineTextBox.isFirstLineStyle()); | 447 m_inlineTextBox.isFirstLineStyle()); |
448 | 448 |
449 LayoutPoint boxOrigin(m_inlineTextBox.locationIncludingFlipping()); | 449 LayoutPoint boxOrigin(m_inlineTextBox.physicalLocation()); |
450 boxOrigin.move(adjustedPaintOffset.x(), adjustedPaintOffset.y()); | 450 boxOrigin.move(adjustedPaintOffset.x(), adjustedPaintOffset.y()); |
451 LayoutRect boxRect(boxOrigin, LayoutSize(m_inlineTextBox.logicalWidth(), | 451 LayoutRect boxRect(boxOrigin, LayoutSize(m_inlineTextBox.logicalWidth(), |
452 m_inlineTextBox.logicalHeight())); | 452 m_inlineTextBox.logicalHeight())); |
453 | 453 |
454 int length = m_inlineTextBox.len(); | 454 int length = m_inlineTextBox.len(); |
455 StringView string = StringView(m_inlineTextBox.getLineLayoutItem().text(), | 455 StringView string = StringView(m_inlineTextBox.getLineLayoutItem().text(), |
456 m_inlineTextBox.start(), length); | 456 m_inlineTextBox.start(), length); |
457 int maximumLength = m_inlineTextBox.getLineLayoutItem().textLength() - | 457 int maximumLength = m_inlineTextBox.getLineLayoutItem().textLength() - |
458 m_inlineTextBox.start(); | 458 m_inlineTextBox.start(); |
459 | 459 |
(...skipping 807 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1267 GraphicsContextStateSaver stateSaver(context); | 1267 GraphicsContextStateSaver stateSaver(context); |
1268 | 1268 |
1269 LayoutRect boxRect(boxOrigin, LayoutSize(m_inlineTextBox.logicalWidth(), | 1269 LayoutRect boxRect(boxOrigin, LayoutSize(m_inlineTextBox.logicalWidth(), |
1270 m_inlineTextBox.logicalHeight())); | 1270 m_inlineTextBox.logicalHeight())); |
1271 context.clip(FloatRect(boxRect)); | 1271 context.clip(FloatRect(boxRect)); |
1272 context.drawHighlightForText(font, run, FloatPoint(boxOrigin), | 1272 context.drawHighlightForText(font, run, FloatPoint(boxOrigin), |
1273 boxRect.height().toInt(), color, sPos, ePos); | 1273 boxRect.height().toInt(), color, sPos, ePos); |
1274 } | 1274 } |
1275 | 1275 |
1276 } // namespace blink | 1276 } // namespace blink |
OLD | NEW |