diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2019-04-01 15:57:44 +0200 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2019-04-05 11:49:17 +0200 |
commit | a782a6d15b80dd83105604f3f779f6c83ba222e5 (patch) | |
tree | 62d83196baf28554cdd3144691b8210cc998af4a /include/mbgl/renderer | |
parent | 865f8a6c03540e329ed6caef354799fb58b7ab6e (diff) | |
download | qtlocation-mapboxgl-a782a6d15b80dd83105604f3f779f6c83ba222e5.tar.gz |
[core] move BackendScope to gfx namespace
Diffstat (limited to 'include/mbgl/renderer')
-rw-r--r-- | include/mbgl/renderer/backend_scope.hpp | 35 | ||||
-rw-r--r-- | include/mbgl/renderer/renderer_backend.hpp | 4 |
2 files changed, 2 insertions, 37 deletions
diff --git a/include/mbgl/renderer/backend_scope.hpp b/include/mbgl/renderer/backend_scope.hpp deleted file mode 100644 index 73bafc84c7..0000000000 --- a/include/mbgl/renderer/backend_scope.hpp +++ /dev/null @@ -1,35 +0,0 @@ -#pragma once - -namespace mbgl { - -class RendererBackend; - -class BackendScope { -public: - // There are two types of scopes: Creating an "Implicit" scope tells Mapbox GL that the - // supporting windowing system has already activated the GL Backend and that no further actions - // are required. Creating an "Explicit" scope actually enables the GL Backend, and disables it - // when the BackendScope is destroyed. - enum class ScopeType : bool { - Implicit, - Explicit, - }; - - BackendScope(RendererBackend&, ScopeType = ScopeType::Explicit); - ~BackendScope(); - - // Returns true when there is currently a BackendScope active in this thread. - static bool exists(); - -private: - void activate(); - void deactivate(); - - BackendScope* priorScope; - BackendScope* nextScope; - RendererBackend& backend; - const ScopeType scopeType; - bool activated = false; -}; - -} // namespace mbgl diff --git a/include/mbgl/renderer/renderer_backend.hpp b/include/mbgl/renderer/renderer_backend.hpp index 1d5f4e8f4e..f75d00ebb3 100644 --- a/include/mbgl/renderer/renderer_backend.hpp +++ b/include/mbgl/renderer/renderer_backend.hpp @@ -1,6 +1,6 @@ #pragma once -#include <mbgl/renderer/backend_scope.hpp> +#include <mbgl/gfx/backend_scope.hpp> #include <mbgl/util/image.hpp> #include <mbgl/util/size.hpp> #include <mbgl/util/util.hpp> @@ -82,7 +82,7 @@ protected: private: std::once_flag initialized; - friend class BackendScope; + friend class gfx::BackendScope; }; MBGL_CONSTEXPR bool operator==(const RendererBackend& a, const RendererBackend& b) { |