Track ADataSpace naming adjustments

Test: make
Bug: 315475131
Change-Id: Ieb8ec0065b1b6ce165e43b1f539ccb1238ceb747
diff --git a/libs/hwui/renderthread/EglManager.cpp b/libs/hwui/renderthread/EglManager.cpp
index 94f35fd..facf30b 100644
--- a/libs/hwui/renderthread/EglManager.cpp
+++ b/libs/hwui/renderthread/EglManager.cpp
@@ -37,6 +37,9 @@
 // Android-specific addition that is used to show when frames began in systrace
 EGLAPI void EGLAPIENTRY eglBeginFrame(EGLDisplay dpy, EGLSurface surface);
 
+static constexpr auto P3_XRB = static_cast<android_dataspace>(
+        ADATASPACE_STANDARD_DCI_P3 | ADATASPACE_TRANSFER_SRGB | ADATASPACE_RANGE_EXTENDED);
+
 namespace android {
 namespace uirenderer {
 namespace renderthread {
@@ -497,9 +500,7 @@
         // This relies on knowing that EGL will not re-set the dataspace after the call to
         // eglCreateWindowSurface. Since the handling of the colorspace extension is largely
         // implemented in libEGL in the platform, we can safely assume this is the case
-        int32_t err = ANativeWindow_setBuffersDataSpace(
-                window,
-                static_cast<android_dataspace>(STANDARD_DCI_P3 | TRANSFER_SRGB | RANGE_EXTENDED));
+        int32_t err = ANativeWindow_setBuffersDataSpace(window, P3_XRB);
         LOG_ALWAYS_FATAL_IF(err, "Failed to ANativeWindow_setBuffersDataSpace %d", err);
     }
 
diff --git a/libs/hwui/renderthread/VulkanSurface.cpp b/libs/hwui/renderthread/VulkanSurface.cpp
index 20b743b..a8e8547 100644
--- a/libs/hwui/renderthread/VulkanSurface.cpp
+++ b/libs/hwui/renderthread/VulkanSurface.cpp
@@ -29,6 +29,9 @@
 namespace uirenderer {
 namespace renderthread {
 
+static constexpr auto P3_XRB = static_cast<android_dataspace>(
+        ADATASPACE_STANDARD_DCI_P3 | ADATASPACE_TRANSFER_SRGB | ADATASPACE_RANGE_EXTENDED);
+
 static int InvertTransform(int transform) {
     switch (transform) {
         case ANATIVEWINDOW_TRANSFORM_ROTATE_90:
@@ -214,8 +217,7 @@
     outWindowInfo->colorMode = colorMode;
 
     if (colorMode == ColorMode::Hdr || colorMode == ColorMode::Hdr10) {
-        outWindowInfo->dataspace =
-                static_cast<android_dataspace>(STANDARD_DCI_P3 | TRANSFER_SRGB | RANGE_EXTENDED);
+        outWindowInfo->dataspace = P3_XRB;
     } else {
         outWindowInfo->dataspace = ColorSpaceToADataSpace(colorSpace.get(), colorType);
     }
@@ -541,8 +543,7 @@
     }
 
     if (mWindowInfo.colorMode == ColorMode::Hdr || mWindowInfo.colorMode == ColorMode::Hdr10) {
-        mWindowInfo.dataspace =
-                static_cast<android_dataspace>(STANDARD_DCI_P3 | TRANSFER_SRGB | RANGE_EXTENDED);
+        mWindowInfo.dataspace = P3_XRB;
     } else {
         mWindowInfo.dataspace = ColorSpaceToADataSpace(
                 mWindowInfo.colorspace.get(), BufferFormatToColorType(mWindowInfo.bufferFormat));