ui: Deduplicate rotation types
Introduce ui::Rotation, replacing ISurfaceComposer::Rotation as well as
DISPLAY_ORIENTATION_* and DisplayState::eOrientation* constants.
libinput has widespread use of int32_t for orientation, so move
DISPLAY_ORIENTATION_* to input/DisplayViewport.h for now.
Bug: 144601064
Test: go/wm-smoke
Test: screencap
Change-Id: Ic4b8494e37c9d79c00d5b4be5eb88585f09efebf
diff --git a/services/surfaceflinger/SurfaceInterceptor.cpp b/services/surfaceflinger/SurfaceInterceptor.cpp
index 5e8910a..8e0462a 100644
--- a/services/surfaceflinger/SurfaceInterceptor.cpp
+++ b/services/surfaceflinger/SurfaceInterceptor.cpp
@@ -137,8 +137,8 @@
addDisplaySurfaceLocked(transaction, display.sequenceId, display.surface);
addDisplayLayerStackLocked(transaction, display.sequenceId, display.layerStack);
addDisplaySizeLocked(transaction, display.sequenceId, display.width, display.height);
- addDisplayProjectionLocked(transaction, display.sequenceId, display.orientation,
- display.viewport, display.frame);
+ addDisplayProjectionLocked(transaction, display.sequenceId, toRotationInt(display.orientation),
+ display.viewport, display.frame);
}
status_t SurfaceInterceptor::writeProtoFileLocked() {
@@ -467,8 +467,8 @@
addDisplaySizeLocked(transaction, sequenceId, state.width, state.height);
}
if (state.what & DisplayState::eDisplayProjectionChanged) {
- addDisplayProjectionLocked(transaction, sequenceId, state.orientation, state.viewport,
- state.frame);
+ addDisplayProjectionLocked(transaction, sequenceId, toRotationInt(state.orientation),
+ state.viewport, state.frame);
}
}