#ifndef SVGImage_h
#define SVGImage_h
#if ENABLE(SVG)
#include "Image.h"
#include "LayoutTypes.h"
namespace WebCore {
class FrameView;
class ImageBuffer;
class Page;
class RenderBox;
class SVGImageChromeClient;
class SVGImage : public Image {
public:
static PassRefPtr<SVGImage> create(ImageObserver* observer)
{
return adoptRef(new SVGImage(observer));
}
enum ShouldClearBuffer {
ClearImageBuffer,
DontClearImageBuffer
};
void drawSVGToImageBuffer(ImageBuffer*, const IntSize&, float zoom, float scale, ShouldClearBuffer);
RenderBox* embeddedContentBox() const;
FrameView* frameView() const;
virtual bool isSVGImage() const { return true; }
virtual IntSize size() const;
virtual bool hasRelativeWidth() const;
virtual bool hasRelativeHeight() const;
private:
friend class SVGImageChromeClient;
virtual ~SVGImage();
virtual String filenameExtension() const;
virtual void setContainerSize(const IntSize&);
virtual bool usesContainerSize() const { return true; }
virtual void computeIntrinsicDimensions(Length& intrinsicWidth, Length& intrinsicHeight, FloatSize& intrinsicRatio);
virtual bool dataChanged(bool allDataReceived);
virtual void destroyDecodedData(bool) { }
virtual unsigned decodedSize() const { return 0; }
virtual NativeImagePtr frameAtIndex(size_t) { return 0; }
SVGImage(ImageObserver*);
virtual void draw(GraphicsContext*, const FloatRect& fromRect, const FloatRect& toRect, ColorSpace styleColorSpace, CompositeOperator);
virtual NativeImagePtr nativeImageForCurrentFrame();
OwnPtr<SVGImageChromeClient> m_chromeClient;
OwnPtr<Page> m_page;
RefPtr<Image> m_frameCache;
};
}
#endif // ENABLE(SVG)
#endif // SVGImage_h