#pragma once
#if ENABLE(VIDEO)
#include "HTMLVideoElement.h"
#include "RenderMedia.h"
namespace WebCore {
class RenderVideo final : public RenderMedia {
public:
RenderVideo(HTMLVideoElement&, RenderStyle&&);
virtual ~RenderVideo();
HTMLVideoElement& videoElement() const;
WEBCORE_EXPORT IntRect videoBox() const;
static IntSize defaultSize();
bool supportsAcceleratedRendering() const;
void acceleratedRenderingStateChanged();
bool requiresImmediateCompositing() const;
bool shouldDisplayVideo() const;
void updateFromElement() final;
private:
void mediaElement() const = delete;
void intrinsicSizeChanged() final;
LayoutSize calculateIntrinsicSize();
bool updateIntrinsicSize();
void imageChanged(WrappedImagePtr, const IntRect*) final;
const char* renderName() const final { return "RenderVideo"; }
bool requiresLayer() const final { return true; }
bool isVideo() const final { return true; }
void paintReplaced(PaintInfo&, const LayoutPoint&) final;
void layout() final;
LayoutUnit computeReplacedLogicalWidth(ShouldComputePreferred = ComputeActual) const final;
LayoutUnit computeReplacedLogicalHeight() const final;
LayoutUnit minimumReplacedHeight() const final;
#if ENABLE(FULLSCREEN_API)
LayoutUnit offsetLeft() const final;
LayoutUnit offsetTop() const final;
LayoutUnit offsetWidth() const final;
LayoutUnit offsetHeight() const final;
#endif
void updatePlayer();
bool foregroundIsKnownToBeOpaqueInRect(const LayoutRect& localRect, unsigned maxDepthToTest) const final;
LayoutSize m_cachedImageSize;
};
inline RenderVideo* HTMLVideoElement::renderer() const
{
return downcast<RenderVideo>(HTMLMediaElement::renderer());
}
}
SPECIALIZE_TYPE_TRAITS_RENDER_OBJECT(RenderVideo, isVideo())
#endif // ENABLE(VIDEO)