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
diff --git a/services/surfaceflinger/DisplayHardware/DisplayMode.h b/services/surfaceflinger/DisplayHardware/DisplayMode.h
index 31d1245..1f0f3c3 100644
--- a/services/surfaceflinger/DisplayHardware/DisplayMode.h
+++ b/services/surfaceflinger/DisplayHardware/DisplayMode.h
@@ -86,8 +86,8 @@
return *this;
}
- Builder& setConfigGroup(int32_t configGroup) {
- mDisplayMode->mConfigGroup = configGroup;
+ Builder& setGroup(int32_t group) {
+ mDisplayMode->mGroup = group;
return *this;
}
@@ -119,7 +119,10 @@
nsecs_t getVsyncPeriod() const { return mFps.getPeriodNsecs(); }
float getDpiX() const { return mDpiX; }
float getDpiY() const { return mDpiY; }
- int32_t getConfigGroup() const { return mConfigGroup; }
+
+ // Switches between modes in the same group are seamless, i.e.
+ // without visual interruptions such as a black screen.
+ int32_t getGroup() const { return mGroup; }
private:
explicit DisplayMode(hal::HWConfigId id) : mHwcId(id) {}
@@ -132,15 +135,15 @@
Fps mFps;
float mDpiX = -1;
float mDpiY = -1;
- int32_t mConfigGroup = -1;
+ int32_t mGroup = -1;
};
inline std::string to_string(const DisplayMode& mode) {
return base::StringPrintf("{id=%zu, hwcId=%d, width=%d, height=%d, refreshRate=%s, "
- "dpiX=%.2f, dpiY=%.2f, configGroup=%d}",
+ "dpiX=%.2f, dpiY=%.2f, group=%d}",
mode.getId().value(), mode.getHwcId(), mode.getWidth(),
mode.getHeight(), to_string(mode.getFps()).c_str(), mode.getDpiX(),
- mode.getDpiY(), mode.getConfigGroup());
+ mode.getDpiY(), mode.getGroup());
}
} // namespace android
\ No newline at end of file