| 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 11 matching lines...) Expand all Loading... |
| 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 24 */ | 24 */ |
| 25 | 25 |
| 26 #ifndef CSSCrossfadeValue_h | 26 #ifndef CSSCrossfadeValue_h |
| 27 #define CSSCrossfadeValue_h | 27 #define CSSCrossfadeValue_h |
| 28 | 28 |
| 29 #include "core/CoreExport.h" | 29 #include "core/CoreExport.h" |
| 30 #include "core/css/CSSImageGeneratorValue.h" | 30 #include "core/css/CSSImageGeneratorValue.h" |
| 31 #include "core/css/CSSPrimitiveValue.h" | 31 #include "core/css/CSSPrimitiveValue.h" |
| 32 #include "core/fetch/ImageResource.h" | 32 #include "core/fetch/ImageResourceContent.h" |
| 33 #include "core/fetch/ImageResourceObserver.h" | 33 #include "core/fetch/ImageResourceObserver.h" |
| 34 #include "platform/graphics/Image.h" | 34 #include "platform/graphics/Image.h" |
| 35 | 35 |
| 36 namespace blink { | 36 namespace blink { |
| 37 | 37 |
| 38 class ImageResource; | |
| 39 class CrossfadeSubimageObserverProxy; | 38 class CrossfadeSubimageObserverProxy; |
| 40 class LayoutObject; | 39 class LayoutObject; |
| 41 | 40 |
| 42 class CORE_EXPORT CSSCrossfadeValue final : public CSSImageGeneratorValue { | 41 class CORE_EXPORT CSSCrossfadeValue final : public CSSImageGeneratorValue { |
| 43 friend class CrossfadeSubimageObserverProxy; | 42 friend class CrossfadeSubimageObserverProxy; |
| 44 USING_PRE_FINALIZER(CSSCrossfadeValue, dispose); | 43 USING_PRE_FINALIZER(CSSCrossfadeValue, dispose); |
| 45 | 44 |
| 46 public: | 45 public: |
| 47 static CSSCrossfadeValue* create(CSSValue* fromValue, | 46 static CSSCrossfadeValue* create(CSSValue* fromValue, |
| 48 CSSValue* toValue, | 47 CSSValue* toValue, |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 class CrossfadeSubimageObserverProxy final : public ImageResourceObserver { | 80 class CrossfadeSubimageObserverProxy final : public ImageResourceObserver { |
| 82 DISALLOW_NEW(); | 81 DISALLOW_NEW(); |
| 83 | 82 |
| 84 public: | 83 public: |
| 85 explicit CrossfadeSubimageObserverProxy(CSSCrossfadeValue* ownerValue) | 84 explicit CrossfadeSubimageObserverProxy(CSSCrossfadeValue* ownerValue) |
| 86 : m_ownerValue(ownerValue), m_ready(false) {} | 85 : m_ownerValue(ownerValue), m_ready(false) {} |
| 87 | 86 |
| 88 ~CrossfadeSubimageObserverProxy() override {} | 87 ~CrossfadeSubimageObserverProxy() override {} |
| 89 DEFINE_INLINE_TRACE() { visitor->trace(m_ownerValue); } | 88 DEFINE_INLINE_TRACE() { visitor->trace(m_ownerValue); } |
| 90 | 89 |
| 91 void imageChanged(ImageResource*, const IntRect* = nullptr) override; | 90 void imageChanged(ImageResourceContent*, const IntRect* = nullptr) override; |
| 92 bool willRenderImage() override; | 91 bool willRenderImage() override; |
| 93 String debugName() const override { | 92 String debugName() const override { |
| 94 return "CrossfadeSubimageObserverProxy"; | 93 return "CrossfadeSubimageObserverProxy"; |
| 95 } | 94 } |
| 96 void setReady(bool ready) { m_ready = ready; } | 95 void setReady(bool ready) { m_ready = ready; } |
| 97 | 96 |
| 98 private: | 97 private: |
| 99 Member<CSSCrossfadeValue> m_ownerValue; | 98 Member<CSSCrossfadeValue> m_ownerValue; |
| 100 bool m_ready; | 99 bool m_ready; |
| 101 }; | 100 }; |
| 102 | 101 |
| 103 bool willRenderImage() const; | 102 bool willRenderImage() const; |
| 104 void crossfadeChanged(const IntRect&); | 103 void crossfadeChanged(const IntRect&); |
| 105 | 104 |
| 106 Member<CSSValue> m_fromValue; | 105 Member<CSSValue> m_fromValue; |
| 107 Member<CSSValue> m_toValue; | 106 Member<CSSValue> m_toValue; |
| 108 Member<CSSPrimitiveValue> m_percentageValue; | 107 Member<CSSPrimitiveValue> m_percentageValue; |
| 109 | 108 |
| 110 Member<ImageResource> m_cachedFromImage; | 109 Member<ImageResourceContent> m_cachedFromImage; |
| 111 Member<ImageResource> m_cachedToImage; | 110 Member<ImageResourceContent> m_cachedToImage; |
| 112 | 111 |
| 113 CrossfadeSubimageObserverProxy m_crossfadeSubimageObserver; | 112 CrossfadeSubimageObserverProxy m_crossfadeSubimageObserver; |
| 114 }; | 113 }; |
| 115 | 114 |
| 116 DEFINE_CSS_VALUE_TYPE_CASTS(CSSCrossfadeValue, isCrossfadeValue()); | 115 DEFINE_CSS_VALUE_TYPE_CASTS(CSSCrossfadeValue, isCrossfadeValue()); |
| 117 | 116 |
| 118 } // namespace blink | 117 } // namespace blink |
| 119 | 118 |
| 120 #endif // CSSCrossfadeValue_h | 119 #endif // CSSCrossfadeValue_h |
| OLD | NEW |