summaryrefslogtreecommitdiff
path: root/libs/hwui/RenderProperties.h
diff options
context:
space:
mode:
Diffstat (limited to 'libs/hwui/RenderProperties.h')
-rw-r--r--libs/hwui/RenderProperties.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/libs/hwui/RenderProperties.h b/libs/hwui/RenderProperties.h
index e6710cc8f950..24f6035b6708 100644
--- a/libs/hwui/RenderProperties.h
+++ b/libs/hwui/RenderProperties.h
@@ -16,7 +16,10 @@
#pragma once
+#ifdef __ANDROID__ // Layoutlib does not support device info
#include "DeviceInfo.h"
+#endif // __ANDROID__
+
#include "Outline.h"
#include "Rect.h"
#include "RevealClip.h"
@@ -526,9 +529,13 @@ public:
}
bool fitsOnLayer() const {
+#ifdef __ANDROID__ // Layoutlib does not support device info
const DeviceInfo* deviceInfo = DeviceInfo::get();
return mPrimitiveFields.mWidth <= deviceInfo->maxTextureSize() &&
mPrimitiveFields.mHeight <= deviceInfo->maxTextureSize();
+#else
+ return mPrimitiveFields.mWidth <= 4096 && mPrimitiveFields.mHeight <= 4096;
+#endif
}
bool promotedToLayer() const {