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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 CSSCrossfadeValue::~CSSCrossfadeValue() | 119 CSSCrossfadeValue::~CSSCrossfadeValue() |
120 { | 120 { |
121 #if !ENABLE(OILPAN) | 121 #if !ENABLE(OILPAN) |
122 dispose(); | 122 dispose(); |
123 #endif | 123 #endif |
124 } | 124 } |
125 | 125 |
126 void CSSCrossfadeValue::dispose() | 126 void CSSCrossfadeValue::dispose() |
127 { | 127 { |
128 if (m_cachedFromImage) { | 128 if (m_cachedFromImage) { |
129 m_cachedFromImage->removeClient(&m_crossfadeSubimageObserver); | 129 m_cachedFromImage->removeObserver(&m_crossfadeSubimageObserver); |
130 m_cachedFromImage = nullptr; | 130 m_cachedFromImage = nullptr; |
131 } | 131 } |
132 if (m_cachedToImage) { | 132 if (m_cachedToImage) { |
133 m_cachedToImage->removeClient(&m_crossfadeSubimageObserver); | 133 m_cachedToImage->removeObserver(&m_crossfadeSubimageObserver); |
134 m_cachedToImage = nullptr; | 134 m_cachedToImage = nullptr; |
135 } | 135 } |
136 } | 136 } |
137 | 137 |
138 String CSSCrossfadeValue::customCSSText() const | 138 String CSSCrossfadeValue::customCSSText() const |
139 { | 139 { |
140 StringBuilder result; | 140 StringBuilder result; |
141 result.appendLiteral("-webkit-cross-fade("); | 141 result.appendLiteral("-webkit-cross-fade("); |
142 result.append(m_fromValue->cssText()); | 142 result.append(m_fromValue->cssText()); |
143 result.appendLiteral(", "); | 143 result.appendLiteral(", "); |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 void CSSCrossfadeValue::loadSubimages(Document* document) | 201 void CSSCrossfadeValue::loadSubimages(Document* document) |
202 { | 202 { |
203 RefPtrWillBeRawPtr<ImageResource> oldCachedFromImage = m_cachedFromImage; | 203 RefPtrWillBeRawPtr<ImageResource> oldCachedFromImage = m_cachedFromImage; |
204 RefPtrWillBeRawPtr<ImageResource> oldCachedToImage = m_cachedToImage; | 204 RefPtrWillBeRawPtr<ImageResource> oldCachedToImage = m_cachedToImage; |
205 | 205 |
206 m_cachedFromImage = cachedImageForCSSValue(m_fromValue.get(), document); | 206 m_cachedFromImage = cachedImageForCSSValue(m_fromValue.get(), document); |
207 m_cachedToImage = cachedImageForCSSValue(m_toValue.get(), document); | 207 m_cachedToImage = cachedImageForCSSValue(m_toValue.get(), document); |
208 | 208 |
209 if (m_cachedFromImage != oldCachedFromImage) { | 209 if (m_cachedFromImage != oldCachedFromImage) { |
210 if (oldCachedFromImage) | 210 if (oldCachedFromImage) |
211 oldCachedFromImage->removeClient(&m_crossfadeSubimageObserver); | 211 oldCachedFromImage->removeObserver(&m_crossfadeSubimageObserver); |
212 if (m_cachedFromImage) | 212 if (m_cachedFromImage) |
213 m_cachedFromImage->addClient(&m_crossfadeSubimageObserver); | 213 m_cachedFromImage->addObserver(&m_crossfadeSubimageObserver); |
214 } | 214 } |
215 | 215 |
216 if (m_cachedToImage != oldCachedToImage) { | 216 if (m_cachedToImage != oldCachedToImage) { |
217 if (oldCachedToImage) | 217 if (oldCachedToImage) |
218 oldCachedToImage->removeClient(&m_crossfadeSubimageObserver); | 218 oldCachedToImage->removeObserver(&m_crossfadeSubimageObserver); |
219 if (m_cachedToImage) | 219 if (m_cachedToImage) |
220 m_cachedToImage->addClient(&m_crossfadeSubimageObserver); | 220 m_cachedToImage->addObserver(&m_crossfadeSubimageObserver); |
221 } | 221 } |
222 | 222 |
223 m_crossfadeSubimageObserver.setReady(true); | 223 m_crossfadeSubimageObserver.setReady(true); |
224 } | 224 } |
225 | 225 |
226 PassRefPtr<Image> CSSCrossfadeValue::image(const LayoutObject& layoutObject, con
st IntSize& size) | 226 PassRefPtr<Image> CSSCrossfadeValue::image(const LayoutObject& layoutObject, con
st IntSize& size) |
227 { | 227 { |
228 if (size.isEmpty()) | 228 if (size.isEmpty()) |
229 return nullptr; | 229 return nullptr; |
230 | 230 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 visitor->trace(m_fromValue); | 281 visitor->trace(m_fromValue); |
282 visitor->trace(m_toValue); | 282 visitor->trace(m_toValue); |
283 visitor->trace(m_percentageValue); | 283 visitor->trace(m_percentageValue); |
284 visitor->trace(m_cachedFromImage); | 284 visitor->trace(m_cachedFromImage); |
285 visitor->trace(m_cachedToImage); | 285 visitor->trace(m_cachedToImage); |
286 visitor->trace(m_crossfadeSubimageObserver); | 286 visitor->trace(m_crossfadeSubimageObserver); |
287 CSSImageGeneratorValue::traceAfterDispatch(visitor); | 287 CSSImageGeneratorValue::traceAfterDispatch(visitor); |
288 } | 288 } |
289 | 289 |
290 } // namespace blink | 290 } // namespace blink |
OLD | NEW |