Build native android graphics library for desktop
The purpose of this is to be able to use the native graphics code from
the Android platform directly in Android Studio (running on desktop) to
do layout rendering.
This creates a host library that is a subset of libandroid_runtime
including only the JNI files relevant to Android graphics. It also
includes LayoutlibLoader.cpp which is used to load the JNI when using
it as part of layoutlib (the graphics library for Android Studio).
This also creates libhwui-host, a host library that is a subset of
libhwui.
Bug: 117921091
Test: lunch sdk && m libandroid_runtime
Change-Id: I3850020d2d4c13c85e377476bc463d3eb6a01c6d
diff --git a/libs/hwui/renderthread/CacheManager.h b/libs/hwui/renderthread/CacheManager.h
index 9a5a00f..ad251f2 100644
--- a/libs/hwui/renderthread/CacheManager.h
+++ b/libs/hwui/renderthread/CacheManager.h
@@ -17,7 +17,9 @@
#ifndef CACHEMANAGER_H
#define CACHEMANAGER_H
+#ifdef __ANDROID__ // Layoutlib does not support hardware acceleration
#include <GrContext.h>
+#endif
#include <SkSurface.h>
#include <ui/DisplayInfo.h>
#include <utils/String8.h>
@@ -42,7 +44,9 @@
public:
enum class TrimMemoryMode { Complete, UiHidden };
+#ifdef __ANDROID__ // Layoutlib does not support hardware acceleration
void configureContext(GrContextOptions* context, const void* identity, ssize_t size);
+#endif
void trimMemory(TrimMemoryMode mode);
void trimStaleResources();
void dumpMemoryUsage(String8& log, const RenderState* renderState = nullptr);
@@ -57,11 +61,15 @@
explicit CacheManager(const DisplayInfo& display);
+#ifdef __ANDROID__ // Layoutlib does not support hardware acceleration
void reset(sk_sp<GrContext> grContext);
+#endif
void destroy();
const size_t mMaxSurfaceArea;
+#ifdef __ANDROID__ // Layoutlib does not support hardware acceleration
sk_sp<GrContext> mGrContext;
+#endif
int mMaxResources = 0;
const size_t mMaxResourceBytes;