| 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/BackgroundImageGeometry.h" | 5 #include "core/paint/BackgroundImageGeometry.h" |
| 6 | 6 |
| 7 #include "core/frame/FrameView.h" | 7 #include "core/frame/FrameView.h" |
| 8 #include "core/layout/LayoutBox.h" | 8 #include "core/layout/LayoutBox.h" |
| 9 #include "core/layout/LayoutBoxModelObject.h" | 9 #include "core/layout/LayoutBoxModelObject.h" |
| 10 #include "core/layout/LayoutView.h" | 10 #include "core/layout/LayoutView.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 return false; | 46 return false; |
| 47 | 47 |
| 48 return rootLayer->compositedLayerMapping()->backgroundLayerPaintsFixedRootBa
ckground(); | 48 return rootLayer->compositedLayerMapping()->backgroundLayerPaintsFixedRootBa
ckground(); |
| 49 } | 49 } |
| 50 | 50 |
| 51 LayoutSize calculateFillTileSize(const LayoutBoxModelObject& obj, const FillLaye
r& fillLayer, const LayoutSize& positioningAreaSize) | 51 LayoutSize calculateFillTileSize(const LayoutBoxModelObject& obj, const FillLaye
r& fillLayer, const LayoutSize& positioningAreaSize) |
| 52 { | 52 { |
| 53 StyleImage* image = fillLayer.image(); | 53 StyleImage* image = fillLayer.image(); |
| 54 EFillSizeType type = fillLayer.size().type; | 54 EFillSizeType type = fillLayer.size().type; |
| 55 | 55 |
| 56 LayoutSize imageIntrinsicSize = obj.calculateImageIntrinsicDimensions(image,
positioningAreaSize, LayoutBoxModelObject::ScaleByEffectiveZoom); | 56 LayoutSize imageIntrinsicSize = image->imageSize(&obj, obj.style()->effectiv
eZoom(), positioningAreaSize); |
| 57 imageIntrinsicSize.scale(1 / image->imageScaleFactor(), 1 / image->imageScal
eFactor()); | |
| 58 switch (type) { | 57 switch (type) { |
| 59 case SizeLength: { | 58 case SizeLength: { |
| 60 LayoutSize tileSize(positioningAreaSize); | 59 LayoutSize tileSize(positioningAreaSize); |
| 61 | 60 |
| 62 Length layerWidth = fillLayer.size().size.width(); | 61 Length layerWidth = fillLayer.size().size.width(); |
| 63 Length layerHeight = fillLayer.size().size.height(); | 62 Length layerHeight = fillLayer.size().size.height(); |
| 64 | 63 |
| 65 if (layerWidth.isFixed()) | 64 if (layerWidth.isFixed()) |
| 66 tileSize.setWidth(LayoutUnit(layerWidth.value())); | 65 tileSize.setWidth(LayoutUnit(layerWidth.value())); |
| 67 else if (layerWidth.hasPercent()) | 66 else if (layerWidth.hasPercent()) |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 } | 363 } |
| 365 | 364 |
| 366 if (fixedAttachment) | 365 if (fixedAttachment) |
| 367 useFixedAttachment(paintRect.location()); | 366 useFixedAttachment(paintRect.location()); |
| 368 | 367 |
| 369 clip(paintRect); | 368 clip(paintRect); |
| 370 pixelSnapGeometry(); | 369 pixelSnapGeometry(); |
| 371 } | 370 } |
| 372 | 371 |
| 373 } // namespace blink | 372 } // namespace blink |
| OLD | NEW |