| 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 23 matching lines...) Expand all Loading... |
| 34 | 34 |
| 35 namespace blink { | 35 namespace blink { |
| 36 | 36 |
| 37 static bool subimageIsPending(CSSValue* value) { | 37 static bool subimageIsPending(CSSValue* value) { |
| 38 if (value->isImageValue()) | 38 if (value->isImageValue()) |
| 39 return toCSSImageValue(value)->isCachePending(); | 39 return toCSSImageValue(value)->isCachePending(); |
| 40 | 40 |
| 41 if (value->isImageGeneratorValue()) | 41 if (value->isImageGeneratorValue()) |
| 42 return toCSSImageGeneratorValue(value)->isPending(); | 42 return toCSSImageGeneratorValue(value)->isPending(); |
| 43 | 43 |
| 44 ASSERT_NOT_REACHED(); | 44 NOTREACHED(); |
| 45 | 45 |
| 46 return false; | 46 return false; |
| 47 } | 47 } |
| 48 | 48 |
| 49 static bool subimageKnownToBeOpaque(CSSValue* value, | 49 static bool subimageKnownToBeOpaque(CSSValue* value, |
| 50 const LayoutObject& layoutObject) { | 50 const LayoutObject& layoutObject) { |
| 51 if (value->isImageValue()) | 51 if (value->isImageValue()) |
| 52 return toCSSImageValue(value)->knownToBeOpaque(layoutObject); | 52 return toCSSImageValue(value)->knownToBeOpaque(layoutObject); |
| 53 | 53 |
| 54 if (value->isImageGeneratorValue()) | 54 if (value->isImageGeneratorValue()) |
| 55 return toCSSImageGeneratorValue(value)->knownToBeOpaque(layoutObject); | 55 return toCSSImageGeneratorValue(value)->knownToBeOpaque(layoutObject); |
| 56 | 56 |
| 57 ASSERT_NOT_REACHED(); | 57 NOTREACHED(); |
| 58 | 58 |
| 59 return false; | 59 return false; |
| 60 } | 60 } |
| 61 | 61 |
| 62 static ImageResourceContent* cachedImageForCSSValue(CSSValue* value, | 62 static ImageResourceContent* cachedImageForCSSValue(CSSValue* value, |
| 63 const Document& document) { | 63 const Document& document) { |
| 64 if (!value) | 64 if (!value) |
| 65 return nullptr; | 65 return nullptr; |
| 66 | 66 |
| 67 if (value->isImageValue()) { | 67 if (value->isImageValue()) { |
| 68 StyleImage* styleImageResource = | 68 StyleImage* styleImageResource = |
| 69 toCSSImageValue(value)->cacheImage(document); | 69 toCSSImageValue(value)->cacheImage(document); |
| 70 if (!styleImageResource) | 70 if (!styleImageResource) |
| 71 return nullptr; | 71 return nullptr; |
| 72 | 72 |
| 73 return styleImageResource->cachedImage(); | 73 return styleImageResource->cachedImage(); |
| 74 } | 74 } |
| 75 | 75 |
| 76 if (value->isImageGeneratorValue()) { | 76 if (value->isImageGeneratorValue()) { |
| 77 toCSSImageGeneratorValue(value)->loadSubimages(document); | 77 toCSSImageGeneratorValue(value)->loadSubimages(document); |
| 78 // FIXME: Handle CSSImageGeneratorValue (and thus cross-fades with gradients | 78 // FIXME: Handle CSSImageGeneratorValue (and thus cross-fades with gradients |
| 79 // and canvas). | 79 // and canvas). |
| 80 return nullptr; | 80 return nullptr; |
| 81 } | 81 } |
| 82 | 82 |
| 83 ASSERT_NOT_REACHED(); | 83 NOTREACHED(); |
| 84 | 84 |
| 85 return nullptr; | 85 return nullptr; |
| 86 } | 86 } |
| 87 | 87 |
| 88 static Image* renderableImageForCSSValue(CSSValue* value, | 88 static Image* renderableImageForCSSValue(CSSValue* value, |
| 89 const LayoutObject& layoutObject) { | 89 const LayoutObject& layoutObject) { |
| 90 ImageResourceContent* cachedImage = | 90 ImageResourceContent* cachedImage = |
| 91 cachedImageForCSSValue(value, layoutObject.document()); | 91 cachedImageForCSSValue(value, layoutObject.document()); |
| 92 | 92 |
| 93 if (!cachedImage || cachedImage->errorOccurred() || | 93 if (!cachedImage || cachedImage->errorOccurred() || |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 visitor->trace(m_fromValue); | 295 visitor->trace(m_fromValue); |
| 296 visitor->trace(m_toValue); | 296 visitor->trace(m_toValue); |
| 297 visitor->trace(m_percentageValue); | 297 visitor->trace(m_percentageValue); |
| 298 visitor->trace(m_cachedFromImage); | 298 visitor->trace(m_cachedFromImage); |
| 299 visitor->trace(m_cachedToImage); | 299 visitor->trace(m_cachedToImage); |
| 300 visitor->trace(m_crossfadeSubimageObserver); | 300 visitor->trace(m_crossfadeSubimageObserver); |
| 301 CSSImageGeneratorValue::traceAfterDispatch(visitor); | 301 CSSImageGeneratorValue::traceAfterDispatch(visitor); |
| 302 } | 302 } |
| 303 | 303 |
| 304 } // namespace blink | 304 } // namespace blink |
| OLD | NEW |