Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Commit a3c90ab

Browse files
committed
[core] Make MapDebugOptions::Overdraw a no-op in Release mode
1 parent bd5025d commit a3c90ab

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/mbgl/renderer/painter.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ Painter::Painter(const TransformState& state_,
4646
gl::debugging::enable();
4747

4848
shaders = std::make_unique<Shaders>(store);
49+
#if defined(DEBUG)
4950
overdrawShaders = std::make_unique<Shaders>(store, Shader::Overdraw);
51+
#endif
5052

5153
// Reset GL values
5254
config.setDirty();
@@ -69,7 +71,11 @@ void Painter::render(const Style& style, const FrameData& frame_, SpriteAtlas& a
6971
frame = frame_;
7072

7173
PaintParameters parameters {
74+
#if defined(DEBUG)
7275
isOverdraw() ? *overdrawShaders : *shaders
76+
#else
77+
*shaders
78+
#endif
7379
};
7480

7581
glyphAtlas = style.glyphAtlas.get();

src/mbgl/renderer/painter.hpp

+6
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,11 @@ class Painter : private util::noncopyable {
139139

140140
void setDepthSublayer(int n);
141141

142+
#if defined(DEBUG)
142143
bool isOverdraw() const { return frame.debugOptions & MapDebugOptions::Overdraw; }
144+
#else
145+
bool isOverdraw() const { return false; }
146+
#endif
143147

144148
mat4 projMatrix;
145149

@@ -174,7 +178,9 @@ class Painter : private util::noncopyable {
174178
FrameHistory frameHistory;
175179

176180
std::unique_ptr<Shaders> shaders;
181+
#if defined(DEBUG)
177182
std::unique_ptr<Shaders> overdrawShaders;
183+
#endif
178184

179185
// Set up the stencil quad we're using to generate the stencil mask.
180186
StaticVertexBuffer tileStencilBuffer {

0 commit comments

Comments
 (0)