From 4832745b84d6a358582f2264d22acacf25e01b07 Mon Sep 17 00:00:00 2001 From: Romain Guy Date: Mon, 23 Jan 2017 17:03:35 -0800 Subject: Add color mode to activity/window The color mode lets an application request a wide color gamut for a specific window. This will also be used in the future to request HDR. The color mode is currently either default (sRGB) or an undefined wide gamut color space chosen by the platform. These attributes could later be used to choose a specific color space if we deem this important or useful. This change also renames the various "colorimetry" attributes and constants to "color mode" for consistency. These symbols were added in O and can be safely renamed. Test: CtsColorModeTestCases Bug: 32984164 Change-Id: I4d4691dd12dbe3f3aa6a5cf893cff39aa16c739e --- tools/aapt/AaptConfig.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'tools/aapt/AaptConfig.cpp') diff --git a/tools/aapt/AaptConfig.cpp b/tools/aapt/AaptConfig.cpp index d0026a28ba16..0aca45ea8d60 100644 --- a/tools/aapt/AaptConfig.cpp +++ b/tools/aapt/AaptConfig.cpp @@ -267,8 +267,8 @@ void applyVersionForCompatibility(ConfigDescription* config) { uint16_t minSdk = 0; if ((config->uiMode & ResTable_config::MASK_UI_MODE_TYPE) == ResTable_config::UI_MODE_TYPE_VR_HEADSET - || config->colorimetry & ResTable_config::MASK_WIDE_COLOR_GAMUT - || config->colorimetry & ResTable_config::MASK_HDR) { + || config->colorMode & ResTable_config::MASK_WIDE_COLOR_GAMUT + || config->colorMode & ResTable_config::MASK_HDR) { minSdk = SDK_O; } else if (config->screenLayout2 & ResTable_config::MASK_SCREENROUND) { minSdk = SDK_MNC; @@ -451,18 +451,18 @@ bool parseScreenRound(const char* name, ResTable_config* out) { bool parseWideColorGamut(const char* name, ResTable_config* out) { if (strcmp(name, kWildcardName) == 0) { - if (out) out->colorimetry = - (out->colorimetry&~ResTable_config::MASK_WIDE_COLOR_GAMUT) + if (out) out->colorMode = + (out->colorMode&~ResTable_config::MASK_WIDE_COLOR_GAMUT) | ResTable_config::WIDE_COLOR_GAMUT_ANY; return true; } else if (strcmp(name, "widecg") == 0) { - if (out) out->colorimetry = - (out->colorimetry&~ResTable_config::MASK_WIDE_COLOR_GAMUT) + if (out) out->colorMode = + (out->colorMode&~ResTable_config::MASK_WIDE_COLOR_GAMUT) | ResTable_config::WIDE_COLOR_GAMUT_YES; return true; } else if (strcmp(name, "nowidecg") == 0) { - if (out) out->colorimetry = - (out->colorimetry&~ResTable_config::MASK_WIDE_COLOR_GAMUT) + if (out) out->colorMode = + (out->colorMode&~ResTable_config::MASK_WIDE_COLOR_GAMUT) | ResTable_config::WIDE_COLOR_GAMUT_NO; return true; } @@ -471,18 +471,18 @@ bool parseWideColorGamut(const char* name, ResTable_config* out) { bool parseHdr(const char* name, ResTable_config* out) { if (strcmp(name, kWildcardName) == 0) { - if (out) out->colorimetry = - (out->colorimetry&~ResTable_config::MASK_HDR) + if (out) out->colorMode = + (out->colorMode&~ResTable_config::MASK_HDR) | ResTable_config::HDR_ANY; return true; } else if (strcmp(name, "highdr") == 0) { - if (out) out->colorimetry = - (out->colorimetry&~ResTable_config::MASK_HDR) + if (out) out->colorMode = + (out->colorMode&~ResTable_config::MASK_HDR) | ResTable_config::HDR_YES; return true; } else if (strcmp(name, "lowdr") == 0) { - if (out) out->colorimetry = - (out->colorimetry&~ResTable_config::MASK_HDR) + if (out) out->colorMode = + (out->colorMode&~ResTable_config::MASK_HDR) | ResTable_config::HDR_NO; return true; } -- cgit v1.2.3-59-g8ed1b