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

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

Issue 1431193004: Reland of Make LayoutImageResource::image() parameter explicit (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 } 76 }
77 } 77 }
78 78
79 void LayoutImageResource::resetAnimation() 79 void LayoutImageResource::resetAnimation()
80 { 80 {
81 ASSERT(m_layoutObject); 81 ASSERT(m_layoutObject);
82 82
83 if (!m_cachedImage) 83 if (!m_cachedImage)
84 return; 84 return;
85 85
86 image()->resetAnimation(); 86 m_cachedImage->image()->resetAnimation();
87 87
88 m_layoutObject->setShouldDoFullPaintInvalidation(); 88 m_layoutObject->setShouldDoFullPaintInvalidation();
89 } 89 }
90 90
91 void LayoutImageResource::setContainerSizeForLayoutObject(const IntSize& imageCo ntainerSize) 91 void LayoutImageResource::setContainerSizeForLayoutObject(const IntSize& imageCo ntainerSize)
92 { 92 {
93 ASSERT(m_layoutObject); 93 ASSERT(m_layoutObject);
94 if (m_cachedImage) 94 if (m_cachedImage)
95 m_cachedImage->setContainerSizeForLayoutObject(m_layoutObject, imageCont ainerSize, m_layoutObject->style()->effectiveZoom()); 95 m_cachedImage->setContainerSizeForLayoutObject(m_layoutObject, imageCont ainerSize, m_layoutObject->style()->effectiveZoom());
96 } 96 }
97 97
98 LayoutSize LayoutImageResource::getImageSize(float multiplier, ImageResource::Si zeType type) const 98 LayoutSize LayoutImageResource::getImageSize(float multiplier, ImageResource::Si zeType type) const
99 { 99 {
100 if (!m_cachedImage) 100 if (!m_cachedImage)
101 return LayoutSize(); 101 return LayoutSize();
102 LayoutSize size = m_cachedImage->imageSizeForLayoutObject(m_layoutObject, mu ltiplier, type); 102 LayoutSize size = m_cachedImage->imageSizeForLayoutObject(m_layoutObject, mu ltiplier, type);
103 if (m_layoutObject && m_layoutObject->isLayoutImage() && size.width() && siz e.height()) 103 if (m_layoutObject && m_layoutObject->isLayoutImage() && size.width() && siz e.height())
104 size.scale(toLayoutImage(m_layoutObject)->imageDevicePixelRatio()); 104 size.scale(toLayoutImage(m_layoutObject)->imageDevicePixelRatio());
105 return size; 105 return size;
106 } 106 }
107 107
108 bool LayoutImageResource::maybeAnimated() const
109 {
110 Image* image = m_cachedImage ? m_cachedImage->image() : Image::nullImage();
111 return image->maybeAnimated();
112 }
113
108 } // namespace blink 114 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698