| 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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 return; | 129 return; |
| 130 if (m_layoutBox.backgroundStolenForBeingBody()) | 130 if (m_layoutBox.backgroundStolenForBeingBody()) |
| 131 return; | 131 return; |
| 132 if (m_layoutBox.boxDecorationBackgroundIsKnownToBeObscured()) | 132 if (m_layoutBox.boxDecorationBackgroundIsKnownToBeObscured()) |
| 133 return; | 133 return; |
| 134 paintFillLayers(paintInfo, backgroundColor, m_layoutBox.style()->backgroundL
ayers(), paintRect, bleedAvoidance); | 134 paintFillLayers(paintInfo, backgroundColor, m_layoutBox.style()->backgroundL
ayers(), paintRect, bleedAvoidance); |
| 135 } | 135 } |
| 136 | 136 |
| 137 bool BoxPainter::isFillLayerOpaque(const FillLayer& layer, const LayoutObject& i
mageClient) | 137 bool BoxPainter::isFillLayerOpaque(const FillLayer& layer, const LayoutObject& i
mageClient) |
| 138 { | 138 { |
| 139 // The default object size passed down to imageSize is empty with the implic
ation that images |
| 140 // with no intrinsic size are treated as empty. |
| 139 return layer.hasOpaqueImage(&imageClient) | 141 return layer.hasOpaqueImage(&imageClient) |
| 140 && layer.image()->canRender() | 142 && layer.image()->canRender() |
| 141 && !layer.image()->imageSize(&imageClient, imageClient.style()->effectiv
eZoom()).isEmpty() | 143 && !layer.image()->imageSize(&imageClient, imageClient.style()->effectiv
eZoom(), LayoutSize()).isEmpty() |
| 142 && layer.hasRepeatXY(); | 144 && layer.hasRepeatXY(); |
| 143 } | 145 } |
| 144 | 146 |
| 145 bool BoxPainter::calculateFillLayerOcclusionCulling(FillLayerOcclusionOutputList
&reversedPaintList, const FillLayer& fillLayer) | 147 bool BoxPainter::calculateFillLayerOcclusionCulling(FillLayerOcclusionOutputList
&reversedPaintList, const FillLayer& fillLayer) |
| 146 { | 148 { |
| 147 bool isNonAssociative = false; | 149 bool isNonAssociative = false; |
| 148 for (auto currentLayer = &fillLayer; currentLayer; currentLayer = currentLay
er->next()) { | 150 for (auto currentLayer = &fillLayer; currentLayer; currentLayer = currentLay
er->next()) { |
| 149 reversedPaintList.append(currentLayer); | 151 reversedPaintList.append(currentLayer); |
| 150 // Stop traversal when an opaque layer is encountered. | 152 // Stop traversal when an opaque layer is encountered. |
| 151 // FIXME : It would be possible for the following occlusion culling test
to be more aggressive | 153 // FIXME : It would be possible for the following occlusion culling test
to be more aggressive |
| (...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 690 } | 692 } |
| 691 } | 693 } |
| 692 | 694 |
| 693 bool BoxPainter::shouldForceWhiteBackgroundForPrintEconomy(const ComputedStyle&
style, const Document& document) | 695 bool BoxPainter::shouldForceWhiteBackgroundForPrintEconomy(const ComputedStyle&
style, const Document& document) |
| 694 { | 696 { |
| 695 return document.printing() && style.printColorAdjust() == PrintColorAdjustEc
onomy | 697 return document.printing() && style.printColorAdjust() == PrintColorAdjustEc
onomy |
| 696 && (!document.settings() || !document.settings()->shouldPrintBackgrounds
()); | 698 && (!document.settings() || !document.settings()->shouldPrintBackgrounds
()); |
| 697 } | 699 } |
| 698 | 700 |
| 699 } // namespace blink | 701 } // namespace blink |
| OLD | NEW |