summaryrefslogtreecommitdiff
path: root/cmds/flatland/GLHelper.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 /cmds/flatland/GLHelper.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 'cmds/flatland/GLHelper.cpp')
-rw-r--r--cmds/flatland/GLHelper.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/cmds/flatland/GLHelper.cpp b/cmds/flatland/GLHelper.cpp
index 3a3df08534..01f7d30a42 100644
--- a/cmds/flatland/GLHelper.cpp
+++ b/cmds/flatland/GLHelper.cpp
@@ -19,7 +19,7 @@
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
#include <gui/SurfaceComposerClient.h>
-#include <ui/DisplayConfig.h>
+#include <ui/DisplayMode.h>
namespace android {
@@ -227,15 +227,15 @@ bool GLHelper::computeWindowScale(uint32_t w, uint32_t h, float* scale) {
return false;
}
- DisplayConfig config;
- status_t err = mSurfaceComposerClient->getActiveDisplayConfig(dpy, &config);
+ ui::DisplayMode mode;
+ status_t err = mSurfaceComposerClient->getActiveDisplayMode(dpy, &mode);
if (err != NO_ERROR) {
- fprintf(stderr, "SurfaceComposer::getActiveDisplayConfig failed: %#x\n", err);
+ fprintf(stderr, "SurfaceComposer::getActiveDisplayMode failed: %#x\n", err);
return false;
}
- float scaleX = static_cast<float>(config.resolution.getWidth()) / w;
- float scaleY = static_cast<float>(config.resolution.getHeight()) / h;
+ float scaleX = static_cast<float>(mode.resolution.getWidth()) / w;
+ float scaleY = static_cast<float>(mode.resolution.getHeight()) / h;
*scale = scaleX < scaleY ? scaleX : scaleY;
return true;