| 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 1116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1127 textDecorationThickness); | 1127 textDecorationThickness); |
| 1128 } | 1128 } |
| 1129 decorationPainter.paint(); | 1129 decorationPainter.paint(); |
| 1130 } | 1130 } |
| 1131 if (lines & TextDecorationLineThrough) { | 1131 if (lines & TextDecorationLineThrough) { |
| 1132 const float lineThroughOffset = 2 * baseline / 3; | 1132 const float lineThroughOffset = 2 * baseline / 3; |
| 1133 AppliedDecorationPainter decorationPainter( | 1133 AppliedDecorationPainter decorationPainter( |
| 1134 context, FloatPoint(localOrigin) + FloatPoint(0, lineThroughOffset), | 1134 context, FloatPoint(localOrigin) + FloatPoint(0, lineThroughOffset), |
| 1135 width.toFloat(), decoration, textDecorationThickness, doubleOffset, 0, | 1135 width.toFloat(), decoration, textDecorationThickness, doubleOffset, 0, |
| 1136 antialiasDecoration); | 1136 antialiasDecoration); |
| 1137 if (skipIntercepts) { | 1137 // No skip: ink for line-through, |
| 1138 textPainter.clipDecorationsStripe( | 1138 // compare https://github.com/w3c/csswg-drafts/issues/711 |
| 1139 -baseline + decorationPainter.decorationBounds().y() - | |
| 1140 FloatPoint(localOrigin).y(), | |
| 1141 decorationPainter.decorationBounds().height(), | |
| 1142 textDecorationThickness); | |
| 1143 } | |
| 1144 decorationPainter.paint(); | 1139 decorationPainter.paint(); |
| 1145 } | 1140 } |
| 1146 } | 1141 } |
| 1147 } | 1142 } |
| 1148 | 1143 |
| 1149 void InlineTextBoxPainter::paintCompositionUnderline( | 1144 void InlineTextBoxPainter::paintCompositionUnderline( |
| 1150 GraphicsContext& context, | 1145 GraphicsContext& context, |
| 1151 const LayoutPoint& boxOrigin, | 1146 const LayoutPoint& boxOrigin, |
| 1152 const CompositionUnderline& underline) { | 1147 const CompositionUnderline& underline) { |
| 1153 if (underline.color() == Color::transparent) | 1148 if (underline.color() == Color::transparent) |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1289 | 1284 |
| 1290 LayoutRect boxRect(boxOrigin, LayoutSize(m_inlineTextBox.logicalWidth(), | 1285 LayoutRect boxRect(boxOrigin, LayoutSize(m_inlineTextBox.logicalWidth(), |
| 1291 m_inlineTextBox.logicalHeight())); | 1286 m_inlineTextBox.logicalHeight())); |
| 1292 context.clip(FloatRect(boxRect)); | 1287 context.clip(FloatRect(boxRect)); |
| 1293 context.drawHighlightForText(font, run, FloatPoint(boxOrigin), | 1288 context.drawHighlightForText(font, run, FloatPoint(boxOrigin), |
| 1294 boxRect.height().toInt(), color, | 1289 boxRect.height().toInt(), color, |
| 1295 paintOffsets.first, paintOffsets.second); | 1290 paintOffsets.first, paintOffsets.second); |
| 1296 } | 1291 } |
| 1297 | 1292 |
| 1298 } // namespace blink | 1293 } // namespace blink |
| OLD | NEW |