[core] Make MapDebugOptions::Overdraw a no-op in Release mode
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user