aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/flags/SkCommonFlags.cpp4
-rw-r--r--tools/timer/Timer.cpp11
-rw-r--r--tools/timer/Timer.h3
3 files changed, 16 insertions, 2 deletions
diff --git a/tools/flags/SkCommonFlags.cpp b/tools/flags/SkCommonFlags.cpp
index c7fc17f047..a9a0bae04b 100644
--- a/tools/flags/SkCommonFlags.cpp
+++ b/tools/flags/SkCommonFlags.cpp
@@ -7,9 +7,9 @@
#include "SkCommonFlags.h"
-DEFINE_string(config, "565 8888 pdf gpu nonrendering angle nvprmsaa4",
+DEFINE_string(config, "565 8888 gpu nonrendering angle nvprmsaa4 ",
"Options: 565 8888 pdf gpu nonrendering msaa4 msaa16 nvprmsaa4 nvprmsaa16 "
- "gpudft gpunull gpudebug angle mesa");
+ "gpudft gpunull gpudebug angle mesa (and many more)");
DEFINE_bool(cpu, true, "master switch for running CPU-bound work.");
diff --git a/tools/timer/Timer.cpp b/tools/timer/Timer.cpp
index a9f04afe75..e430404b3d 100644
--- a/tools/timer/Timer.cpp
+++ b/tools/timer/Timer.cpp
@@ -51,3 +51,14 @@ void WallTimer::start() {
void WallTimer::end() {
fWall = fSysTimer.endWall();
}
+
+SkString HumanizeMs(double ms) {
+ if (ms > 1e+3) return SkStringPrintf("%.3gs", ms/1e3);
+ if (ms < 1e-3) return SkStringPrintf("%.3gns", ms*1e6);
+#ifdef SK_BUILD_FOR_WIN
+ if (ms < 1) return SkStringPrintf("%.3gus", ms*1e3);
+#else
+ if (ms < 1) return SkStringPrintf("%.3gµs", ms*1e3);
+#endif
+ return SkStringPrintf("%.3gms", ms);
+}
diff --git a/tools/timer/Timer.h b/tools/timer/Timer.h
index 81d1ca50ef..e28a515b54 100644
--- a/tools/timer/Timer.h
+++ b/tools/timer/Timer.h
@@ -8,6 +8,7 @@
#define Timer_DEFINED
#include "SkTypes.h"
+#include "SkString.h"
#if defined(SK_BUILD_FOR_WIN32)
#include "SysTimer_windows.h"
@@ -70,4 +71,6 @@ private:
SysTimer fSysTimer;
};
+SkString HumanizeMs(double);
+
#endif