diff options
Diffstat (limited to 'libs/hwui/DeviceInfo.h')
-rw-r--r-- | libs/hwui/DeviceInfo.h | 32 |
1 files changed, 10 insertions, 22 deletions
diff --git a/libs/hwui/DeviceInfo.h b/libs/hwui/DeviceInfo.h index 297b2664414b..595621573e6e 100644 --- a/libs/hwui/DeviceInfo.h +++ b/libs/hwui/DeviceInfo.h @@ -18,46 +18,34 @@ #include <ui/DisplayInfo.h> -#include "Extensions.h" #include "utils/Macros.h" namespace android { namespace uirenderer { +namespace renderthread { + class RenderThread; +} + class DeviceInfo { PREVENT_COPY_AND_ASSIGN(DeviceInfo); public: - // returns nullptr if DeviceInfo is not initialized yet - // Note this does not have a memory fence so it's up to the caller - // to use one if required. Normally this should not be necessary static const DeviceInfo* get(); - // only call this after GL has been initialized, or at any point if compiled - // with HWUI_NULL_GPU - static void initialize(); - static void initialize(int maxTextureSize); - - int maxTextureSize() const { return mMaxTextureSize; } + // this value is only valid after the GPU has been initialized and there is a valid graphics + // context or if you are using the HWUI_NULL_GPU + int maxTextureSize() const; const DisplayInfo& displayInfo() const { return mDisplayInfo; } - const Extensions& extensions() const { return mExtensions; } - - static uint32_t multiplyByResolution(uint32_t in) { - auto di = DeviceInfo::get()->displayInfo(); - return di.w * di.h * in; - } - - static DisplayInfo queryDisplayInfo(); private: - DeviceInfo() {} - ~DeviceInfo() {} + friend class renderthread::RenderThread; + static void setMaxTextureSize(int maxTextureSize); - void load(); + DeviceInfo(); int mMaxTextureSize; DisplayInfo mDisplayInfo; - Extensions mExtensions; }; } /* namespace uirenderer */ |