Chromium Code Reviews| Index: Source/core/paint/ViewPainter.cpp |
| diff --git a/Source/core/paint/ViewPainter.cpp b/Source/core/paint/ViewPainter.cpp |
| index fd892d571a52e8ebc3a2a99f43c804adeaff4f20..b67f1471e100fe1feccf04f78c842c64c91a3720 100644 |
| --- a/Source/core/paint/ViewPainter.cpp |
| +++ b/Source/core/paint/ViewPainter.cpp |
| @@ -56,12 +56,22 @@ void ViewPainter::paintBoxDecorationBackground(const PaintInfo& paintInfo) |
| bool paintsBaseBackground = isMainFrame && !frameView.isTransparent(); |
| bool shouldClearCanvas = paintsBaseBackground && (document.settings() && document.settings()->shouldClearDocumentBackground()); |
| Color baseBackgroundColor = paintsBaseBackground ? frameView.baseBackgroundColor() : Color(); |
| + Color rootBackgroundColor = m_layoutView.style()->visitedDependentColor(CSSPropertyBackgroundColor); |
| const LayoutObject* rootObject = document.documentElement() ? document.documentElement()->layoutObject() : nullptr; |
| LayoutObjectDrawingRecorder recorder(context, m_layoutView, DisplayItem::BoxDecorationBackground, documentRect); |
| if (recorder.canUseCachedDrawing()) |
| return; |
| + // Special handling for print economy mode. |
| + if (document.printing() && m_layoutView.style()->printColorAdjust() == PrintColorAdjustEconomy |
|
chrishtr
2015/06/23 17:42:57
Where did this logic used to be before your refact
trchen
2015/06/23 20:40:15
https://code.google.com/p/chromium/codesearch#chro
|
| + && (!document.settings() || !document.settings()->shouldPrintBackgrounds())) { |
| + // If for any reason the view background is not transparent, paint white instead, otherwise keep transparent as is. |
| + if (paintsBaseBackground || rootBackgroundColor.alpha() || m_layoutView.style()->backgroundLayers().image()) |
| + context.fillRect(documentRect, Color::white, SkXfermode::kSrc_Mode); |
| + return; |
| + } |
| + |
| // Compute the enclosing rect of the view, in root element space. |
| // |
| // For background colors we can simply paint the document rect in the default space. |
| @@ -100,7 +110,6 @@ void ViewPainter::paintBoxDecorationBackground(const PaintInfo& paintInfo) |
| BoxPainter::FillLayerOcclusionOutputList reversedPaintList; |
| bool shouldDrawBackgroundInSeparateBuffer = BoxPainter(m_layoutView).calculateFillLayerOcclusionCulling(reversedPaintList, m_layoutView.style()->backgroundLayers()); |
| ASSERT(reversedPaintList.size()); |
| - Color rootBackgroundColor = m_layoutView.style()->visitedDependentColor(CSSPropertyBackgroundColor); |
| // If the root background color is opaque, isolation group can be skipped because the canvas |
| // will be cleared by root background color. |