| 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 void BoxPainter::paintBoxDecorationBackground(const PaintInfo& paintInfo, | 64 void BoxPainter::paintBoxDecorationBackground(const PaintInfo& paintInfo, |
| 65 const LayoutPoint& paintOffset) { | 65 const LayoutPoint& paintOffset) { |
| 66 LayoutRect paintRect; | 66 LayoutRect paintRect; |
| 67 Optional<ScrollRecorder> scrollRecorder; | 67 Optional<ScrollRecorder> scrollRecorder; |
| 68 if (isPaintingBackgroundOfPaintContainerIntoScrollingContentsLayer( | 68 if (isPaintingBackgroundOfPaintContainerIntoScrollingContentsLayer( |
| 69 &m_layoutBox, paintInfo)) { | 69 &m_layoutBox, paintInfo)) { |
| 70 // For the case where we are painting the background into the scrolling | 70 // For the case where we are painting the background into the scrolling |
| 71 // contents layer of a composited scroller we need to include the entire | 71 // contents layer of a composited scroller we need to include the entire |
| 72 // overflow rect. | 72 // overflow rect. |
| 73 paintRect = m_layoutBox.layoutOverflowRect(); | 73 paintRect = m_layoutBox.layoutOverflowRect(); |
| 74 scrollRecorder.emplace(paintInfo.context, m_layoutBox, paintInfo.phase, | 74 scrollRecorder.emplace( |
| 75 m_layoutBox.scrolledContentOffset()); | 75 paintInfo.context, paintInfo.phase, m_layoutBox.scrolledContentOffset(), |
| 76 m_layoutBox.visualRect(), m_layoutBox.debugName(), |
| 77 m_layoutBox.paintedOutputOfObjectHasNoEffectRegardlessOfSize()); |
| 76 | 78 |
| 77 // The background painting code assumes that the borders are part of the | 79 // The background painting code assumes that the borders are part of the |
| 78 // paintRect so we expand the paintRect by the border size when painting the | 80 // paintRect so we expand the paintRect by the border size when painting the |
| 79 // background into the scrolling contents layer. | 81 // background into the scrolling contents layer. |
| 80 paintRect.expandEdges(m_layoutBox.borderTop(), m_layoutBox.borderRight(), | 82 paintRect.expandEdges(m_layoutBox.borderTop(), m_layoutBox.borderRight(), |
| 81 m_layoutBox.borderBottom(), m_layoutBox.borderLeft()); | 83 m_layoutBox.borderBottom(), m_layoutBox.borderLeft()); |
| 82 } else { | 84 } else { |
| 83 paintRect = m_layoutBox.borderBoxRect(); | 85 paintRect = m_layoutBox.borderBoxRect(); |
| 84 } | 86 } |
| 85 | 87 |
| (...skipping 1003 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1089 bool BoxPainter::shouldForceWhiteBackgroundForPrintEconomy( | 1091 bool BoxPainter::shouldForceWhiteBackgroundForPrintEconomy( |
| 1090 const ComputedStyle& style, | 1092 const ComputedStyle& style, |
| 1091 const Document& document) { | 1093 const Document& document) { |
| 1092 return document.printing() && | 1094 return document.printing() && |
| 1093 style.printColorAdjust() == EPrintColorAdjust::kEconomy && | 1095 style.printColorAdjust() == EPrintColorAdjust::kEconomy && |
| 1094 (!document.settings() || | 1096 (!document.settings() || |
| 1095 !document.settings()->getShouldPrintBackgrounds()); | 1097 !document.settings()->getShouldPrintBackgrounds()); |
| 1096 } | 1098 } |
| 1097 | 1099 |
| 1098 } // namespace blink | 1100 } // namespace blink |
| OLD | NEW |