[core] do not paint empty debug buckets
this removes "Buffer doesn't contain elements" messages when debug painting is enabled
This commit is contained in:
@@ -31,11 +31,15 @@ DebugBucket::DebugBucket(const TileID id, const TileData::State state_, optional
|
||||
}
|
||||
|
||||
void DebugBucket::drawLines(PlainShader& shader, gl::GLObjectStore& glObjectStore) {
|
||||
array.bind(shader, fontBuffer, BUFFER_OFFSET_0, glObjectStore);
|
||||
MBGL_CHECK_ERROR(glDrawArrays(GL_LINES, 0, (GLsizei)(fontBuffer.index())));
|
||||
if (!fontBuffer.empty()) {
|
||||
array.bind(shader, fontBuffer, BUFFER_OFFSET_0, glObjectStore);
|
||||
MBGL_CHECK_ERROR(glDrawArrays(GL_LINES, 0, (GLsizei)(fontBuffer.index())));
|
||||
}
|
||||
}
|
||||
|
||||
void DebugBucket::drawPoints(PlainShader& shader, gl::GLObjectStore& glObjectStore) {
|
||||
array.bind(shader, fontBuffer, BUFFER_OFFSET_0, glObjectStore);
|
||||
MBGL_CHECK_ERROR(glDrawArrays(GL_POINTS, 0, (GLsizei)(fontBuffer.index())));
|
||||
if (!fontBuffer.empty()) {
|
||||
array.bind(shader, fontBuffer, BUFFER_OFFSET_0, glObjectStore);
|
||||
MBGL_CHECK_ERROR(glDrawArrays(GL_POINTS, 0, (GLsizei)(fontBuffer.index())));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user