Browse Source

DebugTools: deprecate the old Profiler.

meshdata-cereal-killer
Vladimír Vondruš 6 years ago
parent
commit
99f286f199
  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
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

9
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

2
src/Magnum/DebugTools/Profiler.cpp

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

20
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 <chrono>
#include <initializer_list>
#include <string>
#include <vector>
#include <Corrade/Utility/Macros.h>
#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

Loading…
Cancel
Save