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

Unified Diff: Source/core/paint/TextPainter.cpp

Issue 1196223008: ViewPainter should skip background in print economy mode (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fix unittests Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/paint/TextPainter.cpp
diff --git a/Source/core/paint/TextPainter.cpp b/Source/core/paint/TextPainter.cpp
index b26a2d3521f5861e951bb42744bb44e1adb93447..8cbae9a514ff9b2f8887f421e40a0300949c7faf 100644
--- a/Source/core/paint/TextPainter.cpp
+++ b/Source/core/paint/TextPainter.cpp
@@ -10,6 +10,7 @@
#include "core/layout/LayoutObject.h"
#include "core/layout/LayoutTextCombine.h"
#include "core/layout/line/InlineTextBox.h"
+#include "core/paint/BoxPainter.h"
#include "core/style/ComputedStyle.h"
#include "core/style/ShadowList.h"
#include "platform/fonts/Font.h"
@@ -135,13 +136,8 @@ TextPainter::Style TextPainter::textPaintingStyle(LayoutObject& layoutObject, co
textStyle.shadow = style.textShadow();
// Adjust text color when printing with a white background.
- bool forceBackgroundToWhite = false;
- if (isPrinting) {
- if (style.printColorAdjust() == PrintColorAdjustEconomy)
- forceBackgroundToWhite = true;
- if (layoutObject.document().settings() && layoutObject.document().settings()->shouldPrintBackgrounds())
- forceBackgroundToWhite = false;
- }
+ ASSERT(layoutObject.document().printing() == isPrinting);
+ bool forceBackgroundToWhite = BoxPainter::shouldForceWhiteBackgroundForPrintEconomy(style, layoutObject.document());
if (forceBackgroundToWhite) {
textStyle.fillColor = textColorForWhiteBackground(textStyle.fillColor);
textStyle.strokeColor = textColorForWhiteBackground(textStyle.strokeColor);

Powered by Google App Engine
This is Rietveld 408576698