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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutImageResource.cpp

Issue 1732563007: [NOT FOR COMMIT] Pass defaultObjectSize to get image size (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll <knoll@kde.org> 2 * Copyright (C) 1999 Lars Knoll <knoll@kde.org>
3 * Copyright (C) 1999 Antti Koivisto <koivisto@kde.org> 3 * Copyright (C) 1999 Antti Koivisto <koivisto@kde.org>
4 * Copyright (C) 2000 Dirk Mueller <mueller@kde.org> 4 * Copyright (C) 2000 Dirk Mueller <mueller@kde.org>
5 * Copyright (C) 2006 Allan Sandfeld Jensen <kde@carewolf.com> 5 * Copyright (C) 2006 Allan Sandfeld Jensen <kde@carewolf.com>
6 * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> 6 * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
7 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009, 2010 Apple Inc. All rights reserved. 7 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009, 2010 Apple Inc. All rights reserved.
8 * Copyright (C) 2010 Google Inc. All rights reserved. 8 * Copyright (C) 2010 Google Inc. All rights reserved.
9 * Copyright (C) 2010 Patrick Gansterer <paroga@paroga.com> 9 * Copyright (C) 2010 Patrick Gansterer <paroga@paroga.com>
10 * 10 *
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 ASSERT(m_layoutObject); 82 ASSERT(m_layoutObject);
83 83
84 if (!m_cachedImage) 84 if (!m_cachedImage)
85 return; 85 return;
86 86
87 m_cachedImage->image()->resetAnimation(); 87 m_cachedImage->image()->resetAnimation();
88 88
89 m_layoutObject->setShouldDoFullPaintInvalidation(); 89 m_layoutObject->setShouldDoFullPaintInvalidation();
90 } 90 }
91 91
92 LayoutSize LayoutImageResource::imageSize(float multiplier) const 92 LayoutSize LayoutImageResource::concreteObjectSize(const FloatSize& defaultObjec tSize, float multiplier) const
93 { 93 {
94 if (!m_cachedImage) 94 if (!m_cachedImage)
95 return LayoutSize(); 95 return LayoutSize();
96 LayoutSize size = m_cachedImage->imageSize(LayoutObject::shouldRespectImageO rientation(m_layoutObject), multiplier); 96 LayoutSize size = m_cachedImage->concreteObjectSize(defaultObjectSize, Layou tObject::shouldRespectImageOrientation(m_layoutObject), multiplier);
97 if (m_layoutObject && m_layoutObject->isLayoutImage() && size.width() && siz e.height()) 97 if (m_layoutObject && m_layoutObject->isLayoutImage() && size.width() && siz e.height())
98 size.scale(toLayoutImage(m_layoutObject)->imageDevicePixelRatio()); 98 size.scale(toLayoutImage(m_layoutObject)->imageDevicePixelRatio());
99 return size; 99 return size;
100 } 100 }
101 101
102 PassRefPtr<Image> LayoutImageResource::image(const IntSize& containerSize, float zoom) const 102 PassRefPtr<Image> LayoutImageResource::image(const IntSize& containerSize, float zoom) const
103 { 103 {
104 if (!m_cachedImage) 104 if (!m_cachedImage)
105 return Image::nullImage(); 105 return Image::nullImage();
106 106
(...skipping 10 matching lines...) Expand all
117 return SVGImageForContainer::create(svgImage, containerSize, zoom, url); 117 return SVGImageForContainer::create(svgImage, containerSize, zoom, url);
118 } 118 }
119 119
120 bool LayoutImageResource::maybeAnimated() const 120 bool LayoutImageResource::maybeAnimated() const
121 { 121 {
122 Image* image = m_cachedImage ? m_cachedImage->image() : Image::nullImage(); 122 Image* image = m_cachedImage ? m_cachedImage->image() : Image::nullImage();
123 return image->maybeAnimated(); 123 return image->maybeAnimated();
124 } 124 }
125 125
126 } // namespace blink 126 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698