StyleCachedImage.h [plain text]
#ifndef StyleCachedImage_h
#define StyleCachedImage_h
#include "CachedImageClient.h"
#include "CachedResourceHandle.h"
#include "StyleImage.h"
namespace WebCore {
class CachedImage;
class StyleCachedImage final : public StyleImage, private CachedImageClient {
WTF_MAKE_FAST_ALLOCATED;
public:
static Ref<StyleCachedImage> create(CachedImage* image) { return adoptRef(*new StyleCachedImage(image)); }
virtual ~StyleCachedImage();
CachedImage* cachedImage() const override { return m_image.get(); }
private:
WrappedImagePtr data() const override { return m_image.get(); }
PassRefPtr<CSSValue> cssValue() const override;
bool canRender(const RenderObject*, float multiplier) const override;
bool isLoaded() const override;
bool errorOccurred() const override;
FloatSize imageSize(const RenderElement*, float multiplier) const override;
bool imageHasRelativeWidth() const override;
bool imageHasRelativeHeight() const override;
void computeIntrinsicDimensions(const RenderElement*, Length& intrinsicWidth, Length& intrinsicHeight, FloatSize& intrinsicRatio) override;
bool usesImageContainerSize() const override;
void setContainerSizeForRenderer(const RenderElement*, const FloatSize&, float) override;
void addClient(RenderElement*) override;
void removeClient(RenderElement*) override;
RefPtr<Image> image(RenderElement*, const FloatSize&) const override;
bool knownToBeOpaque(const RenderElement*) const override;
explicit StyleCachedImage(CachedImage*);
CachedResourceHandle<CachedImage> m_image;
};
}
SPECIALIZE_TYPE_TRAITS_STYLE_IMAGE(StyleCachedImage, isCachedImage)
#endif // StyleCachedImage_h