#ifndef RenderVideo_h
#define RenderVideo_h
#if ENABLE(VIDEO)
#include "RenderMedia.h"
namespace WebCore {
class HTMLMediaElement;
class HTMLVideoElement;
class RenderVideo : public RenderMedia {
public:
RenderVideo(HTMLVideoElement*);
virtual ~RenderVideo();
IntRect videoBox() const;
static IntSize defaultSize();
#if USE(ACCELERATED_COMPOSITING)
bool supportsAcceleratedRendering() const;
void acceleratedRenderingStateChanged();
#endif
bool requiresImmediateCompositing() const;
virtual bool shouldDisplayVideo() const;
private:
virtual void updateFromElement();
inline HTMLVideoElement* videoElement() const;
virtual void intrinsicSizeChanged();
LayoutSize calculateIntrinsicSize();
void updateIntrinsicSize();
virtual void imageChanged(WrappedImagePtr, const IntRect*);
virtual const char* renderName() const { return "RenderVideo"; }
virtual bool requiresLayer() const { return true; }
virtual bool isVideo() const { return true; }
virtual void paintReplaced(PaintInfo&, const LayoutPoint&);
virtual void layout();
virtual LayoutUnit computeReplacedLogicalWidth(ShouldComputePreferred = ComputeActual) const OVERRIDE;
virtual LayoutUnit computeReplacedLogicalHeight() const;
virtual LayoutUnit minimumReplacedHeight() const OVERRIDE;
#if ENABLE(FULLSCREEN_API)
virtual LayoutUnit offsetLeft() const;
virtual LayoutUnit offsetTop() const;
virtual LayoutUnit offsetWidth() const;
virtual LayoutUnit offsetHeight() const;
#endif
void updatePlayer();
virtual bool foregroundIsKnownToBeOpaqueInRect(const LayoutRect& localRect, unsigned maxDepthToTest) const OVERRIDE;
LayoutSize m_cachedImageSize;
};
inline RenderVideo* toRenderVideo(RenderObject* object)
{
ASSERT_WITH_SECURITY_IMPLICATION(!object || object->isVideo());
return static_cast<RenderVideo*>(object);
}
void toRenderVideo(const RenderVideo*);
}
#endif
#endif // RenderVideo_h