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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
44 child->paint(childInfo, adjustedPaintOffset); | 44 child->paint(childInfo, adjustedPaintOffset); |
45 } | 45 } |
46 | 46 |
47 void BoxPainter::paintBoxDecorationBackground(const PaintInfo& paintInfo, const LayoutPoint& paintOffset) | 47 void BoxPainter::paintBoxDecorationBackground(const PaintInfo& paintInfo, const LayoutPoint& paintOffset) |
48 { | 48 { |
49 LayoutRect paintRect = m_layoutBox.borderBoxRect(); | 49 LayoutRect paintRect = m_layoutBox.borderBoxRect(); |
50 paintRect.moveBy(paintOffset); | 50 paintRect.moveBy(paintOffset); |
51 paintBoxDecorationBackgroundWithRect(paintInfo, paintOffset, paintRect); | 51 paintBoxDecorationBackgroundWithRect(paintInfo, paintOffset, paintRect); |
52 } | 52 } |
53 | 53 |
54 LayoutRect BoxPainter::boundsForDrawingRecorder(const LayoutPoint& paintOffset) | 54 LayoutRect BoxPainter::boundsForDrawingRecorder(const LayoutPoint& adjustedPaint Offset) |
55 { | 55 { |
56 // Use the visual overflow rect here, because it will include overflow intro duced by the theme. | |
chrishtr
2016/05/14 08:56:14
This comment is incorrect somehow?
| |
57 LayoutRect bounds = m_layoutBox.visualOverflowRect(); | 56 LayoutRect bounds = m_layoutBox.visualOverflowRect(); |
58 bounds.moveBy(paintOffset); | 57 bounds.moveBy(adjustedPaintOffset); |
59 return bounds; | 58 return bounds; |
60 } | 59 } |
61 | 60 |
62 namespace { | 61 namespace { |
63 | 62 |
64 bool bleedAvoidanceIsClipping(BackgroundBleedAvoidance bleedAvoidance) | 63 bool bleedAvoidanceIsClipping(BackgroundBleedAvoidance bleedAvoidance) |
65 { | 64 { |
66 return bleedAvoidance == BackgroundBleedClipOnly || bleedAvoidance == Backgr oundBleedClipLayer; | 65 return bleedAvoidance == BackgroundBleedClipOnly || bleedAvoidance == Backgr oundBleedClipLayer; |
67 } | 66 } |
68 | 67 |
(...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
682 } | 681 } |
683 } | 682 } |
684 | 683 |
685 bool BoxPainter::shouldForceWhiteBackgroundForPrintEconomy(const ComputedStyle& style, const Document& document) | 684 bool BoxPainter::shouldForceWhiteBackgroundForPrintEconomy(const ComputedStyle& style, const Document& document) |
686 { | 685 { |
687 return document.printing() && style.getPrintColorAdjust() == PrintColorAdjus tEconomy | 686 return document.printing() && style.getPrintColorAdjust() == PrintColorAdjus tEconomy |
688 && (!document.settings() || !document.settings()->shouldPrintBackgrounds ()); | 687 && (!document.settings() || !document.settings()->shouldPrintBackgrounds ()); |
689 } | 688 } |
690 | 689 |
691 } // namespace blink | 690 } // namespace blink |
OLD | NEW |