Query composition engine for transform hint.
Some composition engines may want to use different transform and
transform hint. For example they may choose to delegate to another
compositor for composition, in which case they may not want SF to
transform layers and let the delegate compositor transform them. In the
meanwhile they also would like to provide the correct transform hint so
that the delgate compositor can still choose to use HW overlay when
display isn't in its natural orientation.
Bug: 170880203
Test: atest libcompositionengine_test
Change-Id: I600e78e47adc676632f4c59c74f4041abd553040
diff --git a/services/surfaceflinger/CompositionEngine/src/Output.cpp b/services/surfaceflinger/CompositionEngine/src/Output.cpp
index 04dceae..29595bd 100644
--- a/services/surfaceflinger/CompositionEngine/src/Output.cpp
+++ b/services/surfaceflinger/CompositionEngine/src/Output.cpp
@@ -192,6 +192,10 @@
dirtyEntireOutput();
}
+ui::Transform::RotationFlags Output::getTransformHint() const {
+ return static_cast<ui::Transform::RotationFlags>(getState().transform.getOrientation());
+}
+
void Output::setLayerStackFilter(uint32_t layerStackId, bool isInternal) {
auto& outputState = editState();
outputState.layerStackId = layerStackId;