| 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 19 matching lines...) Expand all Loading... |
| 30 #include "core/layout/LayoutObject.h" | 30 #include "core/layout/LayoutObject.h" |
| 31 #include "core/style/StyleFetchedImage.h" | 31 #include "core/style/StyleFetchedImage.h" |
| 32 #include "platform/graphics/CrossfadeGeneratedImage.h" | 32 #include "platform/graphics/CrossfadeGeneratedImage.h" |
| 33 #include "wtf/text/StringBuilder.h" | 33 #include "wtf/text/StringBuilder.h" |
| 34 | 34 |
| 35 namespace blink { | 35 namespace blink { |
| 36 | 36 |
| 37 static bool subimageIsPending(CSSValue* value) | 37 static bool subimageIsPending(CSSValue* value) |
| 38 { | 38 { |
| 39 if (value->isImageValue()) | 39 if (value->isImageValue()) |
| 40 return toCSSImageValue(value)->cachedOrPendingImage()->isPendingImage(); | 40 return toCSSImageValue(value)->isCachePending(); |
| 41 | 41 |
| 42 if (value->isImageGeneratorValue()) | 42 if (value->isImageGeneratorValue()) |
| 43 return toCSSImageGeneratorValue(value)->isPending(); | 43 return toCSSImageGeneratorValue(value)->isPending(); |
| 44 | 44 |
| 45 ASSERT_NOT_REACHED(); | 45 ASSERT_NOT_REACHED(); |
| 46 | 46 |
| 47 return false; | 47 return false; |
| 48 } | 48 } |
| 49 | 49 |
| 50 static bool subimageKnownToBeOpaque(CSSValue* value, const LayoutObject* layoutO
bject) | 50 static bool subimageKnownToBeOpaque(CSSValue* value, const LayoutObject* layoutO
bject) |
| 51 { | 51 { |
| 52 if (value->isImageValue()) | 52 if (value->isImageValue()) |
| 53 return toCSSImageValue(value)->knownToBeOpaque(layoutObject); | 53 return toCSSImageValue(value)->knownToBeOpaque(layoutObject); |
| 54 | 54 |
| 55 if (value->isImageGeneratorValue()) | 55 if (value->isImageGeneratorValue()) |
| 56 return toCSSImageGeneratorValue(value)->knownToBeOpaque(layoutObject); | 56 return toCSSImageGeneratorValue(value)->knownToBeOpaque(layoutObject); |
| 57 | 57 |
| 58 ASSERT_NOT_REACHED(); | 58 ASSERT_NOT_REACHED(); |
| 59 | 59 |
| 60 return false; | 60 return false; |
| 61 } | 61 } |
| 62 | 62 |
| 63 static ImageResource* cachedImageForCSSValue(CSSValue* value, Document* document
) | 63 static ImageResource* cachedImageForCSSValue(CSSValue* value, Document* document
) |
| 64 { | 64 { |
| 65 if (!value) | 65 if (!value) |
| 66 return nullptr; | 66 return nullptr; |
| 67 | 67 |
| 68 if (value->isImageValue()) { | 68 if (value->isImageValue()) { |
| 69 StyleFetchedImage* styleImageResource = toCSSImageValue(value)->cachedIm
age(document); | 69 StyleFetchedImage* styleImageResource = toCSSImageValue(value)->cacheIma
ge(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 gradi
ents and canvas). | 78 // FIXME: Handle CSSImageGeneratorValue (and thus cross-fades with gradi
ents and canvas). |
| 79 return nullptr; | 79 return nullptr; |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 DEFINE_TRACE_AFTER_DISPATCH(CSSCrossfadeValue) | 235 DEFINE_TRACE_AFTER_DISPATCH(CSSCrossfadeValue) |
| 236 { | 236 { |
| 237 visitor->trace(m_fromValue); | 237 visitor->trace(m_fromValue); |
| 238 visitor->trace(m_toValue); | 238 visitor->trace(m_toValue); |
| 239 visitor->trace(m_percentageValue); | 239 visitor->trace(m_percentageValue); |
| 240 visitor->trace(m_crossfadeSubimageObserver); | 240 visitor->trace(m_crossfadeSubimageObserver); |
| 241 CSSImageGeneratorValue::traceAfterDispatch(visitor); | 241 CSSImageGeneratorValue::traceAfterDispatch(visitor); |
| 242 } | 242 } |
| 243 | 243 |
| 244 } // namespace blink | 244 } // namespace blink |
| OLD | NEW |