| 1 | #pragma once |
| 2 | |
| 3 | #include <mbgl/util/noncopyable.hpp> |
| 4 | |
| 5 | #include <string> |
| 6 | |
| 7 | namespace mbgl { |
| 8 | namespace gl { |
| 9 | |
| 10 | class Context; |
| 11 | |
| 12 | #ifndef NDEBUG |
| 13 | |
| 14 | class DebugGroup : private util::noncopyable { |
| 15 | public: |
| 16 | DebugGroup(const Context&, const std::string&); |
| 17 | ~DebugGroup(); |
| 18 | |
| 19 | private: |
| 20 | const Context& context; |
| 21 | }; |
| 22 | |
| 23 | #define __MBGL_DEBUG_GROUP_NAME2(counter) __MBGL_DEBUG_GROUP_##counter |
| 24 | #define __MBGL_DEBUG_GROUP_NAME(counter) __MBGL_DEBUG_GROUP_NAME2(counter) |
| 25 | #define MBGL_DEBUG_GROUP(context, name) const ::mbgl::gl::DebugGroup __MBGL_DEBUG_GROUP_NAME(__LINE__)(context, name); |
| 26 | |
| 27 | #else |
| 28 | |
| 29 | #define MBGL_DEBUG_GROUP(context, name) |
| 30 | |
| 31 | #endif |
| 32 | |
| 33 | } // namespace gl |
| 34 | } // namespace mbgl |
| 35 | |