OLD | NEW |
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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 } | 50 } |
51 | 51 |
52 void LayoutImageResource::shutdown() | 52 void LayoutImageResource::shutdown() |
53 { | 53 { |
54 ASSERT(m_layoutObject); | 54 ASSERT(m_layoutObject); |
55 | 55 |
56 if (m_cachedImage) | 56 if (m_cachedImage) |
57 m_cachedImage->removeClient(m_layoutObject); | 57 m_cachedImage->removeClient(m_layoutObject); |
58 } | 58 } |
59 | 59 |
60 void LayoutImageResource::setImageResource(ImageResource* newImage) | 60 void LayoutImageResource::setImageResource(ImageResource* newImage, const KURL&
urlWithFragment) |
61 { | 61 { |
62 ASSERT(m_layoutObject); | 62 ASSERT(m_layoutObject); |
63 | 63 |
64 if (m_cachedImage == newImage) | 64 if (m_cachedImage == newImage) |
65 return; | 65 return; |
66 | 66 |
67 if (m_cachedImage) | 67 if (m_cachedImage) |
68 m_cachedImage->removeClient(m_layoutObject); | 68 m_cachedImage->removeClient(m_layoutObject); |
69 m_cachedImage = newImage; | 69 m_cachedImage = newImage; |
| 70 m_urlWithFragment = urlWithFragment; |
70 if (m_cachedImage) { | 71 if (m_cachedImage) { |
71 m_cachedImage->addClient(m_layoutObject); | 72 m_cachedImage->addClient(m_layoutObject); |
72 if (m_cachedImage->errorOccurred()) | 73 if (m_cachedImage->errorOccurred()) |
73 m_layoutObject->imageChanged(m_cachedImage.get()); | 74 m_layoutObject->imageChanged(m_cachedImage.get()); |
74 } else { | 75 } else { |
75 m_layoutObject->imageChanged(m_cachedImage.get()); | 76 m_layoutObject->imageChanged(m_cachedImage.get()); |
76 } | 77 } |
77 } | 78 } |
78 | 79 |
79 void LayoutImageResource::resetAnimation() | 80 void LayoutImageResource::resetAnimation() |
80 { | 81 { |
81 ASSERT(m_layoutObject); | 82 ASSERT(m_layoutObject); |
82 | 83 |
83 if (!m_cachedImage) | 84 if (!m_cachedImage) |
84 return; | 85 return; |
85 | 86 |
86 image()->resetAnimation(); | 87 image()->resetAnimation(); |
87 | 88 |
88 m_layoutObject->setShouldDoFullPaintInvalidation(); | 89 m_layoutObject->setShouldDoFullPaintInvalidation(); |
89 } | 90 } |
90 | 91 |
91 void LayoutImageResource::setContainerSizeForLayoutObject(const IntSize& imageCo
ntainerSize) | 92 void LayoutImageResource::setContainerSizeForLayoutObject(const IntSize& imageCo
ntainerSize) |
92 { | 93 { |
93 ASSERT(m_layoutObject); | 94 ASSERT(m_layoutObject); |
94 if (m_cachedImage) | 95 if (m_cachedImage) { |
95 m_cachedImage->setContainerSizeForLayoutObject(m_layoutObject, imageCont
ainerSize, m_layoutObject->style()->effectiveZoom()); | 96 m_cachedImage->setContainerParametersForLayoutObject( |
| 97 m_layoutObject, imageContainerSize, m_layoutObject->style()->effecti
veZoom(), m_urlWithFragment); |
| 98 } |
96 } | 99 } |
97 | 100 |
98 LayoutSize LayoutImageResource::getImageSize(float multiplier, ImageResource::Si
zeType type) const | 101 LayoutSize LayoutImageResource::getImageSize(float multiplier, ImageResource::Si
zeType type) const |
99 { | 102 { |
100 if (!m_cachedImage) | 103 if (!m_cachedImage) |
101 return LayoutSize(); | 104 return LayoutSize(); |
102 LayoutSize size = m_cachedImage->imageSizeForLayoutObject(m_layoutObject, mu
ltiplier, type); | 105 LayoutSize size = m_cachedImage->imageSizeForLayoutObject(m_layoutObject, mu
ltiplier, type); |
103 if (m_layoutObject && m_layoutObject->isLayoutImage() && size.width() && siz
e.height()) | 106 if (m_layoutObject && m_layoutObject->isLayoutImage() && size.width() && siz
e.height()) |
104 size.scale(toLayoutImage(m_layoutObject)->imageDevicePixelRatio()); | 107 size.scale(toLayoutImage(m_layoutObject)->imageDevicePixelRatio()); |
105 return size; | 108 return size; |
106 } | 109 } |
107 | 110 |
108 } // namespace blink | 111 } // namespace blink |
OLD | NEW |