| 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/TextPainter.h" | 5 #include "core/paint/TextPainter.h" |
| 6 | 6 |
| 7 #include "core/CSSPropertyNames.h" | 7 #include "core/CSSPropertyNames.h" |
| 8 #include "core/frame/Settings.h" | 8 #include "core/frame/Settings.h" |
| 9 #include "core/layout/LayoutObject.h" | 9 #include "core/layout/LayoutObject.h" |
| 10 #include "core/layout/LayoutTextCombine.h" | 10 #include "core/layout/LayoutTextCombine.h" |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 textStyle.fillColor = | 148 textStyle.fillColor = |
| 149 lineLayoutItem.resolveColor(style, CSSPropertyWebkitTextFillColor); | 149 lineLayoutItem.resolveColor(style, CSSPropertyWebkitTextFillColor); |
| 150 textStyle.strokeColor = | 150 textStyle.strokeColor = |
| 151 lineLayoutItem.resolveColor(style, CSSPropertyWebkitTextStrokeColor); | 151 lineLayoutItem.resolveColor(style, CSSPropertyWebkitTextStrokeColor); |
| 152 textStyle.emphasisMarkColor = | 152 textStyle.emphasisMarkColor = |
| 153 lineLayoutItem.resolveColor(style, CSSPropertyWebkitTextEmphasisColor); | 153 lineLayoutItem.resolveColor(style, CSSPropertyWebkitTextEmphasisColor); |
| 154 textStyle.strokeWidth = style.textStrokeWidth(); | 154 textStyle.strokeWidth = style.textStrokeWidth(); |
| 155 textStyle.shadow = style.textShadow(); | 155 textStyle.shadow = style.textShadow(); |
| 156 | 156 |
| 157 // Adjust text color when printing with a white background. | 157 // Adjust text color when printing with a white background. |
| 158 DCHECK(lineLayoutItem.document().printing() == isPrinting); | 158 DCHECK(lineLayoutItem.document().printing() == isPrinting || |
| 159 RuntimeEnabledFeatures::printBrowserEnabled()); |
| 159 bool forceBackgroundToWhite = | 160 bool forceBackgroundToWhite = |
| 160 BoxPainter::shouldForceWhiteBackgroundForPrintEconomy( | 161 BoxPainter::shouldForceWhiteBackgroundForPrintEconomy( |
| 161 style, lineLayoutItem.document()); | 162 style, lineLayoutItem.document()); |
| 162 if (forceBackgroundToWhite) { | 163 if (forceBackgroundToWhite) { |
| 163 textStyle.fillColor = textColorForWhiteBackground(textStyle.fillColor); | 164 textStyle.fillColor = textColorForWhiteBackground(textStyle.fillColor); |
| 164 textStyle.strokeColor = | 165 textStyle.strokeColor = |
| 165 textColorForWhiteBackground(textStyle.strokeColor); | 166 textColorForWhiteBackground(textStyle.strokeColor); |
| 166 textStyle.emphasisMarkColor = | 167 textStyle.emphasisMarkColor = |
| 167 textColorForWhiteBackground(textStyle.emphasisMarkColor); | 168 textColorForWhiteBackground(textStyle.emphasisMarkColor); |
| 168 } | 169 } |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 TextRunPaintInfo textRunPaintInfo(placeholderTextRun); | 298 TextRunPaintInfo textRunPaintInfo(placeholderTextRun); |
| 298 textRunPaintInfo.bounds = FloatRect(m_textBounds); | 299 textRunPaintInfo.bounds = FloatRect(m_textBounds); |
| 299 m_graphicsContext.concatCTM(rotation(m_textBounds, Clockwise)); | 300 m_graphicsContext.concatCTM(rotation(m_textBounds, Clockwise)); |
| 300 m_graphicsContext.drawEmphasisMarks(m_combinedText->originalFont(), | 301 m_graphicsContext.drawEmphasisMarks(m_combinedText->originalFont(), |
| 301 textRunPaintInfo, m_emphasisMark, | 302 textRunPaintInfo, m_emphasisMark, |
| 302 emphasisMarkTextOrigin); | 303 emphasisMarkTextOrigin); |
| 303 m_graphicsContext.concatCTM(rotation(m_textBounds, Counterclockwise)); | 304 m_graphicsContext.concatCTM(rotation(m_textBounds, Counterclockwise)); |
| 304 } | 305 } |
| 305 | 306 |
| 306 } // namespace blink | 307 } // namespace blink |
| OLD | NEW |