| 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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 } | 160 } |
| 161 | 161 |
| 162 IntSize CSSCrossfadeValue::fixedSize(const LayoutObject* layoutObject) | 162 IntSize CSSCrossfadeValue::fixedSize(const LayoutObject* layoutObject) |
| 163 { | 163 { |
| 164 Image* fromImage = renderableImageForCSSValue(m_fromValue.get(), layoutObjec
t); | 164 Image* fromImage = renderableImageForCSSValue(m_fromValue.get(), layoutObjec
t); |
| 165 Image* toImage = renderableImageForCSSValue(m_toValue.get(), layoutObject); | 165 Image* toImage = renderableImageForCSSValue(m_toValue.get(), layoutObject); |
| 166 | 166 |
| 167 if (!fromImage || !toImage) | 167 if (!fromImage || !toImage) |
| 168 return IntSize(); | 168 return IntSize(); |
| 169 | 169 |
| 170 IntSize fromImageSize = fromImage->size(); | 170 IntSize fromImageSize = fromImage->defaultConcreteObjectSize(); |
| 171 IntSize toImageSize = toImage->size(); | 171 IntSize toImageSize = toImage->defaultConcreteObjectSize(); |
| 172 | 172 |
| 173 // Rounding issues can cause transitions between images of equal size to ret
urn | 173 // Rounding issues can cause transitions between images of equal size to ret
urn |
| 174 // a different fixed size; avoid performing the interpolation if the images
are the same size. | 174 // a different fixed size; avoid performing the interpolation if the images
are the same size. |
| 175 if (fromImageSize == toImageSize) | 175 if (fromImageSize == toImageSize) |
| 176 return fromImageSize; | 176 return fromImageSize; |
| 177 | 177 |
| 178 float percentage = m_percentageValue->getFloatValue(); | 178 float percentage = m_percentageValue->getFloatValue(); |
| 179 float inversePercentage = 1 - percentage; | 179 float inversePercentage = 1 - percentage; |
| 180 | 180 |
| 181 return IntSize(fromImageSize.width() * inversePercentage + toImageSize.width
() * percentage, | 181 return IntSize(fromImageSize.width() * inversePercentage + toImageSize.width
() * percentage, |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 visitor->trace(m_fromValue); | 277 visitor->trace(m_fromValue); |
| 278 visitor->trace(m_toValue); | 278 visitor->trace(m_toValue); |
| 279 visitor->trace(m_percentageValue); | 279 visitor->trace(m_percentageValue); |
| 280 visitor->trace(m_cachedFromImage); | 280 visitor->trace(m_cachedFromImage); |
| 281 visitor->trace(m_cachedToImage); | 281 visitor->trace(m_cachedToImage); |
| 282 visitor->trace(m_crossfadeSubimageObserver); | 282 visitor->trace(m_crossfadeSubimageObserver); |
| 283 CSSImageGeneratorValue::traceAfterDispatch(visitor); | 283 CSSImageGeneratorValue::traceAfterDispatch(visitor); |
| 284 } | 284 } |
| 285 | 285 |
| 286 } // namespace blink | 286 } // namespace blink |
| OLD | NEW |