#ifndef WebGLRenderbuffer_h
#define WebGLRenderbuffer_h
#include "bindings/v8/ScriptWrappable.h"
#include "core/html/canvas/WebGLSharedObject.h"
#include "wtf/PassRefPtr.h"
namespace WebCore {
class WebGLRenderbuffer FINAL : public WebGLSharedObject, public ScriptWrappable {
public:
virtual ~WebGLRenderbuffer();
static PassRefPtr<WebGLRenderbuffer> create(WebGLRenderingContextBase*);
void setInternalFormat(GLenum internalformat)
{
m_internalFormat = internalformat;
}
GLenum internalFormat() const { return m_internalFormat; }
void setSize(GLsizei width, GLsizei height)
{
m_width = width;
m_height = height;
}
GLsizei width() const { return m_width; }
GLsizei height() const { return m_height; }
bool hasEverBeenBound() const { return object() && m_hasEverBeenBound; }
void setHasEverBeenBound() { m_hasEverBeenBound = true; }
void setEmulatedStencilBuffer(PassRefPtr<WebGLRenderbuffer> buffer) { m_emulatedStencilBuffer = buffer; }
WebGLRenderbuffer* emulatedStencilBuffer() const { return m_emulatedStencilBuffer.get(); }
void deleteEmulatedStencilBuffer(blink::WebGraphicsContext3D* context3d);
protected:
WebGLRenderbuffer(WebGLRenderingContextBase*);
virtual void deleteObjectImpl(blink::WebGraphicsContext3D*, Platform3DObject) OVERRIDE;
private:
virtual bool isRenderbuffer() const OVERRIDE { return true; }
GLenum m_internalFormat;
GLsizei m_width, m_height;
bool m_hasEverBeenBound;
RefPtr<WebGLRenderbuffer> m_emulatedStencilBuffer;
};
}
#endif