Break a dependency of libui on libandroid
This was only a header dependency, but it still
created a circular dependency, which will cause
problems in another CL.
We fix this by creating a libarect static library
containing only that header. both libui and
libandroid now depend on it and reexport the
header.
We also make sure rect.h ends-up in the right
place.
Test: built and booted device
Bug: 35164655
Change-Id: Iba25b8b801b26b26ec1401c00caf367a06f197ca
diff --git a/include/ui/Gralloc1On0Adapter.h b/include/ui/Gralloc1On0Adapter.h
index fcd2245..b09fdc6 100644
--- a/include/ui/Gralloc1On0Adapter.h
+++ b/include/ui/Gralloc1On0Adapter.h
@@ -17,9 +17,11 @@
#ifndef ANDROID_UI_GRALLOC_1_ON_0_ADAPTER_H
#define ANDROID_UI_GRALLOC_1_ON_0_ADAPTER_H
-#include <ui/Fence.h>
-#include <ui/GraphicBuffer.h>
+#include <log/log.h>
+#include <ui/Fence.h>
+
+#include <hardware/gralloc.h>
#include <hardware/gralloc1.h>
#include <mutex>
@@ -27,6 +29,10 @@
#include <unordered_map>
#include <vector>
+namespace android {
+class GraphicBuffer;
+} // namespace android
+
struct gralloc_module_t;
// This is not an "official" capability (i.e., it is not found in gralloc1.h),
diff --git a/include/ui/Rect.h b/include/ui/Rect.h
index ce33d4e..02c926e 100644
--- a/include/ui/Rect.h
+++ b/include/ui/Rect.h
@@ -45,13 +45,9 @@
template <typename T>
inline Rect(T w, T h) {
if (w > INT32_MAX) {
- ALOG(LOG_WARN, "Rect",
- "Width %u too large for Rect class, clamping", w);
w = INT32_MAX;
}
if (h > INT32_MAX) {
- ALOG(LOG_WARN, "Rect",
- "Height %u too large for Rect class, clamping", h);
h = INT32_MAX;
}
left = top = 0;