summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2021-12-29 11:10:33 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2021-12-29 11:10:33 +0000
commit24d03931c6cf76382723cce3e473b484bed7c4bf (patch)
tree96658d0134bb44a3a98cb733c29acded4fb58424
parentbc7501b5187b8a82512b6ee7219fd6af7ed2fb04 (diff)
parent9e828ba7315f35cb4b85e1635cebbf851260ad78 (diff)
Snap for 8033464 from 9e828ba7315f35cb4b85e1635cebbf851260ad78 to s-keystone-qcom-release
Change-Id: I45cb30afdb0b0e5d5471766c9d740719445b7ba1
-rw-r--r--services/surfaceflinger/CompositionEngine/include/compositionengine/impl/Display.h2
-rw-r--r--services/surfaceflinger/CompositionEngine/src/Display.cpp11
2 files changed, 12 insertions, 1 deletions
diff --git a/services/surfaceflinger/CompositionEngine/include/compositionengine/impl/Display.h b/services/surfaceflinger/CompositionEngine/include/compositionengine/impl/Display.h
index e3558cd3e5..9e1abf0fd1 100644
--- a/services/surfaceflinger/CompositionEngine/include/compositionengine/impl/Display.h
+++ b/services/surfaceflinger/CompositionEngine/include/compositionengine/impl/Display.h
@@ -93,6 +93,8 @@ private:
composer::DisplayExtnIntf *mDisplayExtnIntf = nullptr;
void beginDraw();
void endDraw();
+ ColorProfile mColorProfile = {ui::ColorMode::NATIVE, ui::Dataspace::UNKNOWN,
+ ui::RenderIntent::COLORIMETRIC, ui::Dataspace::UNKNOWN};
};
// This template factory function standardizes the implementation details of the
diff --git a/services/surfaceflinger/CompositionEngine/src/Display.cpp b/services/surfaceflinger/CompositionEngine/src/Display.cpp
index 0a30928947..4850e2893e 100644
--- a/services/surfaceflinger/CompositionEngine/src/Display.cpp
+++ b/services/surfaceflinger/CompositionEngine/src/Display.cpp
@@ -146,7 +146,16 @@ void Display::setColorProfile(const ColorProfile& colorProfile) {
const auto physicalId = PhysicalDisplayId::tryCast(mId);
LOG_FATAL_IF(!physicalId);
- mIsColorModeChanged = true;
+ if (colorProfile.mode != mColorProfile.mode ||
+ colorProfile.dataspace != mColorProfile.dataspace ||
+ colorProfile.renderIntent != mColorProfile.renderIntent) {
+ mIsColorModeChanged = true;
+ }
+
+ mColorProfile.mode = colorProfile.mode;
+ mColorProfile.dataspace = colorProfile.dataspace;
+ mColorProfile.renderIntent = colorProfile.renderIntent;
+ mColorProfile.colorSpaceAgnosticDataspace = colorProfile.colorSpaceAgnosticDataspace;
getCompositionEngine().getHwComposer().setActiveColorMode(*physicalId, colorProfile.mode,
colorProfile.renderIntent);