Reduce the number of redraws for mtplot

Previously the border was being redrawn every frame, this is silly since
it only really needs to be redrawn if the screen is cleared.  This CL
adds an MtClear() function that both clears the screen and draws the
border.  As a result this function can simply replace the calls to clear
and then we don't have to worry about drawing the border anymore.

Now mtplot will only draw the boarder in 4 situations:
  * on startup
  * when the user presses escape to clear the screen
  * when the user clicks to clear the screen
  * with every event if persistence is turned off

BUG=chromium:343191
TEST=manually tested many different cases, with and without persistence,
click clearing, and showing the clicks visibly on screen.  The border
was always there and by checking the frequency of the calls to MtClear()
I confirmed that it was only being redrawn when required.

Change-Id: Ifde0d7e37c23ad470d915a65dae77dd67e1a9931
Signed-off-by: Charlie Mooney <charliemooney@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/186115
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
1 file changed