diff options
Diffstat (limited to 'Source/WebCore/rendering/style/StyleImage.h')
| -rw-r--r-- | Source/WebCore/rendering/style/StyleImage.h | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/Source/WebCore/rendering/style/StyleImage.h b/Source/WebCore/rendering/style/StyleImage.h index 0e83f2e96..a0bd45a6f 100644 --- a/Source/WebCore/rendering/style/StyleImage.h +++ b/Source/WebCore/rendering/style/StyleImage.h @@ -25,12 +25,12 @@ #define StyleImage_h #include "CSSValue.h" -#include "FloatSize.h" #include "Image.h" +#include "IntSize.h" +#include "LayoutSize.h" #include <wtf/PassRefPtr.h> #include <wtf/RefCounted.h> #include <wtf/RefPtr.h> -#include <wtf/TypeCasts.h> namespace WebCore { @@ -55,15 +55,15 @@ public: virtual bool canRender(const RenderObject*, float /*multiplier*/) const { return true; } virtual bool isLoaded() const { return true; } virtual bool errorOccurred() const { return false; } - virtual FloatSize imageSize(const RenderElement*, float multiplier) const = 0; + virtual LayoutSize imageSize(const RenderElement*, float multiplier) const = 0; virtual void computeIntrinsicDimensions(const RenderElement*, Length& intrinsicWidth, Length& intrinsicHeight, FloatSize& intrinsicRatio) = 0; virtual bool imageHasRelativeWidth() const = 0; virtual bool imageHasRelativeHeight() const = 0; virtual bool usesImageContainerSize() const = 0; - virtual void setContainerSizeForRenderer(const RenderElement*, const FloatSize&, float) = 0; + virtual void setContainerSizeForRenderer(const RenderElement*, const IntSize&, float) = 0; virtual void addClient(RenderElement*) = 0; virtual void removeClient(RenderElement*) = 0; - virtual RefPtr<Image> image(RenderElement*, const FloatSize&) const = 0; + virtual PassRefPtr<Image> image(RenderElement*, const IntSize&) const = 0; virtual WrappedImagePtr data() const = 0; virtual float imageScaleFactor() const { return 1; } virtual bool knownToBeOpaque(const RenderElement*) const = 0; @@ -74,6 +74,11 @@ public: ALWAYS_INLINE bool isGeneratedImage() const { return m_isGeneratedImage; } ALWAYS_INLINE bool isCachedImageSet() const { return m_isCachedImageSet; } + static bool imagesEquivalent(StyleImage* image1, StyleImage* image2) + { + return image1 == image2 || (image1 && image2 && *image1 == *image2); + } + protected: StyleImage() : m_isCachedImage(false) @@ -88,11 +93,5 @@ protected: bool m_isCachedImageSet : 1; }; -} // namespace WebCore - -#define SPECIALIZE_TYPE_TRAITS_STYLE_IMAGE(ToClassName, predicate) \ -SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::ToClassName) \ - static bool isType(const WebCore::StyleImage& image) { return image.predicate(); } \ -SPECIALIZE_TYPE_TRAITS_END() - -#endif // StyleImage_h +} +#endif |
