Remove libutils and fix rsDebug for RS support library.
Bug: 9664050
Our bitcode runtime library translates vector rsDebug() calls into passing
their parameters via pointers. The previous version of libRSSupport.so was
being created with non-pointer versions of these routines accidentally.
This change also fixes a missing permission issue for ImageProcessing2, so
that the compatibility library can be verified.
This change also removes the use of libutils by switching the implementation of
String8/Vector in the compatibility library to internal types backed by
libstlport_static.
Change-Id: I20da75e8c19a82a42dc2bceaba1937d21372db84
diff --git a/driver/rsdAllocation.cpp b/driver/rsdAllocation.cpp
index f502f32..2daafbe 100644
--- a/driver/rsdAllocation.cpp
+++ b/driver/rsdAllocation.cpp
@@ -19,10 +19,12 @@
#include "rsAllocation.h"
-#ifndef RS_SERVER
+#if !defined(RS_SERVER) && !defined(RS_COMPATIBILITY_LIB)
#include "system/window.h"
#include "ui/Rect.h"
#include "ui/GraphicBufferMapper.h"
+#else
+#include "system/graphics.h"
#endif
#ifndef RS_COMPATIBILITY_LIB
diff --git a/driver/rsdAllocation.h b/driver/rsdAllocation.h
index 97e0d6a..35999d3 100644
--- a/driver/rsdAllocation.h
+++ b/driver/rsdAllocation.h
@@ -24,12 +24,15 @@
#include "../cpu_ref/rsd_cpu.h"
#ifndef RS_SERVER
-#include "gui/CpuConsumer.h"
-#include "gui/GLConsumer.h"
#include <GLES/gl.h>
#include <GLES2/gl2.h>
#endif
+#if !defined(RS_SERVER) && !defined(RS_COMPATIBILITY_LIB)
+#include "gui/CpuConsumer.h"
+#include "gui/GLConsumer.h"
+#endif
+
class RsdFrameBufferObj;
struct ANativeWindow;
struct ANativeWindowBuffer;
@@ -77,7 +80,7 @@
ANativeWindow *wnd;
ANativeWindowBuffer *wndBuffer;
-#ifndef RS_SERVER
+#if !defined(RS_SERVER) && !defined(RS_COMPATIBILITY_LIB)
android::sp< android::CpuConsumer > cpuConsumer;
android::CpuConsumer::LockedBuffer lb;
#endif
diff --git a/driver/rsdBcc.cpp b/driver/rsdBcc.cpp
index 9252dbf..212184e 100644
--- a/driver/rsdBcc.cpp
+++ b/driver/rsdBcc.cpp
@@ -25,7 +25,7 @@
#include "rsElement.h"
#include "rsScriptC.h"
-#ifndef RS_SERVER
+#if !defined(RS_SERVER) && !defined(RS_COMPATIBILITY_LIB)
#include "utils/Vector.h"
#include "utils/Timers.h"
#include "utils/StopWatch.h"
diff --git a/driver/rsdRuntimeStubs.cpp b/driver/rsdRuntimeStubs.cpp
index c22b966..cb3a5b4 100644
--- a/driver/rsdRuntimeStubs.cpp
+++ b/driver/rsdRuntimeStubs.cpp
@@ -1442,31 +1442,31 @@
SC_debugFv4(s, f1, f2, f3, f4);
}
-void rsDebug(const char *s, float2 f) {
- SC_debugF2(s, f);
+void rsDebug(const char *s, const float2 *f) {
+ SC_debugF2(s, *f);
}
-void rsDebug(const char *s, float3 f) {
- SC_debugF3(s, f);
+void rsDebug(const char *s, const float3 *f) {
+ SC_debugF3(s, *f);
}
-void rsDebug(const char *s, float4 f) {
- SC_debugF4(s, f);
+void rsDebug(const char *s, const float4 *f) {
+ SC_debugF4(s, *f);
}
void rsDebug(const char *s, double d) {
SC_debugD(s, d);
}
-void rsDebug(const char *s, rs_matrix4x4 *m) {
+void rsDebug(const char *s, const rs_matrix4x4 *m) {
SC_debugFM4v4(s, (float *) m);
}
-void rsDebug(const char *s, rs_matrix3x3 *m) {
+void rsDebug(const char *s, const rs_matrix3x3 *m) {
SC_debugFM3v3(s, (float *) m);
}
-void rsDebug(const char *s, rs_matrix2x2 *m) {
+void rsDebug(const char *s, const rs_matrix2x2 *m) {
SC_debugFM2v2(s, (float *) m);
}
@@ -1474,96 +1474,96 @@
SC_debugI8(s, c);
}
-void rsDebug(const char *s, char2 c) {
- SC_debugC2(s, c);
+void rsDebug(const char *s, const char2 *c) {
+ SC_debugC2(s, *c);
}
-void rsDebug(const char *s, char3 c) {
- SC_debugC3(s, c);
+void rsDebug(const char *s, const char3 *c) {
+ SC_debugC3(s, *c);
}
-void rsDebug(const char *s, char4 c) {
- SC_debugC4(s, c);
+void rsDebug(const char *s, const char4 *c) {
+ SC_debugC4(s, *c);
}
void rsDebug(const char *s, unsigned char c) {
SC_debugU8(s, c);
}
-void rsDebug(const char *s, uchar2 c) {
- SC_debugUC2(s, c);
+void rsDebug(const char *s, const uchar2 *c) {
+ SC_debugUC2(s, *c);
}
-void rsDebug(const char *s, uchar3 c) {
- SC_debugUC3(s, c);
+void rsDebug(const char *s, const uchar3 *c) {
+ SC_debugUC3(s, *c);
}
-void rsDebug(const char *s, uchar4 c) {
- SC_debugUC4(s, c);
+void rsDebug(const char *s, const uchar4 *c) {
+ SC_debugUC4(s, *c);
}
void rsDebug(const char *s, short c) {
SC_debugI16(s, c);
}
-void rsDebug(const char *s, short2 c) {
- SC_debugS2(s, c);
+void rsDebug(const char *s, const short2 *c) {
+ SC_debugS2(s, *c);
}
-void rsDebug(const char *s, short3 c) {
- SC_debugS3(s, c);
+void rsDebug(const char *s, const short3 *c) {
+ SC_debugS3(s, *c);
}
-void rsDebug(const char *s, short4 c) {
- SC_debugS4(s, c);
+void rsDebug(const char *s, const short4 *c) {
+ SC_debugS4(s, *c);
}
void rsDebug(const char *s, unsigned short c) {
SC_debugU16(s, c);
}
-void rsDebug(const char *s, ushort2 c) {
- SC_debugUS2(s, c);
+void rsDebug(const char *s, const ushort2 *c) {
+ SC_debugUS2(s, *c);
}
-void rsDebug(const char *s, ushort3 c) {
- SC_debugUS3(s, c);
+void rsDebug(const char *s, const ushort3 *c) {
+ SC_debugUS3(s, *c);
}
-void rsDebug(const char *s, ushort4 c) {
- SC_debugUS4(s, c);
+void rsDebug(const char *s, const ushort4 *c) {
+ SC_debugUS4(s, *c);
}
void rsDebug(const char *s, int c) {
SC_debugI32(s, c);
}
-void rsDebug(const char *s, int2 c) {
- SC_debugI2(s, c);
+void rsDebug(const char *s, const int2 *c) {
+ SC_debugI2(s, *c);
}
-void rsDebug(const char *s, int3 c) {
- SC_debugI3(s, c);
+void rsDebug(const char *s, const int3 *c) {
+ SC_debugI3(s, *c);
}
-void rsDebug(const char *s, int4 c) {
- SC_debugI4(s, c);
+void rsDebug(const char *s, const int4 *c) {
+ SC_debugI4(s, *c);
}
void rsDebug(const char *s, unsigned int c) {
SC_debugU32(s, c);
}
-void rsDebug(const char *s, uint2 c) {
- SC_debugUI2(s, c);
+void rsDebug(const char *s, const uint2 *c) {
+ SC_debugUI2(s, *c);
}
-void rsDebug(const char *s, uint3 c) {
- SC_debugUI3(s, c);
+void rsDebug(const char *s, const uint3 *c) {
+ SC_debugUI3(s, *c);
}
-void rsDebug(const char *s, uint4 c) {
- SC_debugUI4(s, c);
+void rsDebug(const char *s, const uint4 *c) {
+ SC_debugUI4(s, *c);
}
void rsDebug(const char *s, long c) {
@@ -1574,16 +1574,16 @@
SC_debugLL64(s, c);
}
-void rsDebug(const char *s, long2 c) {
- SC_debugL2(s, c);
+void rsDebug(const char *s, const long2 *c) {
+ SC_debugL2(s, *c);
}
-void rsDebug(const char *s, long3 c) {
- SC_debugL3(s, c);
+void rsDebug(const char *s, const long3 *c) {
+ SC_debugL3(s, *c);
}
-void rsDebug(const char *s, long4 c) {
- SC_debugL4(s, c);
+void rsDebug(const char *s, const long4 *c) {
+ SC_debugL4(s, *c);
}
void rsDebug(const char *s, unsigned long c) {
@@ -1594,16 +1594,16 @@
SC_debugULL64(s, c);
}
-void rsDebug(const char *s, ulong2 c) {
- SC_debugUL2(s, c);
+void rsDebug(const char *s, const ulong2 *c) {
+ SC_debugUL2(s, *c);
}
-void rsDebug(const char *s, ulong3 c) {
- SC_debugUL3(s, c);
+void rsDebug(const char *s, const ulong3 *c) {
+ SC_debugUL3(s, *c);
}
-void rsDebug(const char *s, ulong4 c) {
- SC_debugUL4(s, c);
+void rsDebug(const char *s, const ulong4 *c) {
+ SC_debugUL4(s, *c);
}
void rsDebug(const char *s, const void *p) {
diff --git a/driver/rsdShaderCache.h b/driver/rsdShaderCache.h
index 1ac1aa1..6de1d63 100644
--- a/driver/rsdShaderCache.h
+++ b/driver/rsdShaderCache.h
@@ -25,7 +25,7 @@
}
}
-#ifndef RS_SERVER
+#if !defined(RS_SERVER) && !defined(RS_COMPATIBILITY_LIB)
#include <utils/String8.h>
#include <utils/Vector.h>
#else