Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(181)

Side by Side Diff: third_party/WebKit/Source/core/paint/BackgroundImageGeometry.cpp

Issue 1756763004: Merge image sizing algorithms (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Extend test to cover svg and non-svg case Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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()); 57 imageIntrinsicSize.scale(1 / image->imageScaleFactor(), 1 / image->imageScal eFactor());
58 switch (type) { 58 switch (type) {
59 case SizeLength: { 59 case SizeLength: {
60 LayoutSize tileSize(positioningAreaSize); 60 LayoutSize tileSize(positioningAreaSize);
61 61
62 Length layerWidth = fillLayer.size().size.width(); 62 Length layerWidth = fillLayer.size().size.width();
63 Length layerHeight = fillLayer.size().size.height(); 63 Length layerHeight = fillLayer.size().size.height();
64 64
65 if (layerWidth.isFixed()) 65 if (layerWidth.isFixed())
66 tileSize.setWidth(LayoutUnit(layerWidth.value())); 66 tileSize.setWidth(LayoutUnit(layerWidth.value()));
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 } 364 }
365 365
366 if (fixedAttachment) 366 if (fixedAttachment)
367 useFixedAttachment(paintRect.location()); 367 useFixedAttachment(paintRect.location());
368 368
369 clip(paintRect); 369 clip(paintRect);
370 pixelSnapGeometry(); 370 pixelSnapGeometry();
371 } 371 }
372 372
373 } // namespace blink 373 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698