From 718f9601c611f657fd872f84f27d5cc9aec533b4 Mon Sep 17 00:00:00 2001 From: Dominik Laskowski Date: Sat, 9 Nov 2019 20:01:35 -0800 Subject: 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 --- services/surfaceflinger/RegionSamplingThread.cpp | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) (limited to 'services/surfaceflinger/RegionSamplingThread.cpp') diff --git a/services/surfaceflinger/RegionSamplingThread.cpp b/services/surfaceflinger/RegionSamplingThread.cpp index a484373caa..73de4f8b78 100644 --- a/services/surfaceflinger/RegionSamplingThread.cpp +++ b/services/surfaceflinger/RegionSamplingThread.cpp @@ -337,19 +337,7 @@ void RegionSamplingThread::captureSample() { } const auto device = mFlinger.getDefaultDisplayDevice(); - const auto orientation = [](uint32_t orientation) { - switch (orientation) { - default: - case DisplayState::eOrientationDefault: - return ui::Transform::ROT_0; - case DisplayState::eOrientation90: - return ui::Transform::ROT_90; - case DisplayState::eOrientation180: - return ui::Transform::ROT_180; - case DisplayState::eOrientation270: - return ui::Transform::ROT_270; - } - }(device->getOrientation()); + const auto orientation = ui::Transform::toRotationFlags(device->getOrientation()); std::vector descriptors; Region sampleRegion; -- cgit v1.2.3-59-g8ed1b