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/RenderArea.h b/services/surfaceflinger/RenderArea.h
index 532572f..a7a6dd5 100644
--- a/services/surfaceflinger/RenderArea.h
+++ b/services/surfaceflinger/RenderArea.h
@@ -17,13 +17,15 @@
// physical render area.
class RenderArea {
public:
+ using RotationFlags = ui::Transform::RotationFlags;
+
enum class CaptureFill {CLEAR, OPAQUE};
static float getCaptureFillValue(CaptureFill captureFill);
RenderArea(uint32_t reqWidth, uint32_t reqHeight, CaptureFill captureFill,
ui::Dataspace reqDataSpace, const Rect& displayViewport,
- ui::Transform::orientation_flags rotation = ui::Transform::ROT_0)
+ RotationFlags rotation = ui::Transform::ROT_0)
: mReqWidth(reqWidth),
mReqHeight(reqHeight),
mReqDataSpace(reqDataSpace),
@@ -66,20 +68,20 @@
virtual Rect getSourceCrop() const = 0;
// Returns the rotation of the source crop and the layers.
- ui::Transform::orientation_flags getRotationFlags() const { return mRotationFlags; };
+ RotationFlags getRotationFlags() const { return mRotationFlags; }
// Returns the size of the physical render area.
- int getReqWidth() const { return mReqWidth; };
- int getReqHeight() const { return mReqHeight; };
+ int getReqWidth() const { return mReqWidth; }
+ int getReqHeight() const { return mReqHeight; }
// Returns the composition data space of the render area.
ui::Dataspace getReqDataSpace() const { return mReqDataSpace; }
// Returns the fill color of the physical render area. Regions not
// covered by any rendered layer should be filled with this color.
- CaptureFill getCaptureFill() const { return mCaptureFill; };
+ CaptureFill getCaptureFill() const { return mCaptureFill; }
- virtual const sp<const DisplayDevice> getDisplayDevice() const = 0;
+ virtual sp<const DisplayDevice> getDisplayDevice() const = 0;
// Returns the source display viewport.
const Rect& getDisplayViewport() const { return mDisplayViewport; }
@@ -89,7 +91,7 @@
const uint32_t mReqHeight;
const ui::Dataspace mReqDataSpace;
const CaptureFill mCaptureFill;
- const ui::Transform::orientation_flags mRotationFlags;
+ const RotationFlags mRotationFlags;
const Rect mDisplayViewport;
};