summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--services/surfaceflinger/SurfaceFlinger.cpp25
1 files changed, 14 insertions, 11 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index abd3a9efcc..a8680e2dd8 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -1020,18 +1020,8 @@ void SurfaceFlinger::setActiveColorModeInternal(const sp<DisplayDevice>& hw,
int32_t type = hw->getDisplayType();
ColorMode currentMode = hw->getActiveColorMode();
Dataspace currentDataSpace = hw->getCompositionDataSpace();
+ RenderIntent currentRenderIntent = hw->getActiveRenderIntent();
- if (mode == currentMode && dataSpace == currentDataSpace) {
- return;
- }
-
- if (type >= DisplayDevice::NUM_BUILTIN_DISPLAY_TYPES) {
- ALOGW("Trying to set config for virtual display");
- return;
- }
-
- hw->setActiveColorMode(mode);
- hw->setCompositionDataSpace(dataSpace);
// Natural Mode means it's color managed and the color must be right,
// thus we pick RenderIntent::COLORIMETRIC as render intent.
// Native Mode means the display is not color managed, and whichever
@@ -1046,6 +1036,19 @@ void SurfaceFlinger::setActiveColorModeInternal(const sp<DisplayDevice>& hw,
hw->getDisplayType() == DisplayDevice::DISPLAY_PRIMARY) {
renderIntent = RenderIntent::ENHANCE;
}
+
+ if (mode == currentMode && dataSpace == currentDataSpace &&
+ renderIntent == currentRenderIntent) {
+ return;
+ }
+
+ if (type >= DisplayDevice::NUM_BUILTIN_DISPLAY_TYPES) {
+ ALOGW("Trying to set config for virtual display");
+ return;
+ }
+
+ hw->setActiveColorMode(mode);
+ hw->setCompositionDataSpace(dataSpace);
hw->setActiveRenderIntent(renderIntent);
getHwComposer().setActiveColorMode(type, mode, renderIntent);