Browse Source

DebugTools: deprecate the old Profiler.

pull/432/merge
Vladimír Vondruš 6 years ago
parent
commit
f2800995b2
  1. 2
      doc/changelog.dox
  2. 9
      src/Magnum/DebugTools/CMakeLists.txt
  3. 2
      src/Magnum/DebugTools/Profiler.cpp
  4. 20
      src/Magnum/DebugTools/Profiler.h

2
doc/changelog.dox

@ -631,6 +631,8 @@ See also:
This also means it's no longer This also means it's no longer
possible to override equality comparison epsilons at compile time, but that possible to override equality comparison epsilons at compile time, but that
was a rarely (if ever) used feature. 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 @subsection changelog-latest-compatibility Potential compatibility breakages, removed APIs

9
src/Magnum/DebugTools/CMakeLists.txt

@ -24,8 +24,7 @@
# #
set(MagnumDebugTools_SRCS set(MagnumDebugTools_SRCS
ColorMap.cpp ColorMap.cpp)
Profiler.cpp)
set(MagnumDebugTools_GracefulAssert_SRCS set(MagnumDebugTools_GracefulAssert_SRCS
FrameProfiler.cpp) FrameProfiler.cpp)
@ -34,13 +33,17 @@ set(MagnumDebugTools_HEADERS
ColorMap.h ColorMap.h
DebugTools.h DebugTools.h
FrameProfiler.h FrameProfiler.h
Profiler.h
visibility.h) visibility.h)
# Header files to display in project view of IDEs only # Header files to display in project view of IDEs only
set(MagnumDebugTools_PRIVATE_HEADERS ) set(MagnumDebugTools_PRIVATE_HEADERS )
if(MAGNUM_BUILD_DEPRECATED)
list(APPEND MagnumDebugTools_SRCS Profiler.cpp)
list(APPEND MagnumDebugTools_HEADERS Profiler.h)
endif()
if(TARGET_GL) if(TARGET_GL)
list(APPEND MagnumDebugTools_SRCS list(APPEND MagnumDebugTools_SRCS
ResourceManager.cpp ResourceManager.cpp

2
src/Magnum/DebugTools/Profiler.cpp

@ -23,6 +23,8 @@
DEALINGS IN THE SOFTWARE. DEALINGS IN THE SOFTWARE.
*/ */
#define _MAGNUM_NO_DEPRECATED_PROFILER
#include "Profiler.h" #include "Profiler.h"
#include <algorithm> #include <algorithm>

20
src/Magnum/DebugTools/Profiler.h

@ -25,22 +25,36 @@
DEALINGS IN THE SOFTWARE. DEALINGS IN THE SOFTWARE.
*/ */
#ifdef MAGNUM_BUILD_DEPRECATED
/** @file /** @file
* @brief Class @ref Magnum::DebugTools::Profiler * @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 <chrono> #include <chrono>
#include <initializer_list> #include <initializer_list>
#include <string> #include <string>
#include <vector> #include <vector>
#include <Corrade/Utility/Macros.h>
#include "Magnum/Types.h" #include "Magnum/Types.h"
#include "Magnum/DebugTools/visibility.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 { namespace Magnum { namespace DebugTools {
/** /**
@brief Profiler @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 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()), 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 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 stop it again using @ref stop(), if you are not interested in profiling the
rest. 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: public:
/** /**
* @brief Section ID * @brief Section ID
@ -213,5 +224,6 @@ class MAGNUM_DEBUGTOOLS_EXPORT Profiler {
}; };
}} }}
#endif
#endif #endif

Loading…
Cancel
Save