Force-enable dithering in wide gamut & HDR

Fixes: 276779571
Test: SilkFX gradient sweep
Change-Id: I26907913feb216e43bbbc735878d12311735c3af
diff --git a/libs/hwui/renderthread/VulkanSurface.cpp b/libs/hwui/renderthread/VulkanSurface.cpp
index 21b6c44..ae4f057 100644
--- a/libs/hwui/renderthread/VulkanSurface.cpp
+++ b/libs/hwui/renderthread/VulkanSurface.cpp
@@ -530,6 +530,16 @@
     }
 }
 
+bool VulkanSurface::isBeyond8Bit() const {
+    switch (mWindowInfo.bufferFormat) {
+        case AHARDWAREBUFFER_FORMAT_R10G10B10A2_UNORM:
+        case AHARDWAREBUFFER_FORMAT_R16G16B16A16_FLOAT:
+            return true;
+        default:
+            return false;
+    }
+}
+
 } /* namespace renderthread */
 } /* namespace uirenderer */
 } /* namespace android */
diff --git a/libs/hwui/renderthread/VulkanSurface.h b/libs/hwui/renderthread/VulkanSurface.h
index e2ddc6b..3b69b73 100644
--- a/libs/hwui/renderthread/VulkanSurface.h
+++ b/libs/hwui/renderthread/VulkanSurface.h
@@ -48,6 +48,8 @@
 
     void setColorSpace(sk_sp<SkColorSpace> colorSpace);
 
+    bool isBeyond8Bit() const;
+
 private:
     /*
      * All structs/methods in this private section are specifically for use by the VulkanManager