SF: Factor out expected present time computation

Compute expected present time once and pass it to traversed layers
instead of calling back into SF for each layer. This will simplify
synchronization for per-display refresh.

Also, recompute on Binder transaction, since the cached value computed
on invalidate may be stale.

Bug: 130554049
Bug: 123715322
Test: go/wm-smoke
Change-Id: I7153a728360e789dc4f97d2c39c4bdaa14183624
diff --git a/services/surfaceflinger/tests/unittests/CompositionTest.cpp b/services/surfaceflinger/tests/unittests/CompositionTest.cpp
index e6211c4..ce67a19 100644
--- a/services/surfaceflinger/tests/unittests/CompositionTest.cpp
+++ b/services/surfaceflinger/tests/unittests/CompositionTest.cpp
@@ -502,7 +502,7 @@
 
         EXPECT_CALL(*test->mRenderEngine, useNativeFenceSync()).WillRepeatedly(Return(true));
         bool ignoredRecomputeVisibleRegions;
-        layer->latchBuffer(ignoredRecomputeVisibleRegions, 0);
+        layer->latchBuffer(ignoredRecomputeVisibleRegions, 0, 0);
         Mock::VerifyAndClear(test->mRenderEngine);
     }