HWC2: Clear transform for SolidColor layers
Clears the transform for SolidColor layers, since it doesn't make sense
to transform layers without a buffer.
Bug: 30429522
Change-Id: Ib2f4889531556c7ab00e3b270319c321e9f32c84
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp
index e78da96..2a3c229 100644
--- a/services/surfaceflinger/Layer.cpp
+++ b/services/surfaceflinger/Layer.cpp
@@ -732,11 +732,22 @@
// SolidColor layers
if (mActiveBuffer == nullptr) {
setCompositionType(hwcId, HWC2::Composition::SolidColor);
+
+ // For now, we only support black for DimLayer
error = hwcLayer->setColor({0, 0, 0, 255});
if (error != HWC2::Error::None) {
ALOGE("[%s] Failed to set color: %s (%d)", mName.string(),
to_string(error).c_str(), static_cast<int32_t>(error));
}
+
+ // Clear out the transform, because it doesn't make sense absent a
+ // source buffer
+ error = hwcLayer->setTransform(HWC2::Transform::None);
+ if (error != HWC2::Error::None) {
+ ALOGE("[%s] Failed to clear transform: %s (%d)", mName.string(),
+ to_string(error).c_str(), static_cast<int32_t>(error));
+ }
+
return;
}