summaryrefslogtreecommitdiff
path: root/libs/hwui/RenderProperties.h
diff options
context:
space:
mode:
authorFedor Kudasov <kudasov@google.com>2019-06-18 15:51:57 +0100
committerFedor Kudasov <kudasov@google.com>2019-06-26 19:24:15 +0000
commit86bd214059cd6150304888a285941bf74af5b687 (patch)
tree229de6260978808d92746f678091300d3952fe9a /libs/hwui/RenderProperties.h
parentc8d53875644a3e607d12f582f851f41b2ee9e213 (diff)
Enable RenderNode and RecordingCanvas for layoutlib
Bug: 117921091 Test: all tests should pass Change-Id: I574b12a5f7a6a54cbbcb17c35a3884368fd404e6
Diffstat (limited to 'libs/hwui/RenderProperties.h')
-rw-r--r--libs/hwui/RenderProperties.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/libs/hwui/RenderProperties.h b/libs/hwui/RenderProperties.h
index e6710cc8f950..e9794489f171 100644
--- a/libs/hwui/RenderProperties.h
+++ b/libs/hwui/RenderProperties.h
@@ -526,9 +526,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 {