test-hwc2: set layer color

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: Ic280f91189a4d6ddd67a33901244714f3c0a46dd
diff --git a/services/surfaceflinger/tests/hwc2/Hwc2TestProperties.h b/services/surfaceflinger/tests/hwc2/Hwc2TestProperties.h
index 9df532e..870f1cc 100644
--- a/services/surfaceflinger/tests/hwc2/Hwc2TestProperties.h
+++ b/services/surfaceflinger/tests/hwc2/Hwc2TestProperties.h
@@ -123,19 +123,50 @@
 };
 
 
+class Hwc2TestColor;
+
 class Hwc2TestBlendMode : public Hwc2TestProperty<hwc2_blend_mode_t> {
 public:
     Hwc2TestBlendMode(Hwc2TestCoverage coverage);
 
     std::string dump() const override;
 
+    void setDependent(Hwc2TestColor* color);
+
 protected:
+    void updateDependents() override;
+
+    Hwc2TestColor* mColor = nullptr;
+
     static const std::vector<hwc2_blend_mode_t> mDefaultBlendModes;
     static const std::vector<hwc2_blend_mode_t> mBasicBlendModes;
     static const std::vector<hwc2_blend_mode_t> mCompleteBlendModes;
 };
 
 
+class Hwc2TestColor : public Hwc2TestProperty<hwc_color_t> {
+public:
+    Hwc2TestColor(Hwc2TestCoverage coverage,
+            hwc2_blend_mode_t blendMode = HWC2_BLEND_MODE_NONE);
+
+    std::string dump() const override;
+
+    void updateBlendMode(hwc2_blend_mode_t blendMode);
+
+protected:
+    void update();
+
+    std::vector<hwc_color_t> mBaseColors;
+    static const std::vector<hwc_color_t> mDefaultBaseColors;
+    static const std::vector<hwc_color_t> mBasicBaseColors;
+    static const std::vector<hwc_color_t> mCompleteBaseColors;
+
+    hwc2_blend_mode_t mBlendMode;
+
+    std::vector<hwc_color_t> mColors;
+};
+
+
 class Hwc2TestComposition : public Hwc2TestProperty<hwc2_composition_t> {
 public:
     Hwc2TestComposition(Hwc2TestCoverage coverage);