Get screencap working correctly in landscape mode
Bug: b/112869712
Test: adb shell screencap in all screen rotations
Change-Id: I62b38775f8253bea85a1870ad63cd27715754656
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 337f89d..9fdbdfd 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -4829,8 +4829,8 @@
sourceCrop.set(dispScissor);
// adb shell screencap will default reqWidth and reqHeight to zeros.
if (reqWidth == 0 || reqHeight == 0) {
- reqWidth = uint32_t(dispScissor.width());
- reqHeight = uint32_t(dispScissor.height());
+ reqWidth = uint32_t(display->getViewport().width());
+ reqHeight = uint32_t(display->getViewport().height());
}
}