diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2016-03-15 17:15:09 +0100 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2016-04-06 14:16:53 -0700 |
commit | 09684bb1dc08495594104a939026d8722ab7b088 (patch) | |
tree | 71a63f43b8d74a6496f9a3cc708197cf0f27c514 | |
parent | 9a3e8ae571017071e09e6efdb60292c8d62b8bdd (diff) | |
download | qtlocation-mapboxgl-09684bb1dc08495594104a939026d8722ab7b088.tar.gz |
[core] do not paint empty debug buckets
this removes "Buffer doesn't contain elements" messages when debug painting is enabled
-rw-r--r-- | src/mbgl/renderer/debug_bucket.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/mbgl/renderer/debug_bucket.cpp b/src/mbgl/renderer/debug_bucket.cpp index 947783ddb8..ba4ab8c928 100644 --- a/src/mbgl/renderer/debug_bucket.cpp +++ b/src/mbgl/renderer/debug_bucket.cpp @@ -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()))); + } } |