#ifndef WebGLTexture_h
#define WebGLTexture_h
#include "CanvasObject.h"
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
namespace WebCore {
class WebGLTexture : public CanvasObject {
public:
virtual ~WebGLTexture() { deleteObject(); }
static PassRefPtr<WebGLTexture> create(WebGLRenderingContext*);
bool isCubeMapRWrapModeInitialized() {
return cubeMapRWrapModeInitialized;
}
void setCubeMapRWrapModeInitialized(bool initialized) {
cubeMapRWrapModeInitialized = initialized;
}
void setTarget(unsigned long);
void setParameteri(unsigned long pname, int param);
void setParameterf(unsigned long pname, float param);
void setSize(unsigned long target, unsigned width, unsigned height);
void setInternalFormat(unsigned long internalformat) { m_internalFormat = internalformat; }
unsigned long getInternalFormat() const { return m_internalFormat; }
static bool isNPOT(unsigned, unsigned);
bool isNPOT() const { return m_isNPOT; }
bool needToUseBlackTexture() const { return m_needToUseBlackTexture; }
protected:
WebGLTexture(WebGLRenderingContext*);
virtual void _deleteObject(Platform3DObject);
private:
virtual bool isTexture() const { return true; }
void updateNPOTStates();
bool cubeMapRWrapModeInitialized;
unsigned long m_target;
int m_minFilter;
int m_magFilter;
int m_wrapS;
int m_wrapT;
unsigned long m_internalFormat;
unsigned m_width[6];
unsigned m_height[6];
bool m_isNPOT;
bool m_needToUseBlackTexture;
};
}
#endif // WebGLTexture_h