surfaceflinger: refresh after latching any buffer

We should not skip refresh when a latched buffer happens to have an
empty dirty region.  Also, we should signal a layer update when we
skip refresh.

Bug: 62752640
Test: manual
Change-Id: Ia603e7eeb37491c6ece7ea08d5d1e3b7ba93e6fa
diff --git a/services/surfaceflinger/Layer.h b/services/surfaceflinger/Layer.h
index 6ed372c..392479f 100644
--- a/services/surfaceflinger/Layer.h
+++ b/services/surfaceflinger/Layer.h
@@ -408,6 +408,7 @@
      * to figure out if the content or size of a surface has changed.
      */
     Region latchBuffer(bool& recomputeVisibleRegions, nsecs_t latchTime);
+    bool isBufferLatched() const { return mRefreshPending; }
 
     bool isPotentialCursor() const { return mPotentialCursor;}