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

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

Issue 1704493002: Use Image::updateConcreteSize() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@add-image-updateconcretesize
Patch Set: Move test here from dependency CL. 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 defaultObjectSize(positioningAreaSize);
57 defaultObjectSize.scale(1 / obj.style()->effectiveZoom());
58 image->updateConcreteObjectSize(defaultObjectSize);
59
60 LayoutSize imageIntrinsicSize = image->imageSize(&obj, obj.style()->effectiv eZoom());
57 imageIntrinsicSize.scale(1 / image->imageScaleFactor(), 1 / image->imageScal eFactor()); 61 imageIntrinsicSize.scale(1 / image->imageScaleFactor(), 1 / image->imageScal eFactor());
58 switch (type) { 62 switch (type) {
59 case SizeLength: { 63 case SizeLength: {
60 LayoutSize tileSize(positioningAreaSize); 64 LayoutSize tileSize(positioningAreaSize);
61 65
62 Length layerWidth = fillLayer.size().size.width(); 66 Length layerWidth = fillLayer.size().size.width();
63 Length layerHeight = fillLayer.size().size.height(); 67 Length layerHeight = fillLayer.size().size.height();
64 68
65 if (layerWidth.isFixed()) 69 if (layerWidth.isFixed())
66 tileSize.setWidth(LayoutUnit(layerWidth.value())); 70 tileSize.setWidth(LayoutUnit(layerWidth.value()));
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 } 368 }
365 369
366 if (fixedAttachment) 370 if (fixedAttachment)
367 useFixedAttachment(paintRect.location()); 371 useFixedAttachment(paintRect.location());
368 372
369 clip(paintRect); 373 clip(paintRect);
370 pixelSnapGeometry(); 374 pixelSnapGeometry();
371 } 375 }
372 376
373 } // namespace blink 377 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698