diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2016-07-07 16:29:34 +0200 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2016-07-07 16:29:34 +0200 |
commit | 2e10c0a8660af9cdf6ff897aaa39e15fe62c6582 (patch) | |
tree | 92ad442bd0b54fcb16317e77c5a3a45213a16145 /src | |
parent | ab1face71f62752d49a0d25f8bc22fe142c7cdee (diff) | |
download | qtlocation-mapboxgl-2e10c0a8660af9cdf6ff897aaa39e15fe62c6582.tar.gz |
[core] don't force GL state to be set when calling .reset()
We are using Value::reset() to change a piece of GL state to its default value. However, the current implementation always executes the GL call, even if our state tracking system knows that it's already at that value. The new implementation of Value::reset() now respects that, resulting in a lot fewer GL calls.
Diffstat (limited to 'src')
-rw-r--r-- | src/mbgl/gl/gl_config.hpp | 4 | ||||
-rw-r--r-- | src/mbgl/renderer/painter.cpp | 1 |
2 files changed, 2 insertions, 3 deletions
diff --git a/src/mbgl/gl/gl_config.hpp b/src/mbgl/gl/gl_config.hpp index 09080ca365..9d7dfb3b6c 100644 --- a/src/mbgl/gl/gl_config.hpp +++ b/src/mbgl/gl/gl_config.hpp @@ -21,9 +21,7 @@ public: } void reset() { - dirty = true; - current = T::Default; - T::Set(current); + *this = T::Default; } void setDirty() { diff --git a/src/mbgl/renderer/painter.cpp b/src/mbgl/renderer/painter.cpp index e5c88de635..ba68b5a24d 100644 --- a/src/mbgl/renderer/painter.cpp +++ b/src/mbgl/renderer/painter.cpp @@ -83,6 +83,7 @@ Painter::Painter(const TransformState& state_, overdrawShader.circle = std::make_unique<CircleShader>(store, Shader::Overdraw); // Reset GL values + config.setDirty(); config.reset(); } |