OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Research In Motion Limited. All rights reserved. | 2 * Copyright (C) 2011 Research In Motion Limited. All rights reserved. |
3 * Copyright (C) 2013 Apple Inc. All rights reserved. | 3 * Copyright (C) 2013 Apple Inc. All rights reserved. |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 IntSize SVGImageCache::imageSizeForRenderer(const RenderObject* renderer) const | 67 IntSize SVGImageCache::imageSizeForRenderer(const RenderObject* renderer) const |
68 { | 68 { |
69 IntSize imageSize = m_svgImage->size(); | 69 IntSize imageSize = m_svgImage->size(); |
70 if (!renderer) | 70 if (!renderer) |
71 return imageSize; | 71 return imageSize; |
72 | 72 |
73 ImageForContainerMap::const_iterator it = m_imageForContainerMap.find(render
er); | 73 ImageForContainerMap::const_iterator it = m_imageForContainerMap.find(render
er); |
74 if (it == m_imageForContainerMap.end()) | 74 if (it == m_imageForContainerMap.end()) |
75 return imageSize; | 75 return imageSize; |
76 | 76 |
77 RefPtr<SVGImageForContainer> image = it->value; | 77 RefPtr<SVGImageForContainer> imageForContainer = it->value; |
78 ASSERT(!image->size().isEmpty()); | 78 ASSERT(!imageForContainer->size().isEmpty()); |
79 return image->size(); | 79 return imageForContainer->size(); |
80 } | 80 } |
81 | 81 |
82 // FIXME: This doesn't take into account the animation timeline so animations wi
ll not | 82 // FIXME: This doesn't take into account the animation timeline so animations wi
ll not |
83 // restart on page load, nor will two animations in different pages have differe
nt timelines. | 83 // restart on page load, nor will two animations in different pages have differe
nt timelines. |
84 Image* SVGImageCache::imageForRenderer(const RenderObject* renderer) | 84 Image* SVGImageCache::imageForRenderer(const RenderObject* renderer) |
85 { | 85 { |
86 if (!renderer) | 86 if (!renderer) |
87 return Image::nullImage(); | 87 return Image::nullImage(); |
88 | 88 |
89 ImageForContainerMap::iterator it = m_imageForContainerMap.find(renderer); | 89 ImageForContainerMap::iterator it = m_imageForContainerMap.find(renderer); |
90 if (it == m_imageForContainerMap.end()) | 90 if (it == m_imageForContainerMap.end()) |
91 return Image::nullImage(); | 91 return Image::nullImage(); |
92 | 92 |
93 RefPtr<SVGImageForContainer> image = it->value; | 93 RefPtr<SVGImageForContainer> imageForContainer = it->value; |
94 ASSERT(!image->size().isEmpty()); | 94 ASSERT(!imageForContainer->size().isEmpty()); |
95 return image.get(); | 95 return imageForContainer.get(); |
96 } | 96 } |
97 | 97 |
98 } // namespace WebCore | 98 } // namespace WebCore |
99 | 99 |
100 #endif // ENABLE(SVG) | 100 #endif // ENABLE(SVG) |
OLD | NEW |