| OLD | NEW |
| 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 | 59 |
| 60 static PassRefPtr<ShapeValue> createImageValue(PassRefPtr<StyleImage> image) | 60 static PassRefPtr<ShapeValue> createImageValue(PassRefPtr<StyleImage> image) |
| 61 { | 61 { |
| 62 return adoptRef(new ShapeValue(image)); | 62 return adoptRef(new ShapeValue(image)); |
| 63 } | 63 } |
| 64 | 64 |
| 65 ShapeValueType type() const { return m_type; } | 65 ShapeValueType type() const { return m_type; } |
| 66 BasicShape* shape() const { return m_shape.get(); } | 66 BasicShape* shape() const { return m_shape.get(); } |
| 67 | 67 |
| 68 StyleImage* image() const { return m_image.get(); } | 68 StyleImage* image() const { return m_image.get(); } |
| 69 bool isImageValid() const { return image() && image()->cachedImage() && imag
e()->cachedImage()->hasImage(); } | 69 bool isImageValid() const |
| 70 { |
| 71 if (!image()) |
| 72 return false; |
| 73 if (image()->isImageResource() || image()->isImageResourceSet()) |
| 74 return image()->cachedImage() && image()->cachedImage()->hasImage(); |
| 75 return image()->isGeneratedImage(); |
| 76 } |
| 70 void setImage(PassRefPtr<StyleImage> image) | 77 void setImage(PassRefPtr<StyleImage> image) |
| 71 { | 78 { |
| 72 ASSERT(type() == Image); | 79 ASSERT(type() == Image); |
| 73 if (m_image != image) | 80 if (m_image != image) |
| 74 m_image = image; | 81 m_image = image; |
| 75 } | 82 } |
| 76 CSSBoxType cssBox() const { return m_cssBox; } | 83 CSSBoxType cssBox() const { return m_cssBox; } |
| 77 | 84 |
| 78 bool operator==(const ShapeValue& other) const; | 85 bool operator==(const ShapeValue& other) const; |
| 79 | 86 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 return image() == other.image(); | 129 return image() == other.image(); |
| 123 } | 130 } |
| 124 | 131 |
| 125 ASSERT_NOT_REACHED(); | 132 ASSERT_NOT_REACHED(); |
| 126 return false; | 133 return false; |
| 127 } | 134 } |
| 128 | 135 |
| 129 } | 136 } |
| 130 | 137 |
| 131 #endif | 138 #endif |
| OLD | NEW |