android: Ensure required features enabled for SurfaceControl.

Enable AImageReader and VizDisplayCompositor if SurfaceControl is
enabled.

Bug: 889328
Change-Id: Ief585c25563c9224cb9c8f77dccb4c6eb1548135
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1504225
Commit-Queue: Khushal <[email protected]>
Auto-Submit: Khushal <[email protected]>
Reviewed-by: Antoine Labour <[email protected]>
Reviewed-by: Frank Liberato <[email protected]>
Cr-Commit-Position: refs/heads/master@{#637922}
diff --git a/gpu/config/gpu_finch_features.cc b/gpu/config/gpu_finch_features.cc
index 087c594..168f361 100644
--- a/gpu/config/gpu_finch_features.cc
+++ b/gpu/config/gpu_finch_features.cc
@@ -3,6 +3,10 @@
 // found in the LICENSE file.
 #include "gpu/config/gpu_finch_features.h"
 
+#if defined(OS_ANDROID)
+#include "ui/gl/android/android_surface_control_compat.h"
+#endif
+
 namespace features {
 #if defined(OS_ANDROID)
 // Use android AImageReader when playing videos with MediaPlayer.
@@ -74,4 +78,11 @@
 const base::Feature kVaapiJpegImageDecodeAcceleration{
     "VaapiJpegImageDecodeAcceleration", base::FEATURE_DISABLED_BY_DEFAULT};
 
+#if defined(OS_ANDROID)
+bool IsAndroidSurfaceControlEnabled() {
+  return base::FeatureList::IsEnabled(kAndroidSurfaceControl) &&
+         gl::SurfaceControl::IsSupported();
+}
+#endif
+
 }  // namespace features