Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Side by Side Diff: third_party/WebKit/Source/core/paint/TextPainter.cpp

Issue 2802903002: Move PrintBrowser from SPV2 to SPV1 (Closed)
Patch Set: Clear the PrintContext when disposing of the FrameView Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 text_style.fill_color = 150 text_style.fill_color =
151 line_layout_item.ResolveColor(style, CSSPropertyWebkitTextFillColor); 151 line_layout_item.ResolveColor(style, CSSPropertyWebkitTextFillColor);
152 text_style.stroke_color = 152 text_style.stroke_color =
153 line_layout_item.ResolveColor(style, CSSPropertyWebkitTextStrokeColor); 153 line_layout_item.ResolveColor(style, CSSPropertyWebkitTextStrokeColor);
154 text_style.emphasis_mark_color = line_layout_item.ResolveColor( 154 text_style.emphasis_mark_color = line_layout_item.ResolveColor(
155 style, CSSPropertyWebkitTextEmphasisColor); 155 style, CSSPropertyWebkitTextEmphasisColor);
156 text_style.stroke_width = style.TextStrokeWidth(); 156 text_style.stroke_width = style.TextStrokeWidth();
157 text_style.shadow = style.TextShadow(); 157 text_style.shadow = style.TextShadow();
158 158
159 // Adjust text color when printing with a white background. 159 // Adjust text color when printing with a white background.
160 DCHECK(line_layout_item.GetDocument().Printing() == is_printing); 160 DCHECK(line_layout_item.GetDocument().Printing() == is_printing ||
161 RuntimeEnabledFeatures::printBrowserEnabled());
161 bool force_background_to_white = 162 bool force_background_to_white =
162 BoxPainter::ShouldForceWhiteBackgroundForPrintEconomy( 163 BoxPainter::ShouldForceWhiteBackgroundForPrintEconomy(
163 style, line_layout_item.GetDocument()); 164 style, line_layout_item.GetDocument());
164 if (force_background_to_white) { 165 if (force_background_to_white) {
165 text_style.fill_color = 166 text_style.fill_color =
166 TextColorForWhiteBackground(text_style.fill_color); 167 TextColorForWhiteBackground(text_style.fill_color);
167 text_style.stroke_color = 168 text_style.stroke_color =
168 TextColorForWhiteBackground(text_style.stroke_color); 169 TextColorForWhiteBackground(text_style.stroke_color);
169 text_style.emphasis_mark_color = 170 text_style.emphasis_mark_color =
170 TextColorForWhiteBackground(text_style.emphasis_mark_color); 171 TextColorForWhiteBackground(text_style.emphasis_mark_color);
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 TextRunPaintInfo text_run_paint_info(placeholder_text_run); 304 TextRunPaintInfo text_run_paint_info(placeholder_text_run);
304 text_run_paint_info.bounds = FloatRect(text_bounds_); 305 text_run_paint_info.bounds = FloatRect(text_bounds_);
305 graphics_context_.ConcatCTM(Rotation(text_bounds_, kClockwise)); 306 graphics_context_.ConcatCTM(Rotation(text_bounds_, kClockwise));
306 graphics_context_.DrawEmphasisMarks(combined_text_->OriginalFont(), 307 graphics_context_.DrawEmphasisMarks(combined_text_->OriginalFont(),
307 text_run_paint_info, emphasis_mark_, 308 text_run_paint_info, emphasis_mark_,
308 emphasis_mark_text_origin); 309 emphasis_mark_text_origin);
309 graphics_context_.ConcatCTM(Rotation(text_bounds_, kCounterclockwise)); 310 graphics_context_.ConcatCTM(Rotation(text_bounds_, kCounterclockwise));
310 } 311 }
311 312
312 } // namespace blink 313 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/FrameView.cpp ('k') | third_party/WebKit/Source/platform/RuntimeEnabledFeatures.json5 » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698