[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: =?utf-8?q?=5Bkde-workspace=5D_kwin/lib=3A_Remove_renderGLGeometr?=
From: Martin_Gräßlin <kde () martin-graesslin ! com>
Date: 2011-02-04 18:36:46
Message-ID: 20110204183646.A5E90A609B () git ! kde ! org
[Download RAW message or body]
Git commit 96e2bbbfd3af4c9a4643b97ed65d560b61172fe4 by Martin Gräßlin.
Committed on 04/02/11 at 19:37.
Pushed by graesslin into branch 'master'.
Remove renderGLGeometry from kwinglutils.
Not used anymore - completely replaced by VBO.
M +0 -119 kwin/lib/kwinglutils.cpp
M +0 -38 kwin/lib/kwinglutils.h
http://commits.kde.org/kde-workspace/96e2bbbfd3af4c9a4643b97ed65d560b61172fe4
diff --git a/kwin/lib/kwinglutils.cpp b/kwin/lib/kwinglutils.cpp
index 72438b9..99b6487 100644
--- a/kwin/lib/kwinglutils.cpp
+++ b/kwin/lib/kwinglutils.cpp
@@ -170,125 +170,6 @@ int nearestPowerOfTwo(int x)
return 1 << last;
}
-void renderGLGeometry(int count, const float* vertices, const float* texture, const \
float* color,
- int dim, int stride)
-{
- return renderGLGeometry(infiniteRegion(), count, vertices, texture, color, dim, \
stride);
-}
-
-void renderGLGeometry(const QRegion& region, int count,
- const float* vertices, const float* texture, const float* \
color,
- int dim, int stride)
-{
-#ifdef KWIN_HAVE_OPENGLES
- Q_UNUSED(region)
- Q_UNUSED(count)
- Q_UNUSED(vertices)
- Q_UNUSED(texture)
- Q_UNUSED(color)
- Q_UNUSED(dim)
- Q_UNUSED(stride)
-#else
- // Using arrays only makes sense if we have larger number of vertices.
- // Otherwise overhead of enabling/disabling them is too big.
- bool use_arrays = (count > 5);
-
- if (use_arrays) {
- glPushAttrib(GL_ENABLE_BIT);
- glPushClientAttrib(GL_CLIENT_VERTEX_ARRAY_BIT);
- // Enable arrays
- glEnableClientState(GL_VERTEX_ARRAY);
- glVertexPointer(dim, GL_FLOAT, stride, vertices);
- if (texture != NULL) {
- glEnableClientState(GL_TEXTURE_COORD_ARRAY);
- glTexCoordPointer(2, GL_FLOAT, stride, texture);
- }
- if (color != NULL) {
- glEnableClientState(GL_COLOR_ARRAY);
- glColorPointer(4, GL_FLOAT, stride, color);
- }
- }
-
- // Clip using scissoring
- if (!effects->isRenderTargetBound()) {
- PaintClipper pc(region);
- for (PaintClipper::Iterator iterator;
- !iterator.isDone();
- iterator.next()) {
- if (use_arrays)
- glDrawArrays(GL_QUADS, 0, count);
- else
- renderGLGeometryImmediate(count, vertices, texture, color, dim, \
stride);
- }
- } else {
- if (use_arrays)
- glDrawArrays(GL_QUADS, 0, count);
- else
- renderGLGeometryImmediate(count, vertices, texture, color, dim, stride);
- }
-
- if (use_arrays) {
- glPopClientAttrib();
- glPopAttrib();
- }
-#endif
-}
-
-void renderGLGeometryImmediate(int count, const float* vertices, const float* \
texture, const float* color,
- int dim, int stride)
-{
-#ifdef KWIN_HAVE_OPENGLES
- Q_UNUSED(count)
- Q_UNUSED(vertices)
- Q_UNUSED(texture)
- Q_UNUSED(color)
- Q_UNUSED(dim)
- Q_UNUSED(stride)
-#else
- // Find out correct glVertex*fv function according to dim parameter.
- void (*glVertexFunc)(const float*) = glVertex2fv;
- if (dim == 3)
- glVertexFunc = glVertex3fv;
- else if (dim == 4)
- glVertexFunc = glVertex4fv;
-
- // These are number of _floats_ per item, not _bytes_ per item as opengl uses.
- int vsize, tsize, csize;
- vsize = tsize = csize = stride / sizeof(float);
- if (!stride) {
- // 0 means that arrays are tightly packed. This gives us different
- // strides for different arrays
- vsize = dim;
- tsize = 2;
- csize = 4;
- }
-
- glBegin(GL_QUADS);
- // This sucks. But makes it faster.
- if (texture && color) {
- for (int i = 0; i < count; i++) {
- glTexCoord2fv(texture + i * tsize);
- glColor4fv(color + i * csize);
- glVertexFunc(vertices + i * vsize);
- }
- } else if (texture) {
- for (int i = 0; i < count; i++) {
- glTexCoord2fv(texture + i * tsize);
- glVertexFunc(vertices + i * vsize);
- }
- } else if (color) {
- for (int i = 0; i < count; i++) {
- glColor4fv(color + i * csize);
- glVertexFunc(vertices + i * vsize);
- }
- } else {
- for (int i = 0; i < count; i++)
- glVertexFunc(vertices + i * vsize);
- }
- glEnd();
-#endif
-}
-
void addQuadVertices(QVector<float>& verts, float x1, float y1, float x2, float y2)
{
verts << x1 << y1;
diff --git a/kwin/lib/kwinglutils.h b/kwin/lib/kwinglutils.h
index 468d7b4..829d5fe 100644
--- a/kwin/lib/kwinglutils.h
+++ b/kwin/lib/kwinglutils.h
@@ -86,44 +86,6 @@ inline bool KWIN_EXPORT isPowerOfTwo(int x)
int KWIN_EXPORT nearestPowerOfTwo(int x);
/**
- * Renders quads using given vertices.
- * If texture is not 0, each texture coordinate much have two components (st).
- * If color is not 0, each color much have four components (rgba).
- * Note that texture coordinates must match texture type (normalized/unnormalized
- * for GL_TEXTURE_2D/GL_TEXTURE_ARB).
- *
- * In OpenGL ES this method is a no-op.
- *
- * @param count number of vertices to use.
- * @param dim number of components per vertex coordinate in vertices array.
- * @param stride byte offset of consecutive elements in arrays. If 0, then
- * arrays must be tighly packed. Stride must be a multiple of sizeof(float)!
- * @deprecated Use GLVertexBuffer
- * @see GLVertexBuffer
- **/
-KWIN_EXPORT void renderGLGeometry(const QRegion& region, int count,
- const float* vertices, const float* texture = 0, \
const float* color = 0,
- int dim = 2, int stride = 0);
-/**
- * Same as above, renders without specified region
- * @deprecated Use GLVertexBuffer
- * @see GLVertexBuffer
- **/
-KWIN_EXPORT void renderGLGeometry(int count,
- const float* vertices, const float* texture = 0, \
const float* color = 0,
- int dim = 2, int stride = 0);
-
-/**
- * In OpenGL ES this method is a no-op.
- *
- * @deprecated Use GLVertexBuffer
- * @see GLVertexBuffer
- **/
-KWIN_EXPORT void renderGLGeometryImmediate(int count,
- const float* vertices, const float* texture = 0, const float* color = 0,
- int dim = 2, int stride = 0);
-
-/**
* @deprecated Quads are not available in OpenGL ES
**/
KWIN_EXPORT void addQuadVertices(QVector<float>& verts, float x1, float y1, float \
x2, float y2);
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic