From d5fa1dcff518772b0f72d5a8141bc8a58ff01a0c Mon Sep 17 00:00:00 2001 From: Alec Mouri Date: Mon, 6 Apr 2020 13:15:28 -0700 Subject: Plumb display density to HWUI through ActivityThread. Whenever an activity's configuration is updated, then tell HardwareRenderer about it. That way, visualizating frame info does not need to learn the display density from SurfaceFlinger, which reduces the native-side api surface for displays. For now, this method is kept hidden and will be stabilized when HardwareRenderer's apis are stabilized for Mainline inclusion. Bug: 146387012 Test: boots, builds Test: jank visualizer Change-Id: I51d2964bb78882516ebdff05b80819814894bdce --- libs/hwui/DeviceInfo.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'libs/hwui/DeviceInfo.cpp') diff --git a/libs/hwui/DeviceInfo.cpp b/libs/hwui/DeviceInfo.cpp index c24224cbbd67..1c947a70f32f 100644 --- a/libs/hwui/DeviceInfo.cpp +++ b/libs/hwui/DeviceInfo.cpp @@ -113,11 +113,12 @@ void DeviceInfo::updateDisplayInfo() { mWidth = ADisplayConfig_getWidth(mCurrentConfig); mHeight = ADisplayConfig_getHeight(mCurrentConfig); - mDensity = ADisplayConfig_getDensity(mCurrentConfig); mVsyncPeriod = static_cast(1000000000 / ADisplayConfig_getFps(mCurrentConfig)); mCompositorOffset = ADisplayConfig_getCompositorOffsetNanos(mCurrentConfig); mAppOffset = ADisplayConfig_getAppVsyncOffsetNanos(mCurrentConfig); } +std::atomic DeviceInfo::sDensity = 2.0; + } /* namespace uirenderer */ } /* namespace android */ -- cgit v1.2.3-59-g8ed1b