SF: Allow display layer clip bounds to be overriden

Add a new virtual call to get the display bounds (in layer space) when
used as the root clip rectangle for all layers, so that it can be
customized where needed.

The base functionality is not changed -- the display viewport is still
used as the clip rectangle.

Test: Builds
Bug: 154780821
Change-Id: I5a8c564cacd87e37d11128ab4742d9f2ee897bf2
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 811c660..37b2c2a 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -2364,6 +2364,10 @@
     }
 }
 
+FloatRect SurfaceFlinger::getLayerClipBoundsForDisplay(const DisplayDevice& displayDevice) const {
+    return displayDevice.getViewport().toFloatRect();
+}
+
 void SurfaceFlinger::computeLayerBounds() {
     for (const auto& pair : mDisplays) {
         const auto& displayDevice = pair.second;
@@ -2374,7 +2378,7 @@
                 continue;
             }
 
-            layer->computeBounds(displayDevice->getViewport().toFloatRect(), ui::Transform(),
+            layer->computeBounds(getLayerClipBoundsForDisplay(*displayDevice), ui::Transform(),
                                  0.f /* shadowRadius */);
         }
     }