Eliminate the usage of ConfigStore.

Ideally modules above SurfaceFlinger should query ConfigStore through
ISurfaceComposer APIs. Previously getWideColorSupport directly evaluate wide
color support for built-in display, we don't want that, we should align it with
SurfaceFlinger.

BUG: 123312783
Test: Build, flash and boot. Verify in logcat.
Change-Id: I6299fe1a5483075a98adbb903d3bb68255afb699
This commit is contained in:
Peiyong Lin
2019-01-24 17:49:46 -08:00
parent 1bbc8a56c4
commit 0d04f32385

View File

@@ -47,32 +47,13 @@ using Transaction = SurfaceComposerClient::Transaction;
static bool getWideColorSupport(const sp<SurfaceControl>& surfaceControl) {
sp<SurfaceComposerClient> client = surfaceControl->getClient();
sp<IBinder> display(client->getBuiltInDisplay(ISurfaceComposer::eDisplayIdMain));
Vector<ui::ColorMode> colorModes;
status_t err = client->getDisplayColorModes(display, &colorModes);
bool isWideColorDisplay = false;
status_t err = client->isWideColorDisplay(display, &isWideColorDisplay);
if (err) {
ALOGE("unable to get wide color support");
return false;
}
bool wideColorBoardConfig =
getBool<ISurfaceFlingerConfigs,
&ISurfaceFlingerConfigs::hasWideColorDisplay>(false);
for (android::ui::ColorMode colorMode : colorModes) {
switch (colorMode) {
case ui::ColorMode::DISPLAY_P3:
case ui::ColorMode::ADOBE_RGB:
case ui::ColorMode::DCI_P3:
if (wideColorBoardConfig) {
return true;
}
break;
default:
break;
}
}
return false;
return isWideColorDisplay;
}
static bool getHdrSupport(const sp<SurfaceControl>& surfaceControl) {