From ad3078e73d4fda41937ccbc19f1444fa2ef8e52a Mon Sep 17 00:00:00 2001 From: Bruno de Oliveira Abinader Date: Tue, 20 Oct 2015 12:10:07 -0700 Subject: [PATCH] [core] Remove redundant setDebug() from Painter This information can be obtained directly from MapData. --- src/mbgl/map/map_context.cpp | 1 - src/mbgl/renderer/painter.cpp | 4 ---- src/mbgl/renderer/painter.hpp | 4 ---- src/mbgl/renderer/painter_debug.cpp | 2 +- 4 files changed, 1 insertion(+), 10 deletions(-) diff --git a/src/mbgl/map/map_context.cpp b/src/mbgl/map/map_context.cpp index f24216bb4..7b44222a7 100644 --- a/src/mbgl/map/map_context.cpp +++ b/src/mbgl/map/map_context.cpp @@ -248,7 +248,6 @@ bool MapContext::renderSync(const TransformState& state, const FrameData& frame) painter->setup(); } - painter->setDebug(data.getDebug()); painter->render(*style, transformState, frame, data.getAnimationTime()); if (data.mode == MapMode::Still) { diff --git a/src/mbgl/renderer/painter.cpp b/src/mbgl/renderer/painter.cpp index fc380c2f6..cd7544743 100644 --- a/src/mbgl/renderer/painter.cpp +++ b/src/mbgl/renderer/painter.cpp @@ -113,10 +113,6 @@ void Painter::resize() { } } -void Painter::setDebug(bool enabled) { - debug = enabled; -} - void Painter::useProgram(GLuint program) { if (gl_program != program) { MBGL_CHECK_ERROR(glUseProgram(program)); diff --git a/src/mbgl/renderer/painter.hpp b/src/mbgl/renderer/painter.hpp index 07bd4c4d3..7f6fccd58 100644 --- a/src/mbgl/renderer/painter.hpp +++ b/src/mbgl/renderer/painter.hpp @@ -120,9 +120,6 @@ public: // Adjusts the dimensions of the OpenGL viewport void resize(); - // Changes whether debug information is drawn onto the map - void setDebug(bool enabled); - void drawClippingMasks(const std::set&); void drawClippingMask(const mat4& matrix, const ClipID& clip); @@ -189,7 +186,6 @@ private: TransformState state; FrameData frame; - bool debug = false; int indent = 0; gl::Config config; diff --git a/src/mbgl/renderer/painter_debug.cpp b/src/mbgl/renderer/painter_debug.cpp index bc4055324..c401faaaa 100644 --- a/src/mbgl/renderer/painter_debug.cpp +++ b/src/mbgl/renderer/painter_debug.cpp @@ -12,7 +12,7 @@ using namespace mbgl; void Painter::renderTileDebug(const Tile& tile) { MBGL_DEBUG_GROUP(std::string { "debug " } + std::string(tile.id)); assert(tile.data); - if (debug) { + if (data.getDebug()) { prepareTile(tile); renderDebugText(tile.data->debugBucket, tile.matrix); renderDebugFrame(tile.matrix);