[core] Make MapDebugOptions::Overdraw a no-op in Release mode

This commit is contained in:
Bruno de Oliveira Abinader
2016-07-15 14:49:43 +03:00
parent 29ee60ab0e
commit a709ea2656
2 changed files with 12 additions and 0 deletions

View File

@@ -46,7 +46,9 @@ Painter::Painter(const TransformState& state_,
gl::debugging::enable();
shaders = std::make_unique<Shaders>(store);
#if defined(DEBUG)
overdrawShaders = std::make_unique<Shaders>(store, Shader::Overdraw);
#endif
// Reset GL values
config.setDirty();
@@ -69,7 +71,11 @@ void Painter::render(const Style& style, const FrameData& frame_, SpriteAtlas& a
frame = frame_;
PaintParameters parameters {
#if defined(DEBUG)
isOverdraw() ? *overdrawShaders : *shaders
#else
*shaders
#endif
};
glyphAtlas = style.glyphAtlas.get();

View File

@@ -139,7 +139,11 @@ private:
void setDepthSublayer(int n);
#if defined(DEBUG)
bool isOverdraw() const { return frame.debugOptions & MapDebugOptions::Overdraw; }
#else
bool isOverdraw() const { return false; }
#endif
mat4 projMatrix;
@@ -174,7 +178,9 @@ private:
FrameHistory frameHistory;
std::unique_ptr<Shaders> shaders;
#if defined(DEBUG)
std::unique_ptr<Shaders> overdrawShaders;
#endif
// Set up the stencil quad we're using to generate the stencil mask.
StaticVertexBuffer tileStencilBuffer {