gyp fixes
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
#include <mbgl/geometry/sprite_atlas.hpp>
|
||||
|
||||
#if defined(DEBUG)
|
||||
#include <mbgl/util/timer.hpp>
|
||||
#include <mbgl/util/stopwatch.hpp>
|
||||
#endif
|
||||
|
||||
#include <cassert>
|
||||
@@ -35,7 +35,7 @@ bool Painter::needsAnimation() const {
|
||||
|
||||
void Painter::setup() {
|
||||
#if defined(DEBUG)
|
||||
util::timer timer("painter setup");
|
||||
util::stopwatch stopwatch("painter setup");
|
||||
#endif
|
||||
setupShaders();
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include <mbgl/shader/shader.hpp>
|
||||
#include <mbgl/platform/gl.hpp>
|
||||
#include <mbgl/util/timer.hpp>
|
||||
#include <mbgl/util/stopwatch.hpp>
|
||||
#include <mbgl/platform/log.hpp>
|
||||
|
||||
#include <cstring>
|
||||
@@ -12,7 +12,7 @@ Shader::Shader(const char *name_, const GLchar *vertSource, const GLchar *fragSo
|
||||
: name(name_),
|
||||
valid(false),
|
||||
program(0) {
|
||||
util::timer timer("shader compilation", Event::Shader);
|
||||
util::stopwatch stopwatch("shader compilation", Event::Shader);
|
||||
|
||||
GLuint vertShader;
|
||||
if (!compileShader(&vertShader, GL_VERTEX_SHADER, vertSource)) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef DISABLE_TIMER
|
||||
#include <mbgl/util/timer.hpp>
|
||||
#ifndef DISABLE_STOPWATCH
|
||||
#include <mbgl/util/stopwatch.hpp>
|
||||
#include <mbgl/util/time.hpp>
|
||||
#include <mbgl/platform/log.hpp>
|
||||
|
||||
@@ -8,26 +8,26 @@
|
||||
|
||||
using namespace mbgl::util;
|
||||
|
||||
timer::timer(Event event_)
|
||||
stopwatch::stopwatch(Event event_)
|
||||
: event(event_), start(now()) {}
|
||||
|
||||
timer::timer(EventSeverity severity_, Event event_)
|
||||
stopwatch::stopwatch(EventSeverity severity_, Event event_)
|
||||
: severity(severity_), event(event_), start(now()) {}
|
||||
|
||||
timer::timer(const std::string &name_, Event event_)
|
||||
stopwatch::stopwatch(const std::string &name_, Event event_)
|
||||
: name(name_), event(event_), start(now()) {}
|
||||
|
||||
timer::timer(const std::string &name_, EventSeverity severity_, Event event_)
|
||||
stopwatch::stopwatch(const std::string &name_, EventSeverity severity_, Event event_)
|
||||
: name(name_), severity(severity_), event(event_), start(now()) {}
|
||||
|
||||
void timer::report(const std::string &name_) {
|
||||
void stopwatch::report(const std::string &name_) {
|
||||
timestamp duration = now() - start;
|
||||
|
||||
Log::Record(severity, event, name_ + ": " + std::to_string((double)(duration) / 1_millisecond) + "ms");
|
||||
start += duration;
|
||||
}
|
||||
|
||||
timer::~timer() {
|
||||
stopwatch::~stopwatch() {
|
||||
if (name.size()) {
|
||||
report(name);
|
||||
}
|
||||
Reference in New Issue
Block a user