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

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

Issue 1468473002: Remove redundant IntrinsicSize argument (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 87
88 m_cachedImage->image()->resetAnimation(); 88 m_cachedImage->image()->resetAnimation();
89 89
90 m_layoutObject->setShouldDoFullPaintInvalidation(); 90 m_layoutObject->setShouldDoFullPaintInvalidation();
91 } 91 }
92 92
93 LayoutSize LayoutImageResource::imageSize(float multiplier) const 93 LayoutSize LayoutImageResource::imageSize(float multiplier) const
94 { 94 {
95 if (!m_cachedImage) 95 if (!m_cachedImage)
96 return LayoutSize(); 96 return LayoutSize();
97 LayoutSize size = m_cachedImage->imageSizeForLayoutObject(m_layoutObject, mu ltiplier, ImageResource::IntrinsicSize); 97 LayoutSize size = m_cachedImage->imageSizeForLayoutObject(m_layoutObject, mu ltiplier);
98 if (m_layoutObject && m_layoutObject->isLayoutImage() && size.width() && siz e.height()) 98 if (m_layoutObject && m_layoutObject->isLayoutImage() && size.width() && siz e.height())
99 size.scale(toLayoutImage(m_layoutObject)->imageDevicePixelRatio()); 99 size.scale(toLayoutImage(m_layoutObject)->imageDevicePixelRatio());
100 return size; 100 return size;
101 } 101 }
102 102
103 PassRefPtr<Image> LayoutImageResource::image(const IntSize& containerSize, float zoom) const 103 PassRefPtr<Image> LayoutImageResource::image(const IntSize& containerSize, float zoom) const
104 { 104 {
105 RefPtr<Image> image = m_cachedImage ? m_cachedImage->image() : Image::nullIm age(); 105 RefPtr<Image> image = m_cachedImage ? m_cachedImage->image() : Image::nullIm age();
106 if (image->isSVGImage()) { 106 if (image->isSVGImage()) {
107 KURL url; 107 KURL url;
108 SVGImage* svgImage = toSVGImage(image.get()); 108 SVGImage* svgImage = toSVGImage(image.get());
109 Node* node = m_layoutObject->node(); 109 Node* node = m_layoutObject->node();
110 if (node && node->isElementNode()) { 110 if (node && node->isElementNode()) {
111 const AtomicString& urlString = toElement(node)->imageSourceURL(); 111 const AtomicString& urlString = toElement(node)->imageSourceURL();
112 url = node->document().completeURL(urlString); 112 url = node->document().completeURL(urlString);
113 } 113 }
114 return SVGImageForContainer::create(svgImage, containerSize, zoom, url); 114 return SVGImageForContainer::create(svgImage, containerSize, zoom, url);
115 } 115 }
116 return image; 116 return image;
117 } 117 }
118 118
119 bool LayoutImageResource::maybeAnimated() const 119 bool LayoutImageResource::maybeAnimated() const
120 { 120 {
121 Image* image = m_cachedImage ? m_cachedImage->image() : Image::nullImage(); 121 Image* image = m_cachedImage ? m_cachedImage->image() : Image::nullImage();
122 return image->maybeAnimated(); 122 return image->maybeAnimated();
123 } 123 }
124 124
125 } // namespace blink 125 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698