Introduce DynamicDisplayInfo
In this CL we introduce the getDynamicDisplayInfo call
on ISurfaceComposer which replaces the existing
- getDisplayModes
- getActiveDisplayMode
- getColorModes
- getActiveColorMode
- getHdrCapabilities
This way all display properties can be queried atomically.
The current DisplayInfo class is moved to the androd::ui
namespace and it's renamed to StaticDisplayInfo.
ui::DisplayMode is now LightFlattenable and the mode ID is
int32_t instead of size_t in order to prevent serialization
problems.
Additionally we add the ID field to ui::DisplayMode. This
way we no longer need the supported display IDs to be
from 0 to N-1.
Bug: 159590486
Bug: 180539476
Test: presubmit, manually test that device boots
Change-Id: I52b170913ce47cb5df2e8417e6cc95d395df1fda
diff --git a/libs/gui/Surface.cpp b/libs/gui/Surface.cpp
index 07fc069..6de3e97 100644
--- a/libs/gui/Surface.cpp
+++ b/libs/gui/Surface.cpp
@@ -34,9 +34,9 @@
#include <utils/NativeHandle.h>
#include <ui/DisplayStatInfo.h>
+#include <ui/DynamicDisplayInfo.h>
#include <ui/Fence.h>
#include <ui/GraphicBuffer.h>
-#include <ui/HdrCapabilities.h>
#include <ui/Region.h>
#include <gui/BufferItem.h>
@@ -48,7 +48,6 @@
namespace android {
-using ui::ColorMode;
using ui::Dataspace;
namespace {
@@ -361,15 +360,12 @@
return NAME_NOT_FOUND;
}
- HdrCapabilities hdrCapabilities;
- status_t err =
- composerService()->getHdrCapabilities(display, &hdrCapabilities);
-
- if (err)
+ ui::DynamicDisplayInfo info;
+ if (status_t err = composerService()->getDynamicDisplayInfo(display, &info); err != NO_ERROR) {
return err;
+ }
- *supported = !hdrCapabilities.getSupportedHdrTypes().empty();
-
+ *supported = !info.hdrCapabilities.getSupportedHdrTypes().empty();
return NO_ERROR;
}