| 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 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 357 -(obj.paddingBottom() + obj.borderBottom()), | 357 -(obj.paddingBottom() + obj.borderBottom()), |
| 358 -(obj.paddingLeft() + obj.borderLeft())), | 358 -(obj.paddingLeft() + obj.borderLeft())), |
| 359 includeLeftEdge, includeRightEdge); | 359 includeLeftEdge, includeRightEdge); |
| 360 } else if (bgLayer.clip() == PaddingFillBox) { | 360 } else if (bgLayer.clip() == PaddingFillBox) { |
| 361 border = obj.style()->getRoundedInnerBorderFor(LayoutRect(border.rec
t()), includeLeftEdge, includeRightEdge); | 361 border = obj.style()->getRoundedInnerBorderFor(LayoutRect(border.rec
t()), includeLeftEdge, includeRightEdge); |
| 362 } | 362 } |
| 363 | 363 |
| 364 clipToBorder.emplace(obj, paintInfo, rect, border, ApplyToContext); | 364 clipToBorder.emplace(obj, paintInfo, rect, border, ApplyToContext); |
| 365 } | 365 } |
| 366 | 366 |
| 367 int bLeft = includeLeftEdge ? obj.borderLeft() : 0; | 367 int bLeft = includeLeftEdge ? obj.borderLeft().toInt() : 0; |
| 368 int bRight = includeRightEdge ? obj.borderRight() : 0; | 368 int bRight = includeRightEdge ? obj.borderRight().toInt() : 0; |
| 369 LayoutUnit pLeft = includeLeftEdge ? obj.paddingLeft() : LayoutUnit(); | 369 LayoutUnit pLeft = includeLeftEdge ? obj.paddingLeft() : LayoutUnit(); |
| 370 LayoutUnit pRight = includeRightEdge ? obj.paddingRight() : LayoutUnit(); | 370 LayoutUnit pRight = includeRightEdge ? obj.paddingRight() : LayoutUnit(); |
| 371 | 371 |
| 372 GraphicsContextStateSaver clipWithScrollingStateSaver(context, clippedWithLo
calScrolling); | 372 GraphicsContextStateSaver clipWithScrollingStateSaver(context, clippedWithLo
calScrolling); |
| 373 LayoutRect scrolledPaintRect = rect; | 373 LayoutRect scrolledPaintRect = rect; |
| 374 if (clippedWithLocalScrolling) { | 374 if (clippedWithLocalScrolling) { |
| 375 // Clip to the overflow area. | 375 // Clip to the overflow area. |
| 376 const LayoutBox& thisBox = toLayoutBox(obj); | 376 const LayoutBox& thisBox = toLayoutBox(obj); |
| 377 // TODO(chrishtr): this should be pixel-snapped. | 377 // TODO(chrishtr): this should be pixel-snapped. |
| 378 context.clip(FloatRect(thisBox.overflowClipRect(rect.location()))); | 378 context.clip(FloatRect(thisBox.overflowClipRect(rect.location()))); |
| (...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 695 } | 695 } |
| 696 } | 696 } |
| 697 | 697 |
| 698 bool BoxPainter::shouldForceWhiteBackgroundForPrintEconomy(const ComputedStyle&
style, const Document& document) | 698 bool BoxPainter::shouldForceWhiteBackgroundForPrintEconomy(const ComputedStyle&
style, const Document& document) |
| 699 { | 699 { |
| 700 return document.printing() && style.printColorAdjust() == PrintColorAdjustEc
onomy | 700 return document.printing() && style.printColorAdjust() == PrintColorAdjustEc
onomy |
| 701 && (!document.settings() || !document.settings()->shouldPrintBackgrounds
()); | 701 && (!document.settings() || !document.settings()->shouldPrintBackgrounds
()); |
| 702 } | 702 } |
| 703 | 703 |
| 704 } // namespace blink | 704 } // namespace blink |
| OLD | NEW |