Remove libgui and libui dependencies for vendor libs.
- This CL removes dependencies on libgui, libui and other remaining
dependences, if build with RS_VENDOR_LIB defined.
- We cannot remove the dependencies for platform RenderScript CPU
fallback, because of the legacy graphics APIs.
- Vendor drivers will be built without graphics APIs, the reference
build file will be posted in another CL.
Bug: 34396220
Test: mm, CTS test pass with the vendor libs.
Change-Id: If90b600a58d0f81488f56a1e21ca332f1a235162
diff --git a/driver/rsdAllocation.cpp b/driver/rsdAllocation.cpp
index f4674b9..2db5633 100644
--- a/driver/rsdAllocation.cpp
+++ b/driver/rsdAllocation.cpp
@@ -23,10 +23,6 @@
#include "rsCompatibilityLib.h"
#else
#include "rsdFrameBufferObj.h"
-#include "gui/GLConsumer.h"
-#include "gui/CpuConsumer.h"
-#include "gui/Surface.h"
-#include "hardware/gralloc.h"
#include <GLES/gl.h>
#include <GLES2/gl2.h>
@@ -99,7 +95,7 @@
static void Update2DTexture(const Context *rsc, const Allocation *alloc, const void *ptr,
uint32_t xoff, uint32_t yoff, uint32_t lod,
RsAllocationCubemapFace face, uint32_t w, uint32_t h) {
-#ifndef RS_COMPATIBILITY_LIB
+#if !defined(RS_VENDOR_LIB) && !defined(RS_COMPATIBILITY_LIB)
DrvAllocation *drv = (DrvAllocation *)alloc->mHal.drv;
rsAssert(drv->textureID);
@@ -114,7 +110,7 @@
}
-#ifndef RS_COMPATIBILITY_LIB
+#if !defined(RS_VENDOR_LIB) && !defined(RS_COMPATIBILITY_LIB)
static void Upload2DTexture(const Context *rsc, const Allocation *alloc, bool isFirstUpload) {
DrvAllocation *drv = (DrvAllocation *)alloc->mHal.drv;
@@ -158,7 +154,7 @@
#endif
static void UploadToTexture(const Context *rsc, const Allocation *alloc) {
-#ifndef RS_COMPATIBILITY_LIB
+#if !defined(RS_VENDOR_LIB) && !defined(RS_COMPATIBILITY_LIB)
DrvAllocation *drv = (DrvAllocation *)alloc->mHal.drv;
if (alloc->mHal.state.usageFlags & RS_ALLOCATION_USAGE_IO_INPUT) {
@@ -196,7 +192,7 @@
}
static void AllocateRenderTarget(const Context *rsc, const Allocation *alloc) {
-#ifndef RS_COMPATIBILITY_LIB
+#if !defined(RS_VENDOR_LIB) && !defined(RS_COMPATIBILITY_LIB)
DrvAllocation *drv = (DrvAllocation *)alloc->mHal.drv;
if (!drv->glFormat) {
@@ -221,7 +217,7 @@
}
static void UploadToBufferObject(const Context *rsc, const Allocation *alloc) {
-#ifndef RS_COMPATIBILITY_LIB
+#if !defined(RS_VENDOR_LIB) && !defined(RS_COMPATIBILITY_LIB)
DrvAllocation *drv = (DrvAllocation *)alloc->mHal.drv;
rsAssert(!alloc->mHal.state.type->getDimY());
@@ -252,7 +248,7 @@
// For the flexible YCbCr format, layout is initialized during call to
// Allocation::ioReceive. Return early and avoid clobberring any
// pre-existing layout.
- if (yuv == HAL_PIXEL_FORMAT_YCbCr_420_888) {
+ if (yuv == RS_YUV_420_888) {
return 0;
}
#endif
@@ -269,7 +265,7 @@
state->lodCount = 3;
switch(yuv) {
- case HAL_PIXEL_FORMAT_YV12:
+ case RS_YUV_YV12:
state->lod[2].stride = rsRound(state->lod[0].stride >> 1, 16);
state->lod[2].mallocPtr = ((uint8_t *)state->lod[0].mallocPtr) +
(state->lod[0].stride * state->lod[0].dimY);
@@ -280,7 +276,7 @@
(state->lod[2].stride * state->lod[2].dimY);
uvSize += state->lod[1].stride * state->lod[2].dimY;
break;
- case HAL_PIXEL_FORMAT_YCrCb_420_SP: // NV21
+ case RS_YUV_NV21:
//state->lod[1].dimX = state->lod[0].dimX;
state->lod[1].stride = state->lod[0].stride;
state->lod[2].stride = state->lod[0].stride;
@@ -473,8 +469,9 @@
drv->uploadDeferred = true;
}
-
+#if !defined(RS_VENDOR_LIB) && !defined(RS_COMPATIBILITY_LIB)
drv->readBackFBO = nullptr;
+#endif
// fill out the initial state of the buffer if we couldn't use the user-provided ptr and USAGE_SHARED was accepted
if ((alloc->mHal.state.userProvidedPtr != 0) && (drv->useUserProvidedPtr == false)) {
@@ -535,7 +532,7 @@
DrvAllocation *drv = (DrvAllocation *)alloc->mHal.drv;
if (alloc->mHal.state.baseAlloc == nullptr) {
-#ifndef RS_COMPATIBILITY_LIB
+#if !defined(RS_VENDOR_LIB) && !defined(RS_COMPATIBILITY_LIB)
if (drv->bufferID) {
// Causes a SW crash....
//ALOGV(" mBufferID %i", mBufferID);
@@ -563,11 +560,12 @@
}
#ifndef RS_COMPATIBILITY_LIB
+#ifndef RS_VENDOR_LIB
if (drv->readBackFBO != nullptr) {
delete drv->readBackFBO;
drv->readBackFBO = nullptr;
}
-
+#endif
if ((alloc->mHal.state.usageFlags & RS_ALLOCATION_USAGE_IO_OUTPUT) &&
(alloc->mHal.state.usageFlags & RS_ALLOCATION_USAGE_SCRIPT)) {
ANativeWindow *nw = drv->wndSurface;
@@ -615,7 +613,7 @@
}
static void rsdAllocationSyncFromFBO(const Context *rsc, const Allocation *alloc) {
-#ifndef RS_COMPATIBILITY_LIB
+#if !defined(RS_VENDOR_LIB) && !defined(RS_COMPATIBILITY_LIB)
if (!alloc->getIsScript()) {
return; // nothing to sync
}
@@ -754,11 +752,13 @@
#ifndef RS_COMPATIBILITY_LIB
DrvAllocation *drv = (DrvAllocation *)alloc->mHal.drv;
ANativeWindow *nw = drv->wndSurface;
+#ifndef RS_VENDOR_LIB
if (alloc->mHal.state.usageFlags & RS_ALLOCATION_USAGE_GRAPHICS_RENDER_TARGET) {
RsdHal *dc = (RsdHal *)rsc->mHal.drv;
RSD_CALL_GL(eglSwapBuffers, dc->gl.egl.display, dc->gl.egl.surface);
return;
}
+#endif
if (nw) {
if (alloc->mHal.state.usageFlags & RS_ALLOCATION_USAGE_SCRIPT) {
int32_t r = ANativeWindow_unlockAndPost(nw);
@@ -776,7 +776,7 @@
}
void rsdAllocationIoReceive(const Context *rsc, Allocation *alloc) {
-#ifndef RS_COMPATIBILITY_LIB
+#if !defined(RS_VENDOR_LIB) && !defined(RS_COMPATIBILITY_LIB)
DrvAllocation *drv = (DrvAllocation *)alloc->mHal.drv;
if (!(alloc->mHal.state.usageFlags & RS_ALLOCATION_USAGE_SCRIPT)) {
drv->surfaceTexture->updateTexImage();
@@ -842,10 +842,10 @@
size_t clineSize = lineSize;
int lod = 1;
int maxLod = 2;
- if (alloc->mHal.state.yuv == HAL_PIXEL_FORMAT_YV12) {
+ if (alloc->mHal.state.yuv == RS_YUV_YV12) {
maxLod = 3;
clineSize >>= 1;
- } else if (alloc->mHal.state.yuv == HAL_PIXEL_FORMAT_YCrCb_420_SP) {
+ } else if (alloc->mHal.state.yuv == RS_YUV_NV21) {
lod = 2;
maxLod = 3;
}
diff --git a/driver/rsdAllocation.h b/driver/rsdAllocation.h
index c2d1467..e37299e 100644
--- a/driver/rsdAllocation.h
+++ b/driver/rsdAllocation.h
@@ -26,7 +26,7 @@
#include <GLES/gl.h>
#include <GLES2/gl2.h>
-#ifndef RS_COMPATIBILITY_LIB
+#if !defined(RS_VENDOR_LIB) && !defined(RS_COMPATIBILITY_LIB)
#include "gui/GLConsumer.h"
#endif
@@ -48,7 +48,7 @@
// Is this a legal structure to be used as an FBO render target
uint32_t renderTargetID;
-#ifndef RS_COMPATIBILITY_LIB
+#if !defined(RS_VENDOR_LIB) && !defined(RS_COMPATIBILITY_LIB)
GLenum glTarget;
GLenum glType;
GLenum glFormat;
@@ -65,7 +65,9 @@
bool useUserProvidedPtr;
bool uploadDeferred;
+#if !defined(RS_VENDOR_LIB) && !defined(RS_COMPATIBILITY_LIB)
RsdFrameBufferObj * readBackFBO;
+#endif
ANativeWindow *wnd;
ANativeWindow *wndSurface;
};
diff --git a/driver/rsdCore.cpp b/driver/rsdCore.cpp
index 07ca2a6..cd48340 100644
--- a/driver/rsdCore.cpp
+++ b/driver/rsdCore.cpp
@@ -21,7 +21,7 @@
#include "rsdBcc.h"
#include "rsdElement.h"
#include "rsdType.h"
-#ifndef RS_COMPATIBILITY_LIB
+#if !defined(RS_VENDOR_LIB) && !defined(RS_COMPATIBILITY_LIB)
#include "rsdGL.h"
#include "rsdProgramStore.h"
#include "rsdProgramRaster.h"
@@ -208,7 +208,7 @@
// Functions below this point are for the legacy graphics api,
// vendor drivers are NOT expected to implement these. They will never be called
// for an external driver.
-#ifndef RS_COMPATIBILITY_LIB
+#if !defined(RS_VENDOR_LIB) && !defined(RS_COMPATIBILITY_LIB)
case RS_HAL_GRAPHICS_INIT:
fnPtr[0] = (void *)rsdGLInit; break;
case RS_HAL_GRAPHICS_SHUTDOWN:
@@ -353,7 +353,7 @@
dc->mCpuRef->setPriority(priority);
-#ifndef RS_COMPATIBILITY_LIB
+#if !defined(RS_VENDOR_LIB) && !defined(RS_COMPATIBILITY_LIB)
if (dc->mHasGraphics) {
rsdGLSetPriority(rsc, priority);
}
diff --git a/driver/rsdCore.h b/driver/rsdCore.h
index 0e46fd2..3cad348 100644
--- a/driver/rsdCore.h
+++ b/driver/rsdCore.h
@@ -24,7 +24,7 @@
#include "rsMutex.h"
#include "rsSignal.h"
-#ifndef RS_COMPATIBILITY_LIB
+#if !defined(RS_VENDOR_LIB) && !defined(RS_COMPATIBILITY_LIB)
#include "rsdGL.h"
#endif
@@ -41,7 +41,7 @@
ScriptTLSStruct mTlsStruct;
android::renderscript::RsdCpuReference *mCpuRef;
-#ifndef RS_COMPATIBILITY_LIB
+#if !defined(RS_VENDOR_LIB) && !defined(RS_COMPATIBILITY_LIB)
RsdGL gl;
#endif
} RsdHal;
diff --git a/driver/rsdRuntimeStubs.cpp b/driver/rsdRuntimeStubs.cpp
index 498cea4..504f098 100644
--- a/driver/rsdRuntimeStubs.cpp
+++ b/driver/rsdRuntimeStubs.cpp
@@ -32,7 +32,7 @@
#include <time.h>
-#ifndef RS_COMPATIBILITY_LIB
+#if !defined(RS_VENDOR_LIB) && !defined(RS_COMPATIBILITY_LIB)
using android::renderscript::Font;
#endif
@@ -807,7 +807,7 @@
//////////////////////////////////////////////////////////////////////////////
// Graphics routines
//////////////////////////////////////////////////////////////////////////////
-#ifndef RS_COMPATIBILITY_LIB
+#if !defined(RS_VENDOR_LIB) && !defined(RS_COMPATIBILITY_LIB)
static void SC_DrawQuadTexCoords(float x1, float y1, float z1, float u1, float v1,
float x2, float y2, float z2, float u2, float v2,
float x3, float y3, float z3, float u3, float v3,
diff --git a/rsAllocation.h b/rsAllocation.h
index 78be2fc..602a666 100644
--- a/rsAllocation.h
+++ b/rsAllocation.h
@@ -19,13 +19,6 @@
#include "rsType.h"
-#ifndef RS_COMPATIBILITY_LIB
-#include "gui/CpuConsumer.h"
-#include "gui/GLConsumer.h"
-#else
-struct ANativeWindowBuffer;
-#endif
-
#include <vector>
// ---------------------------------------------------------------------------
@@ -72,7 +65,9 @@
bool hasReferences;
void * userProvidedPtr;
int32_t surfaceTextureID;
- ANativeWindowBuffer *nativeBuffer;
+ // nativeBuffer is not used anymore, keeping it here
+ // as a void* to keep the structure of Allocation the same.
+ void *nativeBuffer;
int64_t timestamp;
// Allocation adapter state
diff --git a/rsApiContext.cpp b/rsApiContext.cpp
index 9912c89..1160985 100644
--- a/rsApiContext.cpp
+++ b/rsApiContext.cpp
@@ -45,7 +45,7 @@
// TODO: Figure out better naming schemes for all the rs* functions.
// Currently they share the same names as the NDK counterparts, and that is
// causing lots of confusion.
-#ifndef RS_COMPATIBILITY_LIB
+#if !defined(RS_VENDOR_LIB) && !defined(RS_COMPATIBILITY_LIB)
extern "C" RsContext rsContextCreateGL(RsDevice vdev, uint32_t version,
uint32_t sdkVersion, RsSurfaceConfig sc,
uint32_t dpi) {
diff --git a/rsContext.cpp b/rsContext.cpp
index 51a8ca9..5167e84 100644
--- a/rsContext.cpp
+++ b/rsContext.cpp
@@ -21,7 +21,7 @@
#include "rsgApiStructs.h"
-#ifndef RS_COMPATIBILITY_LIB
+#if !defined(RS_VENDOR_LIB) && !defined(RS_COMPATIBILITY_LIB)
#include "rsMesh.h"
#include <gui/DisplayEventReceiver.h>
#endif
@@ -68,7 +68,7 @@
Context::PushState::PushState(Context *con) {
mRsc = con;
-#ifndef RS_COMPATIBILITY_LIB
+#if !defined(RS_VENDOR_LIB) && !defined(RS_COMPATIBILITY_LIB)
if (con->mIsGraphicsContext) {
mFragment.set(con->getProgramFragment());
mVertex.set(con->getProgramVertex());
@@ -80,7 +80,7 @@
}
Context::PushState::~PushState() {
-#ifndef RS_COMPATIBILITY_LIB
+#if !defined(RS_VENDOR_LIB) && !defined(RS_COMPATIBILITY_LIB)
if (mRsc->mIsGraphicsContext) {
mRsc->setProgramFragment(mFragment.get());
mRsc->setProgramVertex(mVertex.get());
@@ -101,7 +101,7 @@
uint32_t Context::runRootScript() {
timerSet(RS_TIMER_SCRIPT);
-#ifndef RS_COMPATIBILITY_LIB
+#if !defined(RS_VENDOR_LIB) && !defined(RS_COMPATIBILITY_LIB)
mStateFragmentStore.mLast.clear();
#endif
watchdog.inRoot = true;
@@ -112,13 +112,9 @@
}
uint64_t Context::getTime() const {
-#ifndef ANDROID_RS_SERIALIZE
struct timespec t;
clock_gettime(CLOCK_MONOTONIC, &t);
return t.tv_nsec + ((uint64_t)t.tv_sec * 1000 * 1000 * 1000);
-#else
- return 0;
-#endif //ANDROID_RS_SERIALIZE
}
void Context::timerReset() {
@@ -184,7 +180,7 @@
}
bool Context::setupCheck() {
-#ifndef RS_COMPATIBILITY_LIB
+#if !defined(RS_VENDOR_LIB) && !defined(RS_COMPATIBILITY_LIB)
mFragmentStore->setup(this, &mStateFragmentStore);
mFragment->setup(this, &mStateFragment);
mRaster->setup(this, &mStateRaster);
@@ -194,7 +190,7 @@
return true;
}
-#ifndef RS_COMPATIBILITY_LIB
+#if !defined(RS_VENDOR_LIB) && !defined(RS_COMPATIBILITY_LIB)
void Context::setupProgramStore() {
mFragmentStore->setup(this, &mStateFragmentStore);
}
@@ -211,7 +207,7 @@
}
void Context::displayDebugStats() {
-#ifndef RS_COMPATIBILITY_LIB
+#if !defined(RS_VENDOR_LIB) && !defined(RS_COMPATIBILITY_LIB)
char buffer[128];
snprintf(buffer, sizeof(buffer), "Avg fps %u, Frame %i ms, Script %i ms",
mAverageFPS, mTimeMSLastFrame, mTimeMSLastScript);
@@ -236,10 +232,7 @@
void * Context::threadProc(void *vrsc) {
Context *rsc = static_cast<Context *>(vrsc);
-#ifndef ANDROID_RS_SERIALIZE
rsc->mNativeThreadId = gettid();
-#endif //ANDROID_RS_SERIALIZE
-
rsc->props.mLogTimes = getProp("debug.rs.profile") != 0;
rsc->props.mLogScripts = getProp("debug.rs.script") != 0;
rsc->props.mLogShaders = getProp("debug.rs.shader") != 0;
@@ -280,7 +273,7 @@
rsc->setPriority(RS_THREAD_PRIORITY_NORMAL_GRAPHICS);
}
-#ifndef RS_COMPATIBILITY_LIB
+#if !defined(RS_VENDOR_LIB) && !defined(RS_COMPATIBILITY_LIB)
if (rsc->mIsGraphicsContext) {
if (!rsc->initGLThread()) {
rsc->setError(RS_ERROR_OUT_OF_MEMORY, "Failed initializing GL");
@@ -312,12 +305,11 @@
while (!rsc->mExit) {
rsc->mIO.playCoreCommands(rsc, -1);
}
-#ifndef RS_COMPATIBILITY_LIB
+#if !defined(RS_VENDOR_LIB) && !defined(RS_COMPATIBILITY_LIB)
} else {
-#ifndef ANDROID_RS_SERIALIZE
DisplayEventReceiver displayEvent;
DisplayEventReceiver::Event eventBuffer[1];
-#endif
+
int vsyncRate = 0;
int targetRate = 0;
@@ -325,7 +317,6 @@
while (!rsc->mExit) {
rsc->timerSet(RS_TIMER_IDLE);
-#ifndef ANDROID_RS_SERIALIZE
if (!rsc->mRootScript.get() || !rsc->mHasSurface || rsc->mPaused) {
targetRate = 0;
}
@@ -339,9 +330,7 @@
while (displayEvent.getEvents(eventBuffer, 1) != 0) {
//ALOGE("vs2 time past %lld", (rsc->getTime() - eventBuffer[0].header.timestamp) / 1000000);
}
- } else
-#endif
- {
+ } else {
drawOnce |= rsc->mIO.playCoreCommands(rsc, -1);
}
@@ -368,7 +357,7 @@
//ALOGV("%p RS Thread exiting", rsc);
-#ifndef RS_COMPATIBILITY_LIB
+#if !defined(RS_VENDOR_LIB) && !defined(RS_COMPATIBILITY_LIB)
if (rsc->mIsGraphicsContext) {
pthread_mutex_lock(&gInitMutex);
rsc->deinitEGL();
@@ -383,7 +372,7 @@
void Context::destroyWorkerThreadResources() {
//ALOGV("destroyWorkerThreadResources 1");
ObjectBase::zeroAllUserRef(this);
-#ifndef RS_COMPATIBILITY_LIB
+#if !defined(RS_VENDOR_LIB) && !defined(RS_COMPATIBILITY_LIB)
if (mIsGraphicsContext) {
mRaster.clear();
mFragment.clear();
@@ -583,7 +572,7 @@
}
}
-#ifndef RS_COMPATIBILITY_LIB
+#if !defined(RS_VENDOR_LIB) && !defined(RS_COMPATIBILITY_LIB)
void Context::setSurface(uint32_t w, uint32_t h, RsNativeWindow sur) {
rsAssert(mIsGraphicsContext);
mHal.funcs.setSurface(this, w, h, sur);
@@ -761,7 +750,7 @@
}
void rsi_ContextBindRootScript(Context *rsc, RsScript vs) {
-#ifndef RS_COMPATIBILITY_LIB
+#if !defined(RS_VENDOR_LIB) && !defined(RS_COMPATIBILITY_LIB)
Script *s = static_cast<Script *>(vs);
rsc->setRootScript(s);
#endif
@@ -782,7 +771,7 @@
s->bindToContext(&rsc->mStateSampler, slot);
}
-#ifndef RS_COMPATIBILITY_LIB
+#if !defined(RS_VENDOR_LIB) && !defined(RS_COMPATIBILITY_LIB)
void rsi_ContextBindProgramStore(Context *rsc, RsProgramStore vpfs) {
ProgramStore *pfs = static_cast<ProgramStore *>(vpfs);
rsc->setProgramStore(pfs);
@@ -820,7 +809,7 @@
ob->decUserRef();
}
-#ifndef RS_COMPATIBILITY_LIB
+#if !defined(RS_VENDOR_LIB) && !defined(RS_COMPATIBILITY_LIB)
void rsi_ContextPause(Context *rsc) {
rsc->pause();
}
diff --git a/rsContext.h b/rsContext.h
index b600018..2122460 100644
--- a/rsContext.h
+++ b/rsContext.h
@@ -96,7 +96,7 @@
~PushState();
private:
-#ifndef RS_COMPATIBILITY_LIB
+#if !defined(RS_VENDOR_LIB) && !defined(RS_COMPATIBILITY_LIB)
ObjectBaseRef<ProgramFragment> mFragment;
ObjectBaseRef<ProgramVertex> mVertex;
ObjectBaseRef<ProgramStore> mStore;
@@ -115,7 +115,7 @@
bool isSynchronous() {return mSynchronous;}
bool setupCheck();
-#ifndef RS_COMPATIBILITY_LIB
+#if !defined(RS_VENDOR_LIB) && !defined(RS_COMPATIBILITY_LIB)
FBOCache mFBOCache;
ProgramFragmentState mStateFragment;
ProgramStoreState mStateFragmentStore;
@@ -162,7 +162,7 @@
void initToClient();
void deinitToClient();
-#ifndef RS_COMPATIBILITY_LIB
+#if !defined(RS_VENDOR_LIB) && !defined(RS_COMPATIBILITY_LIB)
ProgramFragment * getDefaultProgramFragment() const {
return mStateFragment.mDefault.get();
}
@@ -319,7 +319,7 @@
pid_t mNativeThreadId;
ObjectBaseRef<Script> mRootScript;
-#ifndef RS_COMPATIBILITY_LIB
+#if !defined(RS_VENDOR_LIB) && !defined(RS_COMPATIBILITY_LIB)
ObjectBaseRef<ProgramFragment> mFragment;
ObjectBaseRef<ProgramVertex> mVertex;
ObjectBaseRef<ProgramStore> mFragmentStore;
diff --git a/rsDebugHelper.h b/rsDebugHelper.h
index 2356e0e..82aa314 100644
--- a/rsDebugHelper.h
+++ b/rsDebugHelper.h
@@ -20,7 +20,7 @@
#include "rsUtils.h"
#include "rsInternalDefines.h"
-#ifndef RS_COMPATIBILITY_LIB
+#if !defined(RS_VENDOR_LIB) && !defined(RS_COMPATIBILITY_LIB)
#include <utils/CallStack.h>
#endif
@@ -31,20 +31,20 @@
class DebugHelper {
public:
DebugHelper() {
-#ifndef RS_COMPATIBILITY_LIB
+#if !defined(RS_VENDOR_LIB) && !defined(RS_COMPATIBILITY_LIB)
mStack.update(2);
#endif
}
void dump() {
-#ifndef RS_COMPATIBILITY_LIB
+#if !defined(RS_VENDOR_LIB) && !defined(RS_COMPATIBILITY_LIB)
ALOGV("%s", mStack.toString().string());
//mStack.dump();
#endif
}
private:
-#ifndef RS_COMPATIBILITY_LIB
+#if !defined(RS_VENDOR_LIB) && !defined(RS_COMPATIBILITY_LIB)
CallStack mStack;
#endif
};
diff --git a/rsDriverLoader.cpp b/rsDriverLoader.cpp
index 773fcdf..48ff990 100644
--- a/rsDriverLoader.cpp
+++ b/rsDriverLoader.cpp
@@ -21,9 +21,8 @@
#include "rsgApiStructs.h"
-#ifndef RS_COMPATIBILITY_LIB
+#if !defined(RS_VENDOR_LIB) && !defined(RS_COMPATIBILITY_LIB)
#include "rsMesh.h"
-#include <gui/DisplayEventReceiver.h>
#endif
#include <sys/types.h>
diff --git a/rsFont.h b/rsFont.h
index d08c6f2..956fddf 100644
--- a/rsFont.h
+++ b/rsFont.h
@@ -19,6 +19,7 @@
#include "rsStream.h"
#include <utils/KeyedVector.h>
+#include <utils/Unicode.h>
struct FT_LibraryRec_;
struct FT_FaceRec_;
diff --git a/rsScript.h b/rsScript.h
index a4cd9c8..f076c4b 100644
--- a/rsScript.h
+++ b/rsScript.h
@@ -26,7 +26,7 @@
namespace android {
namespace renderscript {
-#ifndef RS_COMPATIBILITY_LIB
+#if !defined(RS_VENDOR_LIB) && !defined(RS_COMPATIBILITY_LIB)
class ProgramVertex;
class ProgramFragment;
class ProgramRaster;
@@ -105,7 +105,7 @@
int64_t mStartTimeMillis;
mutable int64_t mLastDtTime;
-#ifndef RS_COMPATIBILITY_LIB
+#if !defined(RS_VENDOR_LIB) && !defined(RS_COMPATIBILITY_LIB)
ObjectBaseRef<ProgramVertex> mVertex;
ObjectBaseRef<ProgramFragment> mFragment;
ObjectBaseRef<ProgramRaster> mRaster;
diff --git a/rsScriptC.cpp b/rsScriptC.cpp
index 628d063..5566398 100644
--- a/rsScriptC.cpp
+++ b/rsScriptC.cpp
@@ -127,7 +127,7 @@
}
void ScriptC::setupGLState(Context *rsc) {
-#ifndef RS_COMPATIBILITY_LIB
+#if !defined(RS_VENDOR_LIB) && !defined(RS_COMPATIBILITY_LIB)
if (mEnviroment.mFragmentStore.get()) {
rsc->setProgramStore(mEnviroment.mFragmentStore.get());
}
@@ -258,7 +258,6 @@
static const bool kDebugBitcode = false;
#ifndef RS_COMPATIBILITY_LIB
-#ifndef ANDROID_RS_SERIALIZE
static bool dumpBitcodeFile(const char *cacheDir, const char *resName,
const char *suffix, const uint8_t *bitcode,
@@ -289,7 +288,6 @@
return true;
}
-#endif // !ANDROID_RS_SERIALIZE
#endif // !RS_COMPATIBILITY_LIB
@@ -301,7 +299,6 @@
ATRACE_CALL();
//ALOGE("runCompiler %p %p %p %p %p %i", rsc, this, resName, cacheDir, bitcode, bitcodeLen);
#ifndef RS_COMPATIBILITY_LIB
-#ifndef ANDROID_RS_SERIALIZE
uint32_t sdkVersion = 0;
bcinfo::BitcodeWrapper bcWrapper((const char *)bitcode, bitcodeLen);
if (!bcWrapper.unwrap()) {
@@ -343,7 +340,6 @@
// optimization level used to compile the bitcode.
rsc->setOptLevel(bcWrapper.getOptimizationLevel());
-#endif
if (!cacheDir) {
// MUST BE FIXED BEFORE ANYTHING USING C++ API IS RELEASED
cacheDir = getenv("EXTERNAL_STORAGE");
@@ -361,7 +357,7 @@
}
mInitialized = true;
-#ifndef RS_COMPATIBILITY_LIB
+#if !defined(RS_VENDOR_LIB) && !defined(RS_COMPATIBILITY_LIB)
mEnviroment.mFragment.set(rsc->getDefaultProgramFragment());
mEnviroment.mVertex.set(rsc->getDefaultProgramVertex());
mEnviroment.mFragmentStore.set(rsc->getDefaultProgramStore());
@@ -382,7 +378,7 @@
return false;
}
-#ifndef RS_COMPATIBILITY_LIB
+#if !defined(RS_VENDOR_LIB) && !defined(RS_COMPATIBILITY_LIB)
if (!strcmp(key, "stateVertex")) {
if (!strcmp(value, "default")) {
continue;