OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2000 Dirk Mueller (mueller@kde.org) | 4 * (C) 2000 Dirk Mueller (mueller@kde.org) |
5 * (C) 2006 Allan Sandfeld Jensen (kde@carewolf.com) | 5 * (C) 2006 Allan Sandfeld Jensen (kde@carewolf.com) |
6 * (C) 2006 Samuel Weinig (sam.weinig@gmail.com) | 6 * (C) 2006 Samuel Weinig (sam.weinig@gmail.com) |
7 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009, 2010, 2011 Apple Inc. All r
ights reserved. | 7 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009, 2010, 2011 Apple Inc. All r
ights reserved. |
8 * Copyright (C) 2010 Google Inc. All rights reserved. | 8 * Copyright (C) 2010 Google Inc. All rights reserved. |
9 * Copyright (C) Research In Motion Limited 2011-2012. All rights reserved. | 9 * Copyright (C) Research In Motion Limited 2011-2012. All rights reserved. |
10 * | 10 * |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 | 157 |
158 if (hasBoxDecorations() || hasMask()) | 158 if (hasBoxDecorations() || hasMask()) |
159 RenderReplaced::imageChanged(newImage, rect); | 159 RenderReplaced::imageChanged(newImage, rect); |
160 | 160 |
161 if (!m_imageResource) | 161 if (!m_imageResource) |
162 return; | 162 return; |
163 | 163 |
164 if (newImage != m_imageResource->imagePtr()) | 164 if (newImage != m_imageResource->imagePtr()) |
165 return; | 165 return; |
166 | 166 |
| 167 if (m_imageResource->cachedImage() && m_imageResource->cachedImage()->hasDpr
HeaderValue()) |
| 168 m_imageDevicePixelRatio = 1 / m_imageResource->cachedImage()->dprHeaderV
alue(); |
| 169 |
167 if (!m_didIncrementVisuallyNonEmptyPixelCount) { | 170 if (!m_didIncrementVisuallyNonEmptyPixelCount) { |
168 // At a zoom level of 1 the image is guaranteed to have an integer size. | 171 // At a zoom level of 1 the image is guaranteed to have an integer size. |
169 view()->frameView()->incrementVisuallyNonEmptyPixelCount(flooredIntSize(
m_imageResource->imageSize(1.0f))); | 172 view()->frameView()->incrementVisuallyNonEmptyPixelCount(flooredIntSize(
m_imageResource->imageSize(1.0f))); |
170 m_didIncrementVisuallyNonEmptyPixelCount = true; | 173 m_didIncrementVisuallyNonEmptyPixelCount = true; |
171 } | 174 } |
172 | 175 |
173 bool imageSizeChanged = false; | 176 bool imageSizeChanged = false; |
174 | 177 |
175 // Set image dimensions, taking into account the size of the alt text. | 178 // Set image dimensions, taking into account the size of the alt text. |
176 if (m_imageResource->errorOccurred() || !newImage) { | 179 if (m_imageResource->errorOccurred() || !newImage) { |
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
604 return 0; | 607 return 0; |
605 | 608 |
606 ImageResource* cachedImage = m_imageResource->cachedImage(); | 609 ImageResource* cachedImage = m_imageResource->cachedImage(); |
607 if (cachedImage && cachedImage->image() && cachedImage->image()->isSVGImage(
)) | 610 if (cachedImage && cachedImage->image() && cachedImage->image()->isSVGImage(
)) |
608 return toSVGImage(cachedImage->image())->embeddedContentBox(); | 611 return toSVGImage(cachedImage->image())->embeddedContentBox(); |
609 | 612 |
610 return 0; | 613 return 0; |
611 } | 614 } |
612 | 615 |
613 } // namespace WebCore | 616 } // namespace WebCore |
OLD | NEW |