Index: Source/core/rendering/style/ExclusionShapeValue.h |
diff --git a/Source/core/rendering/style/ExclusionShapeValue.h b/Source/core/rendering/style/ExclusionShapeValue.h |
index 874ad3ccdd8cab85c427e2bae3791d313f2b8789..c7ee9fa5cd63722d6626517ec661b9d716a4a53f 100644 |
--- a/Source/core/rendering/style/ExclusionShapeValue.h |
+++ b/Source/core/rendering/style/ExclusionShapeValue.h |
@@ -31,16 +31,18 @@ |
#define ExclusionShapeValue_h |
#include "core/rendering/style/BasicShapes.h" |
-#include <wtf/PassRefPtr.h> |
+#include "core/rendering/style/StyleImage.h" |
+#include "wtf/PassRefPtr.h" |
namespace WebCore { |
class ExclusionShapeValue : public RefCounted<ExclusionShapeValue> { |
public: |
enum ExclusionShapeValueType { |
- // The AUTO value is defined by a null ExclusionShapeValue* |
- SHAPE, |
- OUTSIDE |
+ // The Auto value is defined by a null ExclusionShapeValue* |
+ Shape, |
+ Outside, |
+ Image |
}; |
static PassRefPtr<ExclusionShapeValue> createShapeValue(PassRefPtr<BasicShape> shape) |
@@ -50,18 +52,42 @@ public: |
static PassRefPtr<ExclusionShapeValue> createOutsideValue() |
{ |
- return adoptRef(new ExclusionShapeValue(OUTSIDE)); |
+ return adoptRef(new ExclusionShapeValue(Outside)); |
+ } |
+ |
+ static PassRefPtr<ExclusionShapeValue> createImageValue(PassRefPtr<StyleImage> image) |
+ { |
+ return adoptRef(new ExclusionShapeValue(image)); |
} |
ExclusionShapeValueType type() const { return m_type; } |
BasicShape* shape() const { return m_shape.get(); } |
+ StyleImage* image() const { return m_image.get(); } |
+ void setImage(PassRefPtr<StyleImage> image) |
+ { |
+ if (m_image != image) |
eseidel
2013/06/04 18:10:36
Why bother avoiding?
|
+ m_image = image; |
+ } |
bool operator==(const ExclusionShapeValue& other) const { return type() == other.type(); } |
private: |
- ExclusionShapeValue(PassRefPtr<BasicShape> shape) : m_type(SHAPE), m_shape(shape) { } |
- ExclusionShapeValue(ExclusionShapeValueType type) : m_type(type) { } |
+ ExclusionShapeValue(PassRefPtr<BasicShape> shape) |
+ : m_type(Shape) |
+ , m_shape(shape) |
+ { |
+ } |
+ ExclusionShapeValue(ExclusionShapeValueType type) |
+ : m_type(type) |
+ { |
+ } |
+ ExclusionShapeValue(PassRefPtr<StyleImage> image) |
+ : m_type(Image) |
+ , m_image(image) |
+ { |
+ } |
ExclusionShapeValueType m_type; |
RefPtr<BasicShape> m_shape; |
+ RefPtr<StyleImage> m_image; |
}; |
} |