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 "config.h" | 5 #include "config.h" |
6 #include "core/paint/BoxPainter.h" | 6 #include "core/paint/BoxPainter.h" |
7 | 7 |
8 #include "core/HTMLNames.h" | 8 #include "core/HTMLNames.h" |
9 #include "core/frame/Settings.h" | 9 #include "core/frame/Settings.h" |
10 #include "core/html/HTMLFrameOwnerElement.h" | 10 #include "core/html/HTMLFrameOwnerElement.h" |
(...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
577 int space = -1; | 577 int space = -1; |
578 | 578 |
579 if (numberOfTiles > 1) { | 579 if (numberOfTiles > 1) { |
580 // Spec doesn't specify rounding, so use the same method as for backgrou
nd-repeat: round. | 580 // Spec doesn't specify rounding, so use the same method as for backgrou
nd-repeat: round. |
581 space = lroundf((areaSize - numberOfTiles * tileSize) / (float)(numberOf
Tiles - 1)); | 581 space = lroundf((areaSize - numberOfTiles * tileSize) / (float)(numberOf
Tiles - 1)); |
582 } | 582 } |
583 | 583 |
584 return space; | 584 return space; |
585 } | 585 } |
586 | 586 |
587 void BoxPainter::calculateBackgroundImageGeometry(LayoutBoxModelObject& obj, con
st LayoutBoxModelObject* paintContainer, const GlobalPaintFlags globalPaintFlags
, const FillLayer& fillLayer, const LayoutRect& paintRect, | 587 void BoxPainter::calculateBackgroundImageGeometry(const LayoutBoxModelObject& ob
j, const LayoutBoxModelObject* paintContainer, const GlobalPaintFlags globalPain
tFlags, const FillLayer& fillLayer, const LayoutRect& paintRect, |
588 BackgroundImageGeometry& geometry, LayoutObject* backgroundObject) | 588 BackgroundImageGeometry& geometry, LayoutObject* backgroundObject) |
589 { | 589 { |
590 LayoutUnit left = 0; | 590 LayoutUnit left = 0; |
591 LayoutUnit top = 0; | 591 LayoutUnit top = 0; |
592 IntSize positioningAreaSize; | 592 IntSize positioningAreaSize; |
593 IntRect snappedPaintRect = pixelSnappedIntRect(paintRect); | 593 IntRect snappedPaintRect = pixelSnappedIntRect(paintRect); |
594 bool isLayoutView = obj.isLayoutView(); | 594 bool isLayoutView = obj.isLayoutView(); |
595 const LayoutBox* rootBox = nullptr; | 595 const LayoutBox* rootBox = nullptr; |
596 if (isLayoutView) { | 596 if (isLayoutView) { |
597 // It is only possible reach here when root element has a box. | 597 // It is only possible reach here when root element has a box. |
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1044 } | 1044 } |
1045 } | 1045 } |
1046 | 1046 |
1047 bool BoxPainter::shouldForceWhiteBackgroundForPrintEconomy(const ComputedStyle&
style, const Document& document) | 1047 bool BoxPainter::shouldForceWhiteBackgroundForPrintEconomy(const ComputedStyle&
style, const Document& document) |
1048 { | 1048 { |
1049 return document.printing() && style.printColorAdjust() == PrintColorAdjustEc
onomy | 1049 return document.printing() && style.printColorAdjust() == PrintColorAdjustEc
onomy |
1050 && (!document.settings() || !document.settings()->shouldPrintBackgrounds
()); | 1050 && (!document.settings() || !document.settings()->shouldPrintBackgrounds
()); |
1051 } | 1051 } |
1052 | 1052 |
1053 } // namespace blink | 1053 } // namespace blink |
OLD | NEW |