#ifndef RenderImageResourceStyleImage_h
#define RenderImageResourceStyleImage_h
#include "core/rendering/RenderImageResource.h"
#include "core/rendering/style/StyleImage.h"
#include "wtf/RefPtr.h"
namespace WebCore {
class RenderObject;
class RenderImageResourceStyleImage FINAL : public RenderImageResource {
public:
virtual ~RenderImageResourceStyleImage();
static PassOwnPtr<RenderImageResource> create(StyleImage* styleImage)
{
return adoptPtr(new RenderImageResourceStyleImage(styleImage));
}
virtual void initialize(RenderObject*) OVERRIDE;
virtual void shutdown() OVERRIDE;
virtual bool hasImage() const OVERRIDE { return true; }
virtual PassRefPtr<Image> image(int width = 0, int height = 0) const OVERRIDE;
virtual bool errorOccurred() const OVERRIDE { return m_styleImage->errorOccurred(); }
virtual void setContainerSizeForRenderer(const IntSize&) OVERRIDE;
virtual bool usesImageContainerSize() const OVERRIDE { return m_styleImage->usesImageContainerSize(); }
virtual bool imageHasRelativeWidth() const OVERRIDE { return m_styleImage->imageHasRelativeWidth(); }
virtual bool imageHasRelativeHeight() const OVERRIDE { return m_styleImage->imageHasRelativeHeight(); }
virtual LayoutSize imageSize(float multiplier) const OVERRIDE { return m_styleImage->imageSize(m_renderer, multiplier); }
virtual LayoutSize intrinsicSize(float multiplier) const OVERRIDE { return m_styleImage->imageSize(m_renderer, multiplier); }
virtual WrappedImagePtr imagePtr() const OVERRIDE { return m_styleImage->data(); }
private:
RenderImageResourceStyleImage(StyleImage*);
RefPtr<StyleImage> m_styleImage;
};
}
#endif