From 9a48a8c84bf84dff2aaf51a011b5810d89dddc32 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Tue, 20 Feb 2018 14:27:30 -0800 Subject: surfaceflinger: simplify getActiveColorMode check When mForceNativeColorMode is true, getActiveColorMode returns HAL_COLOR_MODE_NATIVE. There is no need to check both. Test: manual with UiBench Change-Id: I3bbf66d85ccb262441b9d216096ec869c529b7e8 --- services/surfaceflinger/SurfaceFlinger.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'services/surfaceflinger/SurfaceFlinger.cpp') diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index 87fd2f1e72..c8025b37c5 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -2739,7 +2739,7 @@ bool SurfaceFlinger::doComposeSurfaces(const sp& displayDev ALOGV("hasClientComposition"); android_dataspace outputDataspace = HAL_DATASPACE_UNKNOWN; - if (!mForceNativeColorMode && displayDevice->getWideColorSupport() && + if (displayDevice->getWideColorSupport() && displayDevice->getActiveColorMode() == HAL_COLOR_MODE_DISPLAY_P3) { outputDataspace = HAL_DATASPACE_DISPLAY_P3; } @@ -4600,7 +4600,7 @@ void SurfaceFlinger::renderScreenImplLocked(const RenderArea& renderArea, } android_dataspace outputDataspace = HAL_DATASPACE_UNKNOWN; - if (!mForceNativeColorMode && renderArea.getWideColorSupport() && + if (renderArea.getWideColorSupport() && renderArea.getActiveColorMode() == HAL_COLOR_MODE_DISPLAY_P3) { outputDataspace = HAL_DATASPACE_DISPLAY_P3; } -- cgit v1.2.3-59-g8ed1b