More WebView HDR plumbing

Pass through format for GL
and shouldDither if HWUI wants
dithering globally enabled

Fixes: 279030860
Test: make
Change-Id: Ic9e767fede8be9664bb87a340573e5f424d0de3e
diff --git a/libs/hwui/renderthread/CanvasContext.cpp b/libs/hwui/renderthread/CanvasContext.cpp
index f60c1f3..a73d7e4 100644
--- a/libs/hwui/renderthread/CanvasContext.cpp
+++ b/libs/hwui/renderthread/CanvasContext.cpp
@@ -1077,6 +1077,12 @@
     mHintSessionWrapper.init();
 }
 
+bool CanvasContext::shouldDither() {
+    CanvasContext* self = getActiveContext();
+    if (!self) return false;
+    return self->mColorMode != ColorMode::Default;
+}
+
 } /* namespace renderthread */
 } /* namespace uirenderer */
 } /* namespace android */