Forward input windows from SurfaceFlinger to InputDispatcher.

We re-use values from visible region computation to fill in
the frames, ensuring input always reflects the most recent
state of the scene.

Test: Extensive manual testing. Existing tests pass.
Bug: 80101428
Bug: 113136004
Bug: 111440400
Change-Id: I9908a1bd6cba6abf16f2f6a43b6fe63f07a124a6
diff --git a/services/surfaceflinger/Layer.h b/services/surfaceflinger/Layer.h
index ed51c61..fe8d5a9 100644
--- a/services/surfaceflinger/Layer.h
+++ b/services/surfaceflinger/Layer.h
@@ -22,6 +22,7 @@
 #include <gui/BufferQueue.h>
 #include <gui/ISurfaceComposerClient.h>
 #include <gui/LayerState.h>
+#include <input/InputWindow.h>
 #include <layerproto/LayerProtoHeader.h>
 #include <math/vec4.h>
 #include <renderengine/Mesh.h>
@@ -109,6 +110,7 @@
     enum { // flags for doTransaction()
         eDontUpdateGeometryState = 0x00000001,
         eVisibleRegion = 0x00000002,
+        eInputInfoChanged = 0x00000004
     };
 
     struct Geometry {
@@ -166,6 +168,9 @@
 
         half4 color;
 
+        bool inputInfoChanged;
+        InputWindowInfo inputInfo;
+
         // The fields below this point are only used by BufferStateLayer
         Geometry active;
 
@@ -708,6 +713,10 @@
     bool getPremultipledAlpha() const;
 
     bool mPendingHWCDestroy{false};
+    void setInputInfo(const InputWindowInfo& info);
+
+    InputWindowInfo fillInputInfo(const Rect& screenBounds);
+    bool hasInput() const;
 
 protected:
     // -----------------------------------------------------------------------