summaryrefslogtreecommitdiff
path: root/libs/gui/SurfaceComposerClient.cpp
diff options
context:
space:
mode:
author Marin Shalamanov <shalamanov@google.com> 2021-01-29 21:02:08 +0100
committer Marin Shalamanov <shalamanov@google.com> 2021-02-05 20:50:20 +0100
commita7fe3048aaaf8a45337c7355326f2c6b68b70fb0 (patch)
tree8c784e9a818c84f8e5f5953a41edc20b4f0f0abe /libs/gui/SurfaceComposerClient.cpp
parentc00282a5df6e7c00bec0befcb98fd4ae9e33da43 (diff)
Rename DisplayConfig to DisplayMode
This CL continues the raneming of display "configs" to display "modes". The goal of this is to have the same names as in the java code and the public display APIs. Additionally in this CL we move DisplayConfig (from libui) to the namespace android::ui. This is to prevent conflict with the SurfaceFlinger's internal android::DisplayMode. This is consistent with the neighboring classes which are also in the ui namespace. Also the type of the parameter defaultMode of {s,g}etDesiredDisplayModeSpecs is changed to size_t for consistency with the rest of the code. Appropriate error handling is added for this. Bug: 159590486 Bug: 179158858 Test: presubmit Change-Id: I31e5be1f2223a9ec9340789ce3dc5738eceaf40f
Diffstat (limited to 'libs/gui/SurfaceComposerClient.cpp')
-rw-r--r--libs/gui/SurfaceComposerClient.cpp47
1 files changed, 23 insertions, 24 deletions
diff --git a/libs/gui/SurfaceComposerClient.cpp b/libs/gui/SurfaceComposerClient.cpp
index 550803d453..4493a21fc3 100644
--- a/libs/gui/SurfaceComposerClient.cpp
+++ b/libs/gui/SurfaceComposerClient.cpp
@@ -39,7 +39,7 @@
#include <gui/LayerState.h>
#include <gui/Surface.h>
#include <gui/SurfaceComposerClient.h>
-#include <ui/DisplayConfig.h>
+#include <ui/DisplayMode.h>
#ifndef NO_INPUT
#include <input/InputWindow.h>
@@ -1802,52 +1802,51 @@ status_t SurfaceComposerClient::getDisplayInfo(const sp<IBinder>& display, Displ
return ComposerService::getComposerService()->getDisplayInfo(display, info);
}
-status_t SurfaceComposerClient::getDisplayConfigs(const sp<IBinder>& display,
- Vector<DisplayConfig>* configs) {
- return ComposerService::getComposerService()->getDisplayConfigs(display, configs);
+status_t SurfaceComposerClient::getDisplayModes(const sp<IBinder>& display,
+ Vector<ui::DisplayMode>* modes) {
+ return ComposerService::getComposerService()->getDisplayModes(display, modes);
}
-status_t SurfaceComposerClient::getActiveDisplayConfig(const sp<IBinder>& display,
- DisplayConfig* config) {
- Vector<DisplayConfig> configs;
- status_t result = getDisplayConfigs(display, &configs);
+status_t SurfaceComposerClient::getActiveDisplayMode(const sp<IBinder>& display,
+ ui::DisplayMode* mode) {
+ Vector<ui::DisplayMode> modes;
+ status_t result = getDisplayModes(display, &modes);
if (result != NO_ERROR) {
return result;
}
- int activeId = getActiveConfig(display);
+ int activeId = getActiveDisplayModeId(display);
if (activeId < 0) {
- ALOGE("No active configuration found");
+ ALOGE("No active mode found");
return NAME_NOT_FOUND;
}
- *config = configs[static_cast<size_t>(activeId)];
+ *mode = modes[static_cast<size_t>(activeId)];
return NO_ERROR;
}
-int SurfaceComposerClient::getActiveConfig(const sp<IBinder>& display) {
- return ComposerService::getComposerService()->getActiveConfig(display);
+int SurfaceComposerClient::getActiveDisplayModeId(const sp<IBinder>& display) {
+ return ComposerService::getComposerService()->getActiveDisplayModeId(display);
}
-status_t SurfaceComposerClient::setDesiredDisplayConfigSpecs(
- const sp<IBinder>& displayToken, int32_t defaultConfig, bool allowGroupSwitching,
+status_t SurfaceComposerClient::setDesiredDisplayModeSpecs(
+ const sp<IBinder>& displayToken, size_t defaultMode, bool allowGroupSwitching,
float primaryRefreshRateMin, float primaryRefreshRateMax, float appRequestRefreshRateMin,
float appRequestRefreshRateMax) {
return ComposerService::getComposerService()
- ->setDesiredDisplayConfigSpecs(displayToken, defaultConfig, allowGroupSwitching,
- primaryRefreshRateMin, primaryRefreshRateMax,
- appRequestRefreshRateMin, appRequestRefreshRateMax);
+ ->setDesiredDisplayModeSpecs(displayToken, defaultMode, allowGroupSwitching,
+ primaryRefreshRateMin, primaryRefreshRateMax,
+ appRequestRefreshRateMin, appRequestRefreshRateMax);
}
-status_t SurfaceComposerClient::getDesiredDisplayConfigSpecs(
- const sp<IBinder>& displayToken, int32_t* outDefaultConfig, bool* outAllowGroupSwitching,
+status_t SurfaceComposerClient::getDesiredDisplayModeSpecs(
+ const sp<IBinder>& displayToken, size_t* outDefaultMode, bool* outAllowGroupSwitching,
float* outPrimaryRefreshRateMin, float* outPrimaryRefreshRateMax,
float* outAppRequestRefreshRateMin, float* outAppRequestRefreshRateMax) {
return ComposerService::getComposerService()
- ->getDesiredDisplayConfigSpecs(displayToken, outDefaultConfig, outAllowGroupSwitching,
- outPrimaryRefreshRateMin, outPrimaryRefreshRateMax,
- outAppRequestRefreshRateMin,
- outAppRequestRefreshRateMax);
+ ->getDesiredDisplayModeSpecs(displayToken, outDefaultMode, outAllowGroupSwitching,
+ outPrimaryRefreshRateMin, outPrimaryRefreshRateMax,
+ outAppRequestRefreshRateMin, outAppRequestRefreshRateMax);
}
status_t SurfaceComposerClient::getDisplayColorModes(const sp<IBinder>& display,