OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2011 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 fromImageSize.height() * inversePercentage + toImageSize.height() * perc
entage); | 121 fromImageSize.height() * inversePercentage + toImageSize.height() * perc
entage); |
122 } | 122 } |
123 | 123 |
124 bool CSSCrossfadeValue::isPending() const | 124 bool CSSCrossfadeValue::isPending() const |
125 { | 125 { |
126 return subimageIsPending(m_fromValue.get()) || subimageIsPending(m_toValue.g
et()); | 126 return subimageIsPending(m_fromValue.get()) || subimageIsPending(m_toValue.g
et()); |
127 } | 127 } |
128 | 128 |
129 void CSSCrossfadeValue::loadSubimages(CachedResourceLoader* cachedResourceLoader
) | 129 void CSSCrossfadeValue::loadSubimages(CachedResourceLoader* cachedResourceLoader
) |
130 { | 130 { |
| 131 CachedResourceHandle<CachedImage> oldCachedFromImage = m_cachedFromImage; |
| 132 CachedResourceHandle<CachedImage> oldCachedToImage = m_cachedToImage; |
| 133 |
131 m_cachedFromImage = cachedImageForCSSValue(m_fromValue.get(), cachedResource
Loader); | 134 m_cachedFromImage = cachedImageForCSSValue(m_fromValue.get(), cachedResource
Loader); |
132 m_cachedToImage = cachedImageForCSSValue(m_toValue.get(), cachedResourceLoad
er); | 135 m_cachedToImage = cachedImageForCSSValue(m_toValue.get(), cachedResourceLoad
er); |
133 | 136 |
134 if (m_cachedFromImage) | 137 if (m_cachedFromImage != oldCachedFromImage) { |
135 m_cachedFromImage->addClient(&m_crossfadeSubimageObserver); | 138 if (oldCachedFromImage) |
136 if (m_cachedToImage) | 139 oldCachedFromImage->removeClient(&m_crossfadeSubimageObserver); |
137 m_cachedToImage->addClient(&m_crossfadeSubimageObserver); | 140 if (m_cachedFromImage) |
| 141 m_cachedFromImage->addClient(&m_crossfadeSubimageObserver); |
| 142 } |
| 143 |
| 144 if (m_cachedToImage != oldCachedToImage) { |
| 145 if (oldCachedToImage) |
| 146 oldCachedToImage->removeClient(&m_crossfadeSubimageObserver); |
| 147 if (m_cachedToImage) |
| 148 m_cachedToImage->addClient(&m_crossfadeSubimageObserver); |
| 149 } |
138 | 150 |
139 m_crossfadeSubimageObserver.setReady(true); | 151 m_crossfadeSubimageObserver.setReady(true); |
140 } | 152 } |
141 | 153 |
142 void CSSCrossfadeValue::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObje
ctInfo) const | 154 void CSSCrossfadeValue::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObje
ctInfo) const |
143 { | 155 { |
144 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); | 156 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); |
145 CSSImageGeneratorValue::reportBaseClassMemoryUsage(memoryObjectInfo); | 157 CSSImageGeneratorValue::reportBaseClassMemoryUsage(memoryObjectInfo); |
146 info.addMember(m_fromValue); | 158 info.addMember(m_fromValue); |
147 info.addMember(m_toValue); | 159 info.addMember(m_toValue); |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 bool CSSCrossfadeValue::hasFailedOrCanceledSubresources() const | 205 bool CSSCrossfadeValue::hasFailedOrCanceledSubresources() const |
194 { | 206 { |
195 if (m_cachedFromImage && m_cachedFromImage->loadFailedOrCanceled()) | 207 if (m_cachedFromImage && m_cachedFromImage->loadFailedOrCanceled()) |
196 return true; | 208 return true; |
197 if (m_cachedToImage && m_cachedToImage->loadFailedOrCanceled()) | 209 if (m_cachedToImage && m_cachedToImage->loadFailedOrCanceled()) |
198 return true; | 210 return true; |
199 return false; | 211 return false; |
200 } | 212 } |
201 | 213 |
202 } // namespace WebCore | 214 } // namespace WebCore |
OLD | NEW |