Remove (en|dis)able(Un)NormalizedTexCoords from GLTexture
Those are not used anymore as makeArrays only renders normalized texCoords and also honors the y-Inverted case.
This commit is contained in:
parent
25654f25b8
commit
c8daeef43c
2 changed files with 0 additions and 104 deletions
|
@ -267,72 +267,6 @@ void GLTexture::render(QRegion region, const QRect& rect)
|
|||
}
|
||||
}
|
||||
|
||||
void GLTexture::enableUnnormalizedTexCoords()
|
||||
{
|
||||
#ifndef KWIN_HAVE_OPENGLES
|
||||
assert(mNormalizeActive == 0);
|
||||
if (mUnnormalizeActive++ != 0)
|
||||
return;
|
||||
// update texture matrix to handle GL_TEXTURE_2D and GL_TEXTURE_RECTANGLE
|
||||
glMatrixMode(GL_TEXTURE);
|
||||
glPushMatrix();
|
||||
glLoadIdentity();
|
||||
glScalef(mScale.width(), mScale.height(), 1);
|
||||
if (!y_inverted) {
|
||||
// Modify texture matrix so that we could always use non-opengl
|
||||
// coordinates for textures
|
||||
glScalef(1, -1, 1);
|
||||
glTranslatef(0, -mSize.height(), 0);
|
||||
}
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
#endif
|
||||
}
|
||||
|
||||
void GLTexture::disableUnnormalizedTexCoords()
|
||||
{
|
||||
#ifndef KWIN_HAVE_OPENGLES
|
||||
if (--mUnnormalizeActive != 0)
|
||||
return;
|
||||
// Restore texture matrix
|
||||
glMatrixMode(GL_TEXTURE);
|
||||
glPopMatrix();
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
#endif
|
||||
}
|
||||
|
||||
void GLTexture::enableNormalizedTexCoords()
|
||||
{
|
||||
#ifndef KWIN_HAVE_OPENGLES
|
||||
assert(mUnnormalizeActive == 0);
|
||||
if (mNormalizeActive++ != 0)
|
||||
return;
|
||||
// update texture matrix to handle GL_TEXTURE_2D and GL_TEXTURE_RECTANGLE
|
||||
glMatrixMode(GL_TEXTURE);
|
||||
glPushMatrix();
|
||||
glLoadIdentity();
|
||||
glScalef(mSize.width() * mScale.width(), mSize.height() * mScale.height(), 1);
|
||||
if (y_inverted) {
|
||||
// Modify texture matrix so that we could always use non-opengl
|
||||
// coordinates for textures
|
||||
glScalef(1, -1, 1);
|
||||
glTranslatef(0, -1, 0);
|
||||
}
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
#endif
|
||||
}
|
||||
|
||||
void GLTexture::disableNormalizedTexCoords()
|
||||
{
|
||||
#ifndef KWIN_HAVE_OPENGLES
|
||||
if (--mNormalizeActive != 0)
|
||||
return;
|
||||
// Restore texture matrix
|
||||
glMatrixMode(GL_TEXTURE);
|
||||
glPopMatrix();
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
#endif
|
||||
}
|
||||
|
||||
GLuint GLTexture::texture() const
|
||||
{
|
||||
return mTexture;
|
||||
|
|
|
@ -68,44 +68,6 @@ public:
|
|||
virtual void bind();
|
||||
virtual void unbind();
|
||||
void render(QRegion region, const QRect& rect);
|
||||
/**
|
||||
* Set up texture transformation matrix to automatically map unnormalized
|
||||
* texture coordinates (i.e. 0 to width, 0 to height, (0,0) is top-left)
|
||||
* to OpenGL coordinates. Automatically adjusts for different texture
|
||||
* types. This can be done only for one texture at a time, repeated
|
||||
* calls for the same texture are allowed though, requiring the same
|
||||
* amount of calls to disableUnnormalizedTexCoords().
|
||||
*
|
||||
* In OpenGL ES this method is a no-op. In core profile a shader should be used
|
||||
* @deprecated
|
||||
*/
|
||||
void enableUnnormalizedTexCoords();
|
||||
/**
|
||||
* Disables transformation set up using enableUnnormalizedTexCoords().
|
||||
*
|
||||
* In OpenGL ES this method is a no-op. In core profile a shader should be used
|
||||
* @deprecated
|
||||
*/
|
||||
void disableUnnormalizedTexCoords();
|
||||
/**
|
||||
* Set up texture transformation matrix to automatically map normalized
|
||||
* texture coordinates (i.e. 0 to 1, 0 to 1, (0,0) is bottom-left)
|
||||
* to OpenGL coordinates. Automatically adjusts for different texture
|
||||
* types. This can be done only for one texture at a time, repeated
|
||||
* calls for the same texture are allowed though, requiring the same
|
||||
* amount of calls to disableNormalizedTexCoords().
|
||||
*
|
||||
* In OpenGL ES this method is a no-op. In core profile a shader should be used
|
||||
* @deprecated
|
||||
*/
|
||||
void enableNormalizedTexCoords();
|
||||
/**
|
||||
* Disables transformation set up using enableNormalizedTexCoords().
|
||||
*
|
||||
* In OpenGL ES this method is a no-op. In core profile a shader should be used
|
||||
* @deprecated
|
||||
*/
|
||||
void disableNormalizedTexCoords();
|
||||
|
||||
GLuint texture() const;
|
||||
GLenum target() const;
|
||||
|
|
Loading…
Reference in a new issue