Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(127)

Side by Side Diff: sky/engine/core/rendering/style/ShapeValue.h

Issue 1228463002: Remove RenderImage (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. 2 * Copyright (C) 2012 Adobe Systems Incorporated. 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 * 7 *
8 * 1. Redistributions of source code must retain the above 8 * 1. Redistributions of source code must retain the above
9 * copyright notice, this list of conditions and the following 9 * copyright notice, this list of conditions and the following
10 * disclaimer. 10 * disclaimer.
(...skipping 12 matching lines...) Expand all
23 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
25 * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 25 * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
26 * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE. 27 * SUCH DAMAGE.
28 */ 28 */
29 29
30 #ifndef SKY_ENGINE_CORE_RENDERING_STYLE_SHAPEVALUE_H_ 30 #ifndef SKY_ENGINE_CORE_RENDERING_STYLE_SHAPEVALUE_H_
31 #define SKY_ENGINE_CORE_RENDERING_STYLE_SHAPEVALUE_H_ 31 #define SKY_ENGINE_CORE_RENDERING_STYLE_SHAPEVALUE_H_
32 32
33 #include "sky/engine/core/fetch/ImageResource.h"
34 #include "sky/engine/core/rendering/style/BasicShapes.h" 33 #include "sky/engine/core/rendering/style/BasicShapes.h"
35 #include "sky/engine/core/rendering/style/RenderStyleConstants.h" 34 #include "sky/engine/core/rendering/style/RenderStyleConstants.h"
36 #include "sky/engine/core/rendering/style/StyleImage.h" 35 #include "sky/engine/core/rendering/style/StyleImage.h"
37 #include "sky/engine/wtf/PassRefPtr.h" 36 #include "sky/engine/wtf/PassRefPtr.h"
38 37
39 namespace blink { 38 namespace blink {
40 39
41 class ShapeValue : public RefCounted<ShapeValue> { 40 class ShapeValue : public RefCounted<ShapeValue> {
42 public: 41 public:
43 enum ShapeValueType { 42 enum ShapeValueType {
(...skipping 19 matching lines...) Expand all
63 } 62 }
64 63
65 ShapeValueType type() const { return m_type; } 64 ShapeValueType type() const { return m_type; }
66 BasicShape* shape() const { return m_shape.get(); } 65 BasicShape* shape() const { return m_shape.get(); }
67 66
68 StyleImage* image() const { return m_image.get(); } 67 StyleImage* image() const { return m_image.get(); }
69 bool isImageValid() const 68 bool isImageValid() const
70 { 69 {
71 if (!image()) 70 if (!image())
72 return false; 71 return false;
73 if (image()->isImageResource() || image()->isImageResourceSet())
74 return image()->cachedImage() && image()->cachedImage()->hasImage();
75 return image()->isGeneratedImage(); 72 return image()->isGeneratedImage();
76 } 73 }
77 void setImage(PassRefPtr<StyleImage> image) 74 void setImage(PassRefPtr<StyleImage> image)
78 { 75 {
79 ASSERT(type() == Image); 76 ASSERT(type() == Image);
80 if (m_image != image) 77 if (m_image != image)
81 m_image = image; 78 m_image = image;
82 } 79 }
83 CSSBoxType cssBox() const { return m_cssBox; } 80 CSSBoxType cssBox() const { return m_cssBox; }
84 81
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 return image() == other.image(); 126 return image() == other.image();
130 } 127 }
131 128
132 ASSERT_NOT_REACHED(); 129 ASSERT_NOT_REACHED();
133 return false; 130 return false;
134 } 131 }
135 132
136 } 133 }
137 134
138 #endif // SKY_ENGINE_CORE_RENDERING_STYLE_SHAPEVALUE_H_ 135 #endif // SKY_ENGINE_CORE_RENDERING_STYLE_SHAPEVALUE_H_
OLDNEW
« no previous file with comments | « sky/engine/core/rendering/RenderReplaced.cpp ('k') | sky/engine/core/rendering/style/StyleImage.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698