Drop some more unused code in kwinglutils.

svn path=/trunk/KDE/kdebase/workspace/; revision=1155061
icc-effect-5.14.5
Martin Gräßlin 2010-07-26 20:32:25 +00:00
parent 48012c30fe
commit b9bdf83159
2 changed files with 0 additions and 88 deletions

View File

@ -259,82 +259,6 @@ void addQuadVertices(QVector<float>& verts, float x1, float y1, float x2, float
verts << x2 << y1;
}
void renderRoundBox( const QRect& area, float roundness, GLTexture* texture )
{
static GLTexture* circleTexture = 0;
if( !texture && !circleTexture )
{
QString texturefile = KGlobal::dirs()->findResource("data", "kwin/circle.png");
circleTexture = new GLTexture(texturefile);
}
if( !texture )
{
texture = circleTexture;
}
glPushAttrib( GL_CURRENT_BIT | GL_ENABLE_BIT | GL_TEXTURE_BIT );
glEnable( GL_BLEND );
glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
glPushMatrix();
QVector<float> verts, texcoords;
verts.reserve(80);
texcoords.reserve(80);
// center
addQuadVertices(verts, area.left() + roundness, area.top() + roundness, area.right() - roundness, area.bottom() - roundness);
addQuadVertices(texcoords, 0.5, 0.5, 0.5, 0.5);
// sides
// left
addQuadVertices(verts, area.left(), area.top() + roundness, area.left() + roundness, area.bottom() - roundness);
addQuadVertices(texcoords, 0.0, 0.5, 0.5, 0.5);
// top
addQuadVertices(verts, area.left() + roundness, area.top(), area.right() - roundness, area.top() + roundness);
addQuadVertices(texcoords, 0.5, 0.0, 0.5, 0.5);
// right
addQuadVertices(verts, area.right() - roundness, area.top() + roundness, area.right(), area.bottom() - roundness);
addQuadVertices(texcoords, 0.5, 0.5, 1.0, 0.5);
// bottom
addQuadVertices(verts, area.left() + roundness, area.bottom() - roundness, area.right() - roundness, area.bottom());
addQuadVertices(texcoords, 0.5, 0.5, 0.5, 1.0);
// corners
// top-left
addQuadVertices(verts, area.left(), area.top(), area.left() + roundness, area.top() + roundness);
addQuadVertices(texcoords, 0.0, 0.0, 0.5, 0.5);
// top-right
addQuadVertices(verts, area.right() - roundness, area.top(), area.right(), area.top() + roundness);
addQuadVertices(texcoords, 0.5, 0.0, 1.0, 0.5);
// bottom-left
addQuadVertices(verts, area.left(), area.bottom() - roundness, area.left() + roundness, area.bottom());
addQuadVertices(texcoords, 0.0, 0.5, 0.5, 1.0);
// bottom-right
addQuadVertices(verts, area.right() - roundness, area.bottom() - roundness, area.right(), area.bottom());
addQuadVertices(texcoords, 0.5, 0.5, 1.0, 1.0);
texture->bind();
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
// We have two elements per vertex in the verts array
int verticesCount = verts.count() / 2;
texture->enableNormalizedTexCoords();
renderGLGeometry( verticesCount, verts.data(), texcoords.data() );
texture->disableNormalizedTexCoords();
texture->unbind();
glPopMatrix();
glPopAttrib();
}
void renderRoundBoxWithEdge( const QRect& area, float roundness )
{
static GLTexture* texture = 0;
if( !texture )
{
QString texturefile = KGlobal::dirs()->findResource("data", "kwin/circle-edgy.png");
texture = new GLTexture(texturefile);
}
renderRoundBox( area, roundness, texture );
}
//****************************************
// GLTexture
//****************************************

View File

@ -115,18 +115,6 @@ KWIN_EXPORT void renderGLGeometryImmediate( int count,
KWIN_EXPORT void addQuadVertices( QVector<float>& verts, float x1, float y1, float x2, float y2 );
/**
* @deprecated
* @see EffectFrame
*/
KWIN_EXPORT void renderRoundBox( const QRect& area, float roundness = 10.0f, GLTexture* texture = 0 );
/**
* @deprecated
* @see EffectFrame
*/
KWIN_EXPORT void renderRoundBoxWithEdge( const QRect& area, float roundness = 10.0f );
class KWIN_EXPORT GLTexture
: public QSharedData
{