Avoid constant view inflation on viewer sample app
authorChet Haase <chet@google.com>
Wed, 15 Feb 2017 01:56:34 +0000 (17:56 -0800)
committerSkia Commit-Bot <skia-commit-bot@chromium.org>
Wed, 15 Feb 2017 18:38:12 +0000 (18:38 +0000)
commit5cd467f3a0ab6863ecdf10a63978f661bc1bbb17
treefa558c3a58d66e24a4ab851afecc6f060dc9435c
parentef163d2acfd588d561087ab51fc94c09efb0cc95
Avoid constant view inflation on viewer sample app

The previous approach re-inflated views on every frame simply because the FPS
number changed (which was passed in a JSON object and used to check whether
the old view matched the new one based on a tag on the view that was set by
the previous FPS string).

The new approach is not pretty (there's no reason to even re-populate the
views when the only thing that needs to happen is to set the appropriate
FPS info in the floating TextView), but at least this avoids the inflation
overhead of the previous approach.

BUG=skia:

Change-Id: Ide1c736c49663cfcf478653a7cdaa99c736f1783
Reviewed-on: https://skia-review.googlesource.com/8461
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Chet Haase <chet@google.com>
platform_tools/android/apps/viewer/src/main/java/org/skia/viewer/StateAdapter.java