summaryrefslogtreecommitdiff
path: root/libs/hwui/DeviceInfo.h
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.h
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.h')
-rw-r--r--libs/hwui/DeviceInfo.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/libs/hwui/DeviceInfo.h b/libs/hwui/DeviceInfo.h
index a4207460883e..16a22f4706f5 100644
--- a/libs/hwui/DeviceInfo.h
+++ b/libs/hwui/DeviceInfo.h
@@ -37,7 +37,7 @@ public:
static int32_t getWidth() { return get()->mWidth; }
static int32_t getHeight() { return get()->mHeight; }
static float getDensity() { return get()->mDensity; }
- static float getRefreshRate() { return get()->mRefreshRate; }
+ static int64_t getVsyncPeriod() { return get()->mVsyncPeriod; }
static int64_t getCompositorOffset() { return get()->mCompositorOffset; }
static int64_t getAppOffset() { return get()->mAppOffset; }
@@ -47,7 +47,8 @@ public:
sk_sp<SkColorSpace> getWideColorSpace() const { return mWideColorSpace; }
SkColorType getWideColorType() const { return mWideColorType; }
- void onDisplayConfigChanged();
+ // This method should be called whenever the display refresh rate changes.
+ void onRefreshRateChanged(int64_t vsyncPeriod);
private:
friend class renderthread::RenderThread;
@@ -68,7 +69,7 @@ private:
int32_t mWidth = 1080;
int32_t mHeight = 1920;
float mDensity = 2.0;
- float mRefreshRate = 60.0;
+ int64_t mVsyncPeriod = 16666666;
int64_t mCompositorOffset = 0;
int64_t mAppOffset = 0;
};