| 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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 const LayoutPoint& adjusted_paint_offset) { | 93 const LayoutPoint& adjusted_paint_offset) { |
| 94 LayoutRect bounds = | 94 LayoutRect bounds = |
| 95 IsPaintingBackgroundOfPaintContainerIntoScrollingContentsLayer( | 95 IsPaintingBackgroundOfPaintContainerIntoScrollingContentsLayer( |
| 96 &layout_box_, paint_info) | 96 &layout_box_, paint_info) |
| 97 ? layout_box_.LayoutOverflowRect() | 97 ? layout_box_.LayoutOverflowRect() |
| 98 : layout_box_.SelfVisualOverflowRect(); | 98 : layout_box_.SelfVisualOverflowRect(); |
| 99 bounds.MoveBy(adjusted_paint_offset); | 99 bounds.MoveBy(adjusted_paint_offset); |
| 100 return bounds; | 100 return bounds; |
| 101 } | 101 } |
| 102 | 102 |
| 103 namespace { | |
| 104 | |
| 105 bool BleedAvoidanceIsClipping(BackgroundBleedAvoidance bleed_avoidance) { | |
| 106 return bleed_avoidance == kBackgroundBleedClipOnly || | |
| 107 bleed_avoidance == kBackgroundBleedClipLayer; | |
| 108 } | |
| 109 | |
| 110 } // anonymous namespace | |
| 111 | |
| 112 void BoxPainter::PaintBoxDecorationBackgroundWithRect( | 103 void BoxPainter::PaintBoxDecorationBackgroundWithRect( |
| 113 const PaintInfo& paint_info, | 104 const PaintInfo& paint_info, |
| 114 const LayoutPoint& paint_offset, | 105 const LayoutPoint& paint_offset, |
| 115 const LayoutRect& paint_rect) { | 106 const LayoutRect& paint_rect) { |
| 116 bool painting_overflow_contents = | 107 bool painting_overflow_contents = |
| 117 IsPaintingBackgroundOfPaintContainerIntoScrollingContentsLayer( | 108 IsPaintingBackgroundOfPaintContainerIntoScrollingContentsLayer( |
| 118 &layout_box_, paint_info); | 109 &layout_box_, paint_info); |
| 119 const ComputedStyle& style = layout_box_.StyleRef(); | 110 const ComputedStyle& style = layout_box_.StyleRef(); |
| 120 | 111 |
| 121 Optional<DisplayItemCacheSkipper> cache_skipper; | 112 Optional<DisplayItemCacheSkipper> cache_skipper; |
| (...skipping 944 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1066 bool BoxPainter::ShouldForceWhiteBackgroundForPrintEconomy( | 1057 bool BoxPainter::ShouldForceWhiteBackgroundForPrintEconomy( |
| 1067 const ComputedStyle& style, | 1058 const ComputedStyle& style, |
| 1068 const Document& document) { | 1059 const Document& document) { |
| 1069 return document.Printing() && | 1060 return document.Printing() && |
| 1070 style.PrintColorAdjust() == EPrintColorAdjust::kEconomy && | 1061 style.PrintColorAdjust() == EPrintColorAdjust::kEconomy && |
| 1071 (!document.GetSettings() || | 1062 (!document.GetSettings() || |
| 1072 !document.GetSettings()->GetShouldPrintBackgrounds()); | 1063 !document.GetSettings()->GetShouldPrintBackgrounds()); |
| 1073 } | 1064 } |
| 1074 | 1065 |
| 1075 } // namespace blink | 1066 } // namespace blink |
| OLD | NEW |