kwin: cleaning up the GLTexture API
This commit is contained in:
parent
ca8484eff7
commit
f5b5e5c8d0
6 changed files with 2 additions and 46 deletions
|
@ -371,19 +371,6 @@ bool GLTexture::isDirty() const
|
||||||
return d->m_markedDirty;
|
return d->m_markedDirty;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GLTexture::setTexture(GLuint texture)
|
|
||||||
{
|
|
||||||
discard();
|
|
||||||
Q_D(GLTexture);
|
|
||||||
d->m_texture = texture;
|
|
||||||
}
|
|
||||||
|
|
||||||
void GLTexture::setTarget(GLenum target)
|
|
||||||
{
|
|
||||||
Q_D(GLTexture);
|
|
||||||
d->m_target = target;
|
|
||||||
}
|
|
||||||
|
|
||||||
void GLTexture::setFilter(GLenum filter)
|
void GLTexture::setFilter(GLenum filter)
|
||||||
{
|
{
|
||||||
Q_D(GLTexture);
|
Q_D(GLTexture);
|
||||||
|
@ -516,15 +503,4 @@ bool GLTexture::saturationSupported()
|
||||||
return GLTexturePrivate::sSaturationSupported;
|
return GLTexturePrivate::sSaturationSupported;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GLTexture::release()
|
|
||||||
{
|
|
||||||
Q_D(GLTexture);
|
|
||||||
d->release();
|
|
||||||
}
|
|
||||||
|
|
||||||
void GLTexturePrivate::release()
|
|
||||||
{
|
|
||||||
// nothing to do because we are not bound to any specific data
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace KWin
|
} // namespace KWin
|
||||||
|
|
|
@ -72,30 +72,21 @@ public:
|
||||||
virtual void discard();
|
virtual void discard();
|
||||||
void bind();
|
void bind();
|
||||||
void unbind();
|
void unbind();
|
||||||
/**
|
|
||||||
* Release the data which is bound to the texture.
|
|
||||||
* @since 4.8
|
|
||||||
**/
|
|
||||||
void release();
|
|
||||||
void render(QRegion region, const QRect& rect);
|
void render(QRegion region, const QRect& rect);
|
||||||
|
|
||||||
GLuint texture() const;
|
GLuint texture() const;
|
||||||
GLenum target() const;
|
GLenum target() const;
|
||||||
GLenum filter() const;
|
GLenum filter() const;
|
||||||
virtual bool isDirty() const;
|
bool isDirty() const;
|
||||||
void setTexture(GLuint texture);
|
|
||||||
void setTarget(GLenum target);
|
|
||||||
void setFilter(GLenum filter);
|
void setFilter(GLenum filter);
|
||||||
void setWrapMode(GLenum mode);
|
void setWrapMode(GLenum mode);
|
||||||
virtual void setDirty();
|
void setDirty();
|
||||||
|
|
||||||
static bool NPOTTextureSupported();
|
static bool NPOTTextureSupported();
|
||||||
static bool framebufferObjectSupported();
|
static bool framebufferObjectSupported();
|
||||||
static bool saturationSupported();
|
static bool saturationSupported();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
QImage convertToGLFormat(const QImage& img) const;
|
|
||||||
|
|
||||||
QExplicitlySharedDataPointer<GLTexturePrivate> d_ptr;
|
QExplicitlySharedDataPointer<GLTexturePrivate> d_ptr;
|
||||||
GLTexture(GLTexturePrivate& dd);
|
GLTexture(GLTexturePrivate& dd);
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,6 @@ public:
|
||||||
|
|
||||||
virtual void bind();
|
virtual void bind();
|
||||||
virtual void unbind();
|
virtual void unbind();
|
||||||
virtual void release();
|
|
||||||
virtual void onDamage();
|
virtual void onDamage();
|
||||||
|
|
||||||
QImage convertToGLFormat(const QImage& img) const;
|
QImage convertToGLFormat(const QImage& img) const;
|
||||||
|
|
|
@ -114,7 +114,6 @@ public:
|
||||||
TexturePrivate();
|
TexturePrivate();
|
||||||
virtual ~TexturePrivate();
|
virtual ~TexturePrivate();
|
||||||
|
|
||||||
virtual void release();
|
|
||||||
virtual void onDamage();
|
virtual void onDamage();
|
||||||
|
|
||||||
#ifndef KWIN_HAVE_OPENGLES
|
#ifndef KWIN_HAVE_OPENGLES
|
||||||
|
|
|
@ -248,10 +248,6 @@ void SceneOpenGL::Texture::findTarget()
|
||||||
d->m_target = GL_TEXTURE_2D;
|
d->m_target = GL_TEXTURE_2D;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SceneOpenGL::TexturePrivate::release()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
bool SceneOpenGL::Texture::load(const Pixmap& pix, const QSize& size,
|
bool SceneOpenGL::Texture::load(const Pixmap& pix, const QSize& size,
|
||||||
int depth, QRegion region)
|
int depth, QRegion region)
|
||||||
{
|
{
|
||||||
|
|
|
@ -606,11 +606,6 @@ SceneOpenGL::TexturePrivate::TexturePrivate()
|
||||||
}
|
}
|
||||||
|
|
||||||
SceneOpenGL::TexturePrivate::~TexturePrivate()
|
SceneOpenGL::TexturePrivate::~TexturePrivate()
|
||||||
{
|
|
||||||
release();
|
|
||||||
}
|
|
||||||
|
|
||||||
void SceneOpenGL::TexturePrivate::release()
|
|
||||||
{
|
{
|
||||||
if (m_glxpixmap != None) {
|
if (m_glxpixmap != None) {
|
||||||
if (!options->glStrictBinding) {
|
if (!options->glStrictBinding) {
|
||||||
|
|
Loading…
Reference in a new issue