#ifndef RenderLayerModelObject_h
#define RenderLayerModelObject_h
#include "core/rendering/compositing/CompositedLayerMappingPtr.h"
#include "core/rendering/RenderObject.h"
namespace WebCore {
class RenderLayer;
class CompositedLayerMapping;
class ScrollableArea;
enum LayerType {
NoLayer,
NormalLayer,
OverflowClipLayer,
ForcedLayer
};
class RenderLayerModelObject : public RenderObject {
public:
explicit RenderLayerModelObject(ContainerNode*);
virtual ~RenderLayerModelObject();
void destroyLayer();
bool hasSelfPaintingLayer() const;
RenderLayer* layer() const { return m_layer.get(); }
ScrollableArea* scrollableArea() const;
virtual void styleWillChange(StyleDifference, const RenderStyle& newStyle) OVERRIDE;
virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle) OVERRIDE;
virtual void updateFromStyle() { }
virtual LayerType layerTypeRequired() const = 0;
virtual bool backgroundIsKnownToBeOpaqueInRect(const LayoutRect&) const { return false; }
ContainerNode* node() const { return toContainerNode(RenderObject::node()); }
CompositedLayerMappingPtr compositedLayerMapping() const;
bool hasCompositedLayerMapping() const;
CompositedLayerMapping* groupedMapping() const;
protected:
void createLayer(LayerType);
virtual void willBeDestroyed() OVERRIDE;
virtual void addLayerHitTestRects(LayerHitTestRects&, const RenderLayer*, const LayoutPoint&, const LayoutRect&) const OVERRIDE;
private:
virtual bool isLayerModelObject() const OVERRIDE FINAL { return true; }
OwnPtr<RenderLayer> m_layer;
static bool s_wasFloating;
};
DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderLayerModelObject, isLayerModelObject());
}
#endif