OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CSSStyleImageValue_h | 5 #ifndef CSSStyleImageValue_h |
6 #define CSSStyleImageValue_h | 6 #define CSSStyleImageValue_h |
7 | 7 |
8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
9 #include "core/css/CSSImageValue.h" | 9 #include "core/css/CSSImageValue.h" |
10 #include "core/css/CSSImageValue.h" | 10 #include "core/css/CSSImageValue.h" |
11 #include "core/css/cssom/CSSResourceValue.h" | 11 #include "core/css/cssom/CSSResourceValue.h" |
12 #include "core/css/cssom/CSSStyleValue.h" | 12 #include "core/css/cssom/CSSStyleValue.h" |
13 #include "core/fetch/ImageResource.h" | 13 #include "core/fetch/ImageResourceContent.h" |
14 #include "core/html/canvas/CanvasImageSource.h" | 14 #include "core/html/canvas/CanvasImageSource.h" |
15 #include "core/imagebitmap/ImageBitmapSource.h" | 15 #include "core/imagebitmap/ImageBitmapSource.h" |
16 #include "core/style/StyleImage.h" | 16 #include "core/style/StyleImage.h" |
17 | 17 |
18 namespace blink { | 18 namespace blink { |
19 | 19 |
20 class CORE_EXPORT CSSStyleImageValue : public CSSResourceValue, | 20 class CORE_EXPORT CSSStyleImageValue : public CSSResourceValue, |
21 public CanvasImageSource { | 21 public CanvasImageSource { |
22 WTF_MAKE_NONCOPYABLE(CSSStyleImageValue); | 22 WTF_MAKE_NONCOPYABLE(CSSStyleImageValue); |
23 DEFINE_WRAPPERTYPEINFO(); | 23 DEFINE_WRAPPERTYPEINFO(); |
(...skipping 26 matching lines...) Expand all Loading... |
50 CSSResourceValue::trace(visitor); | 50 CSSResourceValue::trace(visitor); |
51 } | 51 } |
52 | 52 |
53 protected: | 53 protected: |
54 CSSStyleImageValue(const CSSImageValue* imageValue) | 54 CSSStyleImageValue(const CSSImageValue* imageValue) |
55 : m_imageValue(imageValue) {} | 55 : m_imageValue(imageValue) {} |
56 | 56 |
57 virtual LayoutSize imageLayoutSize() const { | 57 virtual LayoutSize imageLayoutSize() const { |
58 DCHECK(!isCachePending()); | 58 DCHECK(!isCachePending()); |
59 return m_imageValue->cachedImage()->cachedImage()->imageSize( | 59 return m_imageValue->cachedImage()->cachedImage()->imageSize( |
60 DoNotRespectImageOrientation, 1, ImageResource::IntrinsicSize); | 60 DoNotRespectImageOrientation, 1, ImageResourceContent::IntrinsicSize); |
61 } | 61 } |
62 | 62 |
63 virtual bool isCachePending() const { return m_imageValue->isCachePending(); } | 63 virtual bool isCachePending() const { return m_imageValue->isCachePending(); } |
64 | 64 |
65 Resource::Status status() const override { | 65 Resource::Status status() const override { |
66 if (isCachePending()) | 66 if (isCachePending()) |
67 return Resource::Status::NotStarted; | 67 return Resource::Status::NotStarted; |
68 return m_imageValue->cachedImage()->cachedImage()->getStatus(); | 68 return m_imageValue->cachedImage()->cachedImage()->getStatus(); |
69 } | 69 } |
70 | 70 |
71 const CSSImageValue* cssImageValue() const { return m_imageValue.get(); }; | 71 const CSSImageValue* cssImageValue() const { return m_imageValue.get(); }; |
72 | 72 |
73 private: | 73 private: |
74 PassRefPtr<Image> image() const; | 74 PassRefPtr<Image> image() const; |
75 | 75 |
76 Member<const CSSImageValue> m_imageValue; | 76 Member<const CSSImageValue> m_imageValue; |
77 }; | 77 }; |
78 | 78 |
79 } // namespace blink | 79 } // namespace blink |
80 | 80 |
81 #endif // CSSResourceValue_h | 81 #endif // CSSResourceValue_h |
OLD | NEW |