Remove hwcomposer2.h
Previously SurfaceFlinger codebase uses hwcomposer2.h, which contains a
bunch of types that are not versioned. The usage of hwcomposer2.h has
been causing static casting here and there. This patch removes the usage
of hwcompoer2.h, creates a Hal.h to capture all composer hal stuff that
the codebase relies on.
Bug: b/77585359
Test: atest libsurfaceflinger_unittest
Test: atest SurfaceFlinger_test
Test: atest libcompositionengine_test
Change-Id: If9dfeb2a4a2c2f9df0b3ed300bfaca22c463038e
diff --git a/services/surfaceflinger/CompositionEngine/include/compositionengine/LayerFECompositionState.h b/services/surfaceflinger/CompositionEngine/include/compositionengine/LayerFECompositionState.h
index d8ce629..8a9763b 100644
--- a/services/surfaceflinger/CompositionEngine/include/compositionengine/LayerFECompositionState.h
+++ b/services/surfaceflinger/CompositionEngine/include/compositionengine/LayerFECompositionState.h
@@ -33,13 +33,15 @@
#include <ui/GraphicBuffer.h>
#include <ui/GraphicTypes.h>
-#include "DisplayHardware/ComposerHal.h"
+#include "DisplayHardware/Hal.h"
// TODO(b/129481165): remove the #pragma below and fix conversion issues
#pragma clang diagnostic pop // ignored "-Wconversion"
namespace android::compositionengine {
+namespace hal = android::hardware::graphics::composer::hal;
+
// More complex metadata for this layer
struct GenericLayerMetadataEntry {
// True if the metadata may affect the composed result.
@@ -108,7 +110,7 @@
Region transparentRegionHint;
// The blend mode for this layer
- Hwc2::IComposerClient::BlendMode blendMode{Hwc2::IComposerClient::BlendMode::INVALID};
+ hal::BlendMode blendMode{hal::BlendMode::INVALID};
// The bounds of the layer in layer local coordinates
FloatRect geomLayerBounds;
@@ -145,7 +147,7 @@
*/
// The type of composition for this layer
- Hwc2::IComposerClient::Composition compositionType{Hwc2::IComposerClient::Composition::INVALID};
+ hal::Composition compositionType{hal::Composition::INVALID};
// The buffer and related state
sp<GraphicBuffer> buffer;