summaryrefslogtreecommitdiffstats
path: root/services/surfaceflinger/DisplayDevice.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'services/surfaceflinger/DisplayDevice.cpp')
-rw-r--r--services/surfaceflinger/DisplayDevice.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/services/surfaceflinger/DisplayDevice.cpp b/services/surfaceflinger/DisplayDevice.cpp
index a4b141233..946f0b365 100644
--- a/services/surfaceflinger/DisplayDevice.cpp
+++ b/services/surfaceflinger/DisplayDevice.cpp
@@ -489,9 +489,7 @@ status_t DisplayDevice::orientationToTransfrom(
uint32_t flags = 0;
if (mHardwareRotation && mType == DisplayType::DISPLAY_PRIMARY) {
- // Rotate such that accounting for hardware rotation puts the
- // buffer's rotation at 0 relative to the user.
- orientation += (4 - mHardwareRotation);
+ orientation += mHardwareRotation;
orientation %= 4;
}
@@ -550,7 +548,7 @@ void DisplayDevice::setProjection(int orientation,
if (!frame.isValid()) {
// the destination frame can be invalid if it has never been set,
// in that case we assume the whole display frame.
- if (mHardwareRotation & DisplayState::eOrientationSwapMask) {
+ if (mHardwareRotation == 1 || mHardwareRotation == 3) {
frame = Rect(h, w);
} else {
frame = Rect(w, h);