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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 } | 127 } |
128 | 128 |
129 // static | 129 // static |
130 TextPainter::Style TextPainter::textPaintingStyle(LineLayoutItem lineLayoutItem, | 130 TextPainter::Style TextPainter::textPaintingStyle(LineLayoutItem lineLayoutItem, |
131 const ComputedStyle& style, | 131 const ComputedStyle& style, |
132 const PaintInfo& paintInfo) { | 132 const PaintInfo& paintInfo) { |
133 TextPainter::Style textStyle; | 133 TextPainter::Style textStyle; |
134 bool isPrinting = paintInfo.isPrinting(); | 134 bool isPrinting = paintInfo.isPrinting(); |
135 | 135 |
136 if (paintInfo.phase == PaintPhaseTextClip) { | 136 if (paintInfo.phase == PaintPhaseTextClip) { |
137 // When we use the text as a clip, we only care about the alpha, thus we mak
e all the colors black. | 137 // When we use the text as a clip, we only care about the alpha, thus we |
| 138 // make all the colors black. |
138 textStyle.currentColor = Color::black; | 139 textStyle.currentColor = Color::black; |
139 textStyle.fillColor = Color::black; | 140 textStyle.fillColor = Color::black; |
140 textStyle.strokeColor = Color::black; | 141 textStyle.strokeColor = Color::black; |
141 textStyle.emphasisMarkColor = Color::black; | 142 textStyle.emphasisMarkColor = Color::black; |
142 textStyle.strokeWidth = style.textStrokeWidth(); | 143 textStyle.strokeWidth = style.textStrokeWidth(); |
143 textStyle.shadow = 0; | 144 textStyle.shadow = 0; |
144 } else { | 145 } else { |
145 textStyle.currentColor = style.visitedDependentColor(CSSPropertyColor); | 146 textStyle.currentColor = style.visitedDependentColor(CSSPropertyColor); |
146 textStyle.fillColor = | 147 textStyle.fillColor = |
147 lineLayoutItem.resolveColor(style, CSSPropertyWebkitTextFillColor); | 148 lineLayoutItem.resolveColor(style, CSSPropertyWebkitTextFillColor); |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 TextRunPaintInfo textRunPaintInfo(placeholderTextRun); | 262 TextRunPaintInfo textRunPaintInfo(placeholderTextRun); |
262 textRunPaintInfo.bounds = FloatRect(m_textBounds); | 263 textRunPaintInfo.bounds = FloatRect(m_textBounds); |
263 m_graphicsContext.concatCTM(rotation(m_textBounds, Clockwise)); | 264 m_graphicsContext.concatCTM(rotation(m_textBounds, Clockwise)); |
264 m_graphicsContext.drawEmphasisMarks(m_combinedText->originalFont(), | 265 m_graphicsContext.drawEmphasisMarks(m_combinedText->originalFont(), |
265 textRunPaintInfo, m_emphasisMark, | 266 textRunPaintInfo, m_emphasisMark, |
266 emphasisMarkTextOrigin); | 267 emphasisMarkTextOrigin); |
267 m_graphicsContext.concatCTM(rotation(m_textBounds, Counterclockwise)); | 268 m_graphicsContext.concatCTM(rotation(m_textBounds, Counterclockwise)); |
268 } | 269 } |
269 | 270 |
270 } // namespace blink | 271 } // namespace blink |
OLD | NEW |