| OLD | NEW |
| 1 /* | 1 /* |
| 2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de) | 2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de) |
| 3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org) | 3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org) |
| 4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org) | 4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org) |
| 5 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) | 5 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) |
| 6 Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. | 6 Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. |
| 7 | 7 |
| 8 This library is free software; you can redistribute it and/or | 8 This library is free software; you can redistribute it and/or |
| 9 modify it under the terms of the GNU Library General Public | 9 modify it under the terms of the GNU Library General Public |
| 10 License as published by the Free Software Foundation; either | 10 License as published by the Free Software Foundation; either |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 } | 218 } |
| 219 | 219 |
| 220 bool CachedImage::imageHasRelativeHeight() const | 220 bool CachedImage::imageHasRelativeHeight() const |
| 221 { | 221 { |
| 222 if (m_image) | 222 if (m_image) |
| 223 return m_image->hasRelativeHeight(); | 223 return m_image->hasRelativeHeight(); |
| 224 | 224 |
| 225 return false; | 225 return false; |
| 226 } | 226 } |
| 227 | 227 |
| 228 LayoutSize CachedImage::imageSizeForRenderer(const RenderObject* renderer, float
multiplier) | 228 LayoutSize CachedImage::imageSizeForRenderer(const RenderObject* renderer, float
multiplier, SizeType sizeType) |
| 229 { | 229 { |
| 230 ASSERT(!isPurgeable()); | 230 ASSERT(!isPurgeable()); |
| 231 | 231 |
| 232 if (!m_image) | 232 if (!m_image) |
| 233 return IntSize(); | 233 return IntSize(); |
| 234 | 234 |
| 235 LayoutSize imageSize; | 235 LayoutSize imageSize; |
| 236 | 236 |
| 237 if (m_image->isBitmapImage() && (renderer && renderer->shouldRespectImageOri
entation() == RespectImageOrientation)) | 237 if (m_image->isBitmapImage() && (renderer && renderer->shouldRespectImageOri
entation() == RespectImageOrientation)) |
| 238 imageSize = static_cast<BitmapImage*>(m_image.get())->sizeRespectingOrie
ntation(); | 238 imageSize = static_cast<BitmapImage*>(m_image.get())->sizeRespectingOrie
ntation(); |
| 239 else if (m_image->isSVGImage()) | 239 else if (m_image->isSVGImage() && sizeType == NormalSize) |
| 240 imageSize = m_svgImageCache->imageSizeForRenderer(renderer); | 240 imageSize = m_svgImageCache->imageSizeForRenderer(renderer); |
| 241 else | 241 else |
| 242 imageSize = m_image->size(); | 242 imageSize = m_image->size(); |
| 243 | 243 |
| 244 if (multiplier == 1.0f) | 244 if (multiplier == 1.0f) |
| 245 return imageSize; | 245 return imageSize; |
| 246 | 246 |
| 247 // Don't let images that have a width/height >= 1 shrink below 1 when zoomed
. | 247 // Don't let images that have a width/height >= 1 shrink below 1 when zoomed
. |
| 248 float widthScale = m_image->hasRelativeWidth() ? 1.0f : multiplier; | 248 float widthScale = m_image->hasRelativeWidth() ? 1.0f : multiplier; |
| 249 float heightScale = m_image->hasRelativeHeight() ? 1.0f : multiplier; | 249 float heightScale = m_image->hasRelativeHeight() ? 1.0f : multiplier; |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 440 | 440 |
| 441 bool CachedImage::currentFrameKnownToBeOpaque(const RenderObject* renderer) | 441 bool CachedImage::currentFrameKnownToBeOpaque(const RenderObject* renderer) |
| 442 { | 442 { |
| 443 Image* image = imageForRenderer(renderer); | 443 Image* image = imageForRenderer(renderer); |
| 444 if (image->isBitmapImage()) | 444 if (image->isBitmapImage()) |
| 445 image->nativeImageForCurrentFrame(); // force decode | 445 image->nativeImageForCurrentFrame(); // force decode |
| 446 return image->currentFrameKnownToBeOpaque(); | 446 return image->currentFrameKnownToBeOpaque(); |
| 447 } | 447 } |
| 448 | 448 |
| 449 } // namespace WebCore | 449 } // namespace WebCore |
| OLD | NEW |