summaryrefslogtreecommitdiff
path: root/libs/hwui/DeviceInfo.cpp
diff options
context:
space:
mode:
authorAlec Mouri <alecmouri@google.com>2019-11-19 16:17:53 -0800
committerAlec Mouri <alecmouri@google.com>2019-12-26 10:11:40 -0800
commit4a818f189c910810d6be72147a4567d97ad7232a (patch)
treee81e496ccc971026d0d80e357882034bed606a5c /libs/hwui/DeviceInfo.cpp
parentbe8bafba54201866471cea3dd9e41ac1027b8f4c (diff)
[HWUI] use AChoreographer in place of DisplayEventReceiver.
Bug: 136262896 Test: builds, boots Test: scroll through settings app Test: Toggle between 60/90hz and observe systrace Change-Id: I8eef306a968525c55f3863ae688545faa43b23be
Diffstat (limited to 'libs/hwui/DeviceInfo.cpp')
-rw-r--r--libs/hwui/DeviceInfo.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/libs/hwui/DeviceInfo.cpp b/libs/hwui/DeviceInfo.cpp
index e53f3db08538..6d4a0c6421d9 100644
--- a/libs/hwui/DeviceInfo.cpp
+++ b/libs/hwui/DeviceInfo.cpp
@@ -52,8 +52,8 @@ void DeviceInfo::setMaxTextureSize(int maxTextureSize) {
DeviceInfo::get()->mMaxTextureSize = maxTextureSize;
}
-void DeviceInfo::onDisplayConfigChanged() {
- updateDisplayInfo();
+void DeviceInfo::onRefreshRateChanged(int64_t vsyncPeriod) {
+ mVsyncPeriod = vsyncPeriod;
}
void DeviceInfo::updateDisplayInfo() {
@@ -113,10 +113,11 @@ void DeviceInfo::updateDisplayInfo() {
ADisplay* primaryDisplay = mDisplays[mPhysicalDisplayIndex];
status_t status = ADisplay_getCurrentConfig(primaryDisplay, &mCurrentConfig);
LOG_ALWAYS_FATAL_IF(status, "Failed to get display config, error %d", status);
+
mWidth = ADisplayConfig_getWidth(mCurrentConfig);
mHeight = ADisplayConfig_getHeight(mCurrentConfig);
mDensity = ADisplayConfig_getDensity(mCurrentConfig);
- mRefreshRate = ADisplayConfig_getFps(mCurrentConfig);
+ mVsyncPeriod = static_cast<int64_t>(1000000000 / ADisplayConfig_getFps(mCurrentConfig));
mCompositorOffset = ADisplayConfig_getCompositorOffsetNanos(mCurrentConfig);
mAppOffset = ADisplayConfig_getAppVsyncOffsetNanos(mCurrentConfig);
}