| 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/BoxPainter.h" | 5 #include "core/paint/BoxPainter.h" |
| 6 | 6 |
| 7 #include "core/HTMLNames.h" | 7 #include "core/HTMLNames.h" |
| 8 #include "core/frame/Settings.h" | 8 #include "core/frame/Settings.h" |
| 9 #include "core/html/HTMLFrameOwnerElement.h" | 9 #include "core/html/HTMLFrameOwnerElement.h" |
| 10 #include "core/layout/ImageQualityController.h" | 10 #include "core/layout/ImageQualityController.h" |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 if (boxDecorationData.bleedAvoidance == BackgroundBleedClipLayer) | 121 if (boxDecorationData.bleedAvoidance == BackgroundBleedClipLayer) |
| 122 paintInfo.context.endLayer(); | 122 paintInfo.context.endLayer(); |
| 123 } | 123 } |
| 124 | 124 |
| 125 void BoxPainter::paintBackground(const PaintInfo& paintInfo, const LayoutRect& p
aintRect, const Color& backgroundColor, BackgroundBleedAvoidance bleedAvoidance) | 125 void BoxPainter::paintBackground(const PaintInfo& paintInfo, const LayoutRect& p
aintRect, const Color& backgroundColor, BackgroundBleedAvoidance bleedAvoidance) |
| 126 { | 126 { |
| 127 if (m_layoutBox.isDocumentElement()) | 127 if (m_layoutBox.isDocumentElement()) |
| 128 return; | 128 return; |
| 129 if (m_layoutBox.backgroundStolenForBeingBody()) | 129 if (m_layoutBox.backgroundStolenForBeingBody()) |
| 130 return; | 130 return; |
| 131 if (m_layoutBox.boxDecorationBackgroundIsKnownToBeObscured()) | 131 if (m_layoutBox.backgroundIsKnownToBeObscured()) |
| 132 return; | 132 return; |
| 133 paintFillLayers(paintInfo, backgroundColor, m_layoutBox.style()->backgroundL
ayers(), paintRect, bleedAvoidance); | 133 paintFillLayers(paintInfo, backgroundColor, m_layoutBox.style()->backgroundL
ayers(), paintRect, bleedAvoidance); |
| 134 } | 134 } |
| 135 | 135 |
| 136 bool BoxPainter::calculateFillLayerOcclusionCulling(FillLayerOcclusionOutputList
&reversedPaintList, const FillLayer& fillLayer) | 136 bool BoxPainter::calculateFillLayerOcclusionCulling(FillLayerOcclusionOutputList
&reversedPaintList, const FillLayer& fillLayer) |
| 137 { | 137 { |
| 138 bool isNonAssociative = false; | 138 bool isNonAssociative = false; |
| 139 for (auto currentLayer = &fillLayer; currentLayer; currentLayer = currentLay
er->next()) { | 139 for (auto currentLayer = &fillLayer; currentLayer; currentLayer = currentLay
er->next()) { |
| 140 reversedPaintList.append(currentLayer); | 140 reversedPaintList.append(currentLayer); |
| 141 // Stop traversal when an opaque layer is encountered. | 141 // Stop traversal when an opaque layer is encountered. |
| (...skipping 678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 820 } | 820 } |
| 821 } | 821 } |
| 822 | 822 |
| 823 bool BoxPainter::shouldForceWhiteBackgroundForPrintEconomy(const ComputedStyle&
style, const Document& document) | 823 bool BoxPainter::shouldForceWhiteBackgroundForPrintEconomy(const ComputedStyle&
style, const Document& document) |
| 824 { | 824 { |
| 825 return document.printing() && style.getPrintColorAdjust() == PrintColorAdjus
tEconomy | 825 return document.printing() && style.getPrintColorAdjust() == PrintColorAdjus
tEconomy |
| 826 && (!document.settings() || !document.settings()->shouldPrintBackgrounds
()); | 826 && (!document.settings() || !document.settings()->shouldPrintBackgrounds
()); |
| 827 } | 827 } |
| 828 | 828 |
| 829 } // namespace blink | 829 } // namespace blink |
| OLD | NEW |