kwin: Rename numberVertices to vertexCount
This commit is contained in:
parent
82c1e1168d
commit
076ea58732
1 changed files with 17 additions and 17 deletions
|
@ -1132,7 +1132,7 @@ class GLVertexBufferPrivate
|
|||
{
|
||||
public:
|
||||
GLVertexBufferPrivate(GLVertexBuffer::UsageHint usageHint)
|
||||
: numberVertices(0)
|
||||
: vertexCount(0)
|
||||
, dimension(2)
|
||||
, useColor(false)
|
||||
, useTexCoords(true)
|
||||
|
@ -1162,7 +1162,7 @@ public:
|
|||
|
||||
GLuint buffers[2];
|
||||
GLenum usage;
|
||||
int numberVertices;
|
||||
int vertexCount;
|
||||
int dimension;
|
||||
static bool supported;
|
||||
static GLVertexBuffer *streamingBuffer;
|
||||
|
@ -1202,11 +1202,11 @@ void GLVertexBufferPrivate::legacyPainting(QRegion region, GLenum primitiveMode,
|
|||
}
|
||||
|
||||
if (!hardwareClipping) {
|
||||
glDrawArrays(primitiveMode, 0, numberVertices);
|
||||
glDrawArrays(primitiveMode, 0, vertexCount);
|
||||
} else {
|
||||
foreach (const QRect& r, region.rects()) {
|
||||
glScissor(r.x(), displayHeight() - r.y() - r.height(), r.width(), r.height());
|
||||
glDrawArrays(primitiveMode, 0, numberVertices);
|
||||
glDrawArrays(primitiveMode, 0, vertexCount);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1241,11 +1241,11 @@ void GLVertexBufferPrivate::corePainting(const QRegion& region, GLenum primitive
|
|||
}
|
||||
|
||||
if (!hardwareClipping) {
|
||||
glDrawArrays(primitiveMode, 0, numberVertices);
|
||||
glDrawArrays(primitiveMode, 0, vertexCount);
|
||||
} else {
|
||||
foreach (const QRect& r, region.rects()) {
|
||||
glScissor(r.x(), displayHeight() - r.y() - r.height(), r.width(), r.height());
|
||||
glDrawArrays(primitiveMode, 0, numberVertices);
|
||||
glDrawArrays(primitiveMode, 0, vertexCount);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1278,11 +1278,11 @@ void GLVertexBufferPrivate::fallbackPainting(const QRegion& region, GLenum primi
|
|||
|
||||
// Clip using scissoring
|
||||
if (!hardwareClipping) {
|
||||
glDrawArrays(primitiveMode, 0, numberVertices);
|
||||
glDrawArrays(primitiveMode, 0, vertexCount);
|
||||
} else {
|
||||
foreach (const QRect& r, region.rects()) {
|
||||
glScissor(r.x(), displayHeight() - r.y() - r.height(), r.width(), r.height());
|
||||
glDrawArrays(primitiveMode, 0, numberVertices);
|
||||
glDrawArrays(primitiveMode, 0, vertexCount);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1306,23 +1306,23 @@ GLVertexBuffer::~GLVertexBuffer()
|
|||
delete d;
|
||||
}
|
||||
|
||||
void GLVertexBuffer::setData(int numberVertices, int dim, const float* vertices, const float* texcoords)
|
||||
void GLVertexBuffer::setData(int vertexCount, int dim, const float* vertices, const float* texcoords)
|
||||
{
|
||||
d->numberVertices = numberVertices;
|
||||
d->vertexCount = vertexCount;
|
||||
d->dimension = dim;
|
||||
d->useTexCoords = (texcoords != NULL);
|
||||
|
||||
if (!GLVertexBufferPrivate::supported) {
|
||||
// legacy data
|
||||
d->legacyVertices.clear();
|
||||
d->legacyVertices.reserve(numberVertices * dim);
|
||||
for (int i = 0; i < numberVertices * dim; ++i) {
|
||||
d->legacyVertices.reserve(vertexCount * dim);
|
||||
for (int i = 0; i < vertexCount * dim; ++i) {
|
||||
d->legacyVertices << vertices[i];
|
||||
}
|
||||
d->legacyTexCoords.clear();
|
||||
if (d->useTexCoords) {
|
||||
d->legacyTexCoords.reserve(numberVertices * 2);
|
||||
for (int i = 0; i < numberVertices * 2; ++i) {
|
||||
d->legacyTexCoords.reserve(vertexCount * 2);
|
||||
for (int i = 0; i < vertexCount * 2; ++i) {
|
||||
d->legacyTexCoords << texcoords[i];
|
||||
}
|
||||
}
|
||||
|
@ -1330,11 +1330,11 @@ void GLVertexBuffer::setData(int numberVertices, int dim, const float* vertices,
|
|||
}
|
||||
|
||||
glBindBuffer(GL_ARRAY_BUFFER, d->buffers[ 0 ]);
|
||||
glBufferData(GL_ARRAY_BUFFER, sizeof(GLfloat)*numberVertices * d->dimension, vertices, d->usage);
|
||||
glBufferData(GL_ARRAY_BUFFER, sizeof(GLfloat)*vertexCount * d->dimension, vertices, d->usage);
|
||||
|
||||
if (d->useTexCoords) {
|
||||
glBindBuffer(GL_ARRAY_BUFFER, d->buffers[ 1 ]);
|
||||
glBufferData(GL_ARRAY_BUFFER, sizeof(GLfloat)*numberVertices * 2, texcoords, d->usage);
|
||||
glBufferData(GL_ARRAY_BUFFER, sizeof(GLfloat)*vertexCount * 2, texcoords, d->usage);
|
||||
}
|
||||
|
||||
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
||||
|
@ -1381,7 +1381,7 @@ void GLVertexBuffer::reset()
|
|||
{
|
||||
d->useColor = false;
|
||||
d->color = QColor(0, 0, 0, 255);
|
||||
d->numberVertices = 0;
|
||||
d->vertexCount = 0;
|
||||
d->dimension = 2;
|
||||
d->useTexCoords = true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue