diff options
| author | 2017-08-10 22:09:13 +0000 | |
|---|---|---|
| committer | 2017-08-10 22:09:13 +0000 | |
| commit | 27140b03bfee16f3fdb70be42ff4fc132fc4c84a (patch) | |
| tree | dd3ef3a708ba7420b93f75d75ee241e485e77a45 /libs/hwui/DeviceInfo.cpp | |
| parent | 20933d045431c498ddaa975c75f93136f557b48f (diff) | |
| parent | eb43cdbc2e1187667a51cf21daac9e79e3678114 (diff) | |
Merge "Delete all ro.hwui.* props" into oc-mr1-dev
am: eb43cdbc2e
Change-Id: I4e3680df1f475bc6f15ff8c3ab0bdc8b887607a3
Diffstat (limited to 'libs/hwui/DeviceInfo.cpp')
| -rw-r--r-- | libs/hwui/DeviceInfo.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/libs/hwui/DeviceInfo.cpp b/libs/hwui/DeviceInfo.cpp index d180ba51b304..37965daf9a8d 100644 --- a/libs/hwui/DeviceInfo.cpp +++ b/libs/hwui/DeviceInfo.cpp @@ -16,7 +16,8 @@ #include <DeviceInfo.h> -#include "Extensions.h" +#include <gui/ISurfaceComposer.h> +#include <gui/SurfaceComposerClient.h> #include <thread> #include <mutex> @@ -46,13 +47,22 @@ void DeviceInfo::initialize() { void DeviceInfo::initialize(int maxTextureSize) { std::call_once(sInitializedFlag, [maxTextureSize]() { sDeviceInfo = new DeviceInfo(); + sDeviceInfo->loadDisplayInfo(); sDeviceInfo->mMaxTextureSize = maxTextureSize; }); } void DeviceInfo::load() { + loadDisplayInfo(); glGetIntegerv(GL_MAX_TEXTURE_SIZE, &mMaxTextureSize); } +void DeviceInfo::loadDisplayInfo() { + sp<IBinder> dtoken(SurfaceComposerClient::getBuiltInDisplay( + ISurfaceComposer::eDisplayIdMain)); + status_t status = SurfaceComposerClient::getDisplayInfo(dtoken, &mDisplayInfo); + LOG_ALWAYS_FATAL_IF(status, "Failed to get display info, error %d", status); +} + } /* namespace uirenderer */ } /* namespace android */ |