Commit e0de6d37 authored by Philipp Hancke's avatar Philipp Hancke Committed by Commit Bot

webrtc-internals: dont repaint invisible graphs

avoids repainting stats graphs that are not visible.
Visibility is determined as described in
  https://stackoverflow.com/a/21696585/4352772

BUG=678292

Change-Id: Ib7ac623f8d961359e4915b3f5580734fb1328bec
Reviewed-on: https://chromium-review.googlesource.com/602270Reviewed-by: default avatarTommi <tommi@chromium.org>
Commit-Queue: Harald Alvestrand <hta@chromium.org>
Cr-Commit-Position: refs/heads/master@{#543372}
parent 9eaaf8d9
...@@ -149,9 +149,13 @@ var TimelineGraphView = (function() { ...@@ -149,9 +149,13 @@ var TimelineGraphView = (function() {
}, },
/** /**
* Draws the graph on |canvas_|. * Draws the graph on |canvas_| when visible.
*/ */
repaint: function() { repaint: function() {
if (this.canvas_.offsetParent === null) {
return; // do not repaint graphs that are not visible.
}
this.repaintTimerRunning_ = false; this.repaintTimerRunning_ = false;
var width = this.canvas_.width; var width = this.canvas_.width;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment