#ifndef SVGImageCache_h
#define SVGImageCache_h
#include "platform/geometry/FloatSize.h"
#include "platform/geometry/IntSize.h"
#include "platform/graphics/Image.h"
#include "wtf/HashMap.h"
#include "wtf/PassOwnPtr.h"
#include "wtf/RefPtr.h"
namespace WebCore {
class ImageResource;
class ImageResourceClient;
class ImageBuffer;
class SVGImage;
class SVGImageForContainer;
class RenderObject;
class SVGImageCache {
WTF_MAKE_FAST_ALLOCATED;
public:
~SVGImageCache();
static PassOwnPtr<SVGImageCache> create(SVGImage* image)
{
return adoptPtr(new SVGImageCache(image));
}
void removeClientFromCache(const ImageResourceClient*);
void setContainerSizeForRenderer(const ImageResourceClient*, const IntSize&, float);
IntSize imageSizeForRenderer(const RenderObject*) const;
Image* imageForRenderer(const RenderObject*);
private:
SVGImageCache(SVGImage*);
typedef HashMap<const ImageResourceClient*, RefPtr<SVGImageForContainer> > ImageForContainerMap;
SVGImage* m_svgImage;
ImageForContainerMap m_imageForContainerMap;
};
}
#endif