test-hwc2: set layer blend mode
Test: Add "#define HAVE_NO_SURFACE_FLINGER" to
frameworks/native/libs/gui/BufferQueueCore.cpp.
Recompile and flash.
Run "mm" in frameworks/native/services/surfaceflinger/tests/hwc2.
Push test-hwc2 to device.
Run "adb root && adb shell stop".
Run test case. Ex: "./test-hwc2"
Change-Id: Id5a7a568fb81ac9aff388d04077a12765cc135a3
diff --git a/services/surfaceflinger/tests/hwc2/Hwc2TestProperties.cpp b/services/surfaceflinger/tests/hwc2/Hwc2TestProperties.cpp
index ef399fd..ee0e8d4 100644
--- a/services/surfaceflinger/tests/hwc2/Hwc2TestProperties.cpp
+++ b/services/surfaceflinger/tests/hwc2/Hwc2TestProperties.cpp
@@ -18,10 +18,35 @@
#include "Hwc2TestProperties.h"
+Hwc2TestBlendMode::Hwc2TestBlendMode(Hwc2TestCoverage coverage)
+ : Hwc2TestProperty(coverage, mCompleteBlendModes, mBasicBlendModes,
+ mDefaultBlendModes) { }
+
+std::string Hwc2TestBlendMode::dump() const
+{
+ std::stringstream dmp;
+ dmp << "\tblend mode: " << getBlendModeName(get()) << "\n";
+ return dmp.str();
+}
+
+const std::vector<hwc2_blend_mode_t> Hwc2TestBlendMode::mDefaultBlendModes = {
+ HWC2_BLEND_MODE_NONE,
+};
+
+const std::vector<hwc2_blend_mode_t> Hwc2TestBlendMode::mBasicBlendModes = {
+ HWC2_BLEND_MODE_NONE,
+ HWC2_BLEND_MODE_PREMULTIPLIED,
+};
+
+const std::vector<hwc2_blend_mode_t> Hwc2TestBlendMode::mCompleteBlendModes = {
+ HWC2_BLEND_MODE_NONE,
+ HWC2_BLEND_MODE_PREMULTIPLIED,
+ HWC2_BLEND_MODE_COVERAGE,
+};
+
+
Hwc2TestComposition::Hwc2TestComposition(Hwc2TestCoverage coverage)
- : Hwc2TestProperty(
- (coverage == Hwc2TestCoverage::Complete)? mCompleteCompositions:
- (coverage == Hwc2TestCoverage::Basic)? mBasicCompositions:
+ : Hwc2TestProperty(coverage, mCompleteCompositions, mBasicCompositions,
mDefaultCompositions) { }
std::string Hwc2TestComposition::dump() const