+
+ TmfTraceContext ctx = TmfTraceManager.getInstance().getCurrentTraceContext();
+ long startTime = ctx.getWindowRange().getStartTime().toNanos();
+ long endTime = ctx.getWindowRange().getEndTime().toNanos();
+
+ // If the time graph control hasn't updated all the way to the end of
+ // the window range then it's dirty. A refresh should happen later.
+ if (fTimeGraphWrapper.getTimeGraphViewer().getTime0() != startTime || fTimeGraphWrapper.getTimeGraphViewer().getTime1() != endTime) {
+ return true;
+ }
+
+ if (fZoomThread == null) {
+ // The zoom thread is null but we might be just about to create it (refresh called).
+ return fDirty.get() != 0;
+ }
+ // Dirty if the zoom thread is not done or if it hasn't zoomed all the
+ // way to the end of the window range. In the latter case, there should be
+ // a subsequent zoom thread that will be triggered.
+ return fDirty.get() != 0 || fZoomThread.getZoomStartTime() != startTime || fZoomThread.getZoomEndTime() != endTime;