aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/viewer/Viewer.cpp
diff options
context:
space:
mode:
authorGravatar Florin Malita <fmalita@chromium.org>2018-05-07 16:30:01 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-05-07 21:30:27 +0000
commit4e9e32572529ffc5bb442fe082206df2285261e3 (patch)
treee81897b758b73a6b346945d40abe367b8a125451 /tools/viewer/Viewer.cpp
parentd3cee17add2becfa526d6ec7337cdcf72a74e108 (diff)
[viewer] Avoid per-frame json UI updates
The reason we push Json updates for every frame is to support the Android FPS meter - which happens to require the native FPS meter for updates. Instead of supporting two meters: 1) scale up the native FPS widget on Android (1.5x) 2) remove the Android widget 3) stop calling updateUIState() from onPaint() Change-Id: Ica8109869035b2f885743a7e38b50688b69fa5e4 Reviewed-on: https://skia-review.googlesource.com/126621 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Florin Malita <fmalita@chromium.org>
Diffstat (limited to 'tools/viewer/Viewer.cpp')
-rw-r--r--tools/viewer/Viewer.cpp15
1 files changed, 0 insertions, 15 deletions
diff --git a/tools/viewer/Viewer.cpp b/tools/viewer/Viewer.cpp
index b4da7dba64..c47c62fd39 100644
--- a/tools/viewer/Viewer.cpp
+++ b/tools/viewer/Viewer.cpp
@@ -1144,9 +1144,6 @@ void Viewer::onPaint(SkCanvas* canvas) {
fCommands.drawHelp(canvas);
this->drawImGui();
-
- // Update the FPS
- this->updateUIState();
}
SkPoint Viewer::mapEvent(float x, float y) {
@@ -1811,24 +1808,12 @@ void Viewer::updateUIState() {
softkeyState[kOptions].append(Json::Value(softkey.c_str()));
}
- // FPS state
- Json::Value fpsState(Json::objectValue);
- fpsState[kName] = kFpsStateName;
- double animTime = fStatsLayer.getLastTime(fAnimateTimer);
- double paintTime = fStatsLayer.getLastTime(fPaintTimer);
- double flushTime = fStatsLayer.getLastTime(fFlushTimer);
- fpsState[kValue] = SkStringPrintf("%8.3lf ms\n\nA %8.3lf\nP %8.3lf\nF%8.3lf",
- animTime + paintTime + flushTime,
- animTime, paintTime, flushTime).c_str();
- fpsState[kOptions] = Json::Value(Json::arrayValue);
-
Json::Value state(Json::arrayValue);
state.append(slideState);
state.append(backendState);
state.append(msaaState);
state.append(prState);
state.append(softkeyState);
- state.append(fpsState);
fWindow->setUIState(state.toStyledString().c_str());
}