summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2016-03-15 17:15:09 +0100
committerKonstantin Käfer <mail@kkaefer.com>2016-04-06 14:16:53 -0700
commit09684bb1dc08495594104a939026d8722ab7b088 (patch)
tree71a63f43b8d74a6496f9a3cc708197cf0f27c514
parent9a3e8ae571017071e09e6efdb60292c8d62b8bdd (diff)
downloadqtlocation-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.cpp12
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())));
+ }
}