diff --git a/doc/changelog.dox b/doc/changelog.dox index 865853496..37f9f1eac 100644 --- a/doc/changelog.dox +++ b/doc/changelog.dox @@ -631,6 +631,8 @@ See also: This also means it's no longer possible to override equality comparison epsilons at compile time, but that was a rarely (if ever) used feature. +- @cpp DebugTools::Profiler @ce is obsolete, replaced with a much more + flexible and extensible @ref DebugTools::FrameProfiler @subsection changelog-latest-compatibility Potential compatibility breakages, removed APIs diff --git a/src/Magnum/DebugTools/CMakeLists.txt b/src/Magnum/DebugTools/CMakeLists.txt index b831a583d..6c1210286 100644 --- a/src/Magnum/DebugTools/CMakeLists.txt +++ b/src/Magnum/DebugTools/CMakeLists.txt @@ -24,8 +24,7 @@ # set(MagnumDebugTools_SRCS - ColorMap.cpp - Profiler.cpp) + ColorMap.cpp) set(MagnumDebugTools_GracefulAssert_SRCS FrameProfiler.cpp) @@ -34,13 +33,17 @@ set(MagnumDebugTools_HEADERS ColorMap.h DebugTools.h FrameProfiler.h - Profiler.h visibility.h) # Header files to display in project view of IDEs only set(MagnumDebugTools_PRIVATE_HEADERS ) +if(MAGNUM_BUILD_DEPRECATED) + list(APPEND MagnumDebugTools_SRCS Profiler.cpp) + list(APPEND MagnumDebugTools_HEADERS Profiler.h) +endif() + if(TARGET_GL) list(APPEND MagnumDebugTools_SRCS ResourceManager.cpp diff --git a/src/Magnum/DebugTools/Profiler.cpp b/src/Magnum/DebugTools/Profiler.cpp index c506ebc60..168b2f4fe 100644 --- a/src/Magnum/DebugTools/Profiler.cpp +++ b/src/Magnum/DebugTools/Profiler.cpp @@ -23,6 +23,8 @@ DEALINGS IN THE SOFTWARE. */ +#define _MAGNUM_NO_DEPRECATED_PROFILER + #include "Profiler.h" #include diff --git a/src/Magnum/DebugTools/Profiler.h b/src/Magnum/DebugTools/Profiler.h index 91bc31899..0e2b387c1 100644 --- a/src/Magnum/DebugTools/Profiler.h +++ b/src/Magnum/DebugTools/Profiler.h @@ -25,22 +25,36 @@ DEALINGS IN THE SOFTWARE. */ +#ifdef MAGNUM_BUILD_DEPRECATED /** @file * @brief Class @ref Magnum::DebugTools::Profiler + * @m_deprecated_since_latest Obsolete, use + * @ref Magnum/DebugTools/FrameProfiler.h and the + * @ref Magnum::DebugTools::FrameProfiler class instead. */ +#endif + +#include "Magnum/configure.h" +#ifdef MAGNUM_BUILD_DEPRECATED #include #include #include #include +#include #include "Magnum/Types.h" #include "Magnum/DebugTools/visibility.h" +#ifndef _MAGNUM_NO_DEPRECATED_PROFILER +CORRADE_DEPRECATED_FILE("use Magnum/DebugTools/FrameProfiler.h and the FrameProfiler class instead") +#endif + namespace Magnum { namespace DebugTools { /** @brief Profiler +@m_deprecated_since_latest Obsolete, use @ref FrameProfiler instead. Measures time passed during specified sections of each frame. It's meant to be used in rendering and event loops (e.g. @ref Platform::Sdl2Application::drawEvent()), @@ -97,11 +111,8 @@ p.printStatistics(); It's possible to start profiler only for certain parts of the code and then stop it again using @ref stop(), if you are not interested in profiling the rest. - -@todo Some unit testing -@todo More time intervals */ -class MAGNUM_DEBUGTOOLS_EXPORT Profiler { +class CORRADE_DEPRECATED("use FrameProfiler instead") MAGNUM_DEBUGTOOLS_EXPORT Profiler { public: /** * @brief Section ID @@ -213,5 +224,6 @@ class MAGNUM_DEBUGTOOLS_EXPORT Profiler { }; }} +#endif #endif