[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdebase/workspace/kwin/lib
From: Martin Gräßlin <kde () martin-graesslin ! com>
Date: 2010-07-26 20:32:26
Message-ID: 20100726203226.183A9AC73E () svn ! kde ! org
[Download RAW message or body]
SVN commit 1155061 by graesslin:
Drop some more unused code in kwinglutils.
M +0 -76 kwinglutils.cpp
M +0 -12 kwinglutils.h
--- trunk/KDE/kdebase/workspace/kwin/lib/kwinglutils.cpp #1155060:1155061
@@ -259,82 +259,6 @@
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
//****************************************
--- trunk/KDE/kdebase/workspace/kwin/lib/kwinglutils.h #1155060:1155061
@@ -115,18 +115,6 @@
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
{
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic