surfaceflinger: fix captureScreen for landscape LCM

Make DisplayRenderArea::getSourceCrop return the display scissor
when the source crop is empty.  Force the source crop to be empty in
captureScreen.  This makes sure the install orientation is applied
on the source crop once, not twice.

Bug: 113041375
Test: force primaryDisplayOrientation, rotate screen, and switch
      apps
Change-Id: I15006f867ff2d4a92ebccb1334ce59ab32abe69a
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 223a97b..3529741 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -5102,9 +5102,9 @@
         display = getDisplayDeviceLocked(displayToken);
         if (!display) return BAD_VALUE;
 
-        // set the source crop to the (projected) logical display viewport
-        // unconditionally until the framework is fixed
-        sourceCrop.set(display->getScissor());
+        // ignore sourceCrop (i.e., use the projected logical display
+        // viewport) until the framework is fixed
+        sourceCrop.clear();
 
         // set the requested width/height to the logical display viewport size
         // by default
@@ -5112,8 +5112,6 @@
             reqWidth = uint32_t(display->getViewport().width());
             reqHeight = uint32_t(display->getViewport().height());
         }
-
-        // XXX display->getInstallOrientation() is ignored
     }
 
     DisplayRenderArea renderArea(display, sourceCrop, reqWidth, reqHeight, renderAreaRotation);