summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--driver/rsdAllocation.cpp38
-rw-r--r--driver/rsdAllocation.h6
-rw-r--r--driver/rsdCore.cpp6
-rw-r--r--driver/rsdCore.h4
-rw-r--r--driver/rsdRuntimeStubs.cpp4
-rw-r--r--rsAllocation.h11
-rw-r--r--rsApiContext.cpp2
-rw-r--r--rsContext.cpp45
-rw-r--r--rsContext.h8
-rw-r--r--rsDebugHelper.h8
-rw-r--r--rsDriverLoader.cpp3
-rw-r--r--rsFont.h1
-rw-r--r--rsScript.h4
-rw-r--r--rsScriptC.cpp10
14 files changed, 66 insertions, 84 deletions
diff --git a/driver/rsdAllocation.cpp b/driver/rsdAllocation.cpp
index f4674b9c..2db5633a 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 @@ uint8_t *GetOffsetPtr(const android::renderscript::Allocation *alloc,
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 @@ static void Update2DTexture(const Context *rsc, const Allocation *alloc, const v
}
-#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 @@ static void Upload2DTexture(const Context *rsc, const Allocation *alloc, bool is
#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 UploadToTexture(const Context *rsc, const Allocation *alloc) {
}
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 AllocateRenderTarget(const Context *rsc, const Allocation *alloc) {
}
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 @@ static size_t DeriveYUVLayout(int yuv, Allocation::Hal::DrvState *state) {
// 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 @@ static size_t DeriveYUVLayout(int yuv, Allocation::Hal::DrvState *state) {
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 @@ static size_t DeriveYUVLayout(int yuv, Allocation::Hal::DrvState *state) {
(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 @@ bool rsdAllocationInitStrided(const Context *rsc, Allocation *alloc, bool forceZ
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 @@ void rsdAllocationDestroy(const Context *rsc, Allocation *alloc) {
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 @@ void rsdAllocationDestroy(const Context *rsc, Allocation *alloc) {
}
#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 @@ void rsdAllocationResize(const Context *rsc, const Allocation *alloc,
}
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 @@ void rsdAllocationIoSend(const Context *rsc, Allocation *alloc) {
#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 rsdAllocationIoSend(const Context *rsc, Allocation *alloc) {
}
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 @@ void rsdAllocationData2D(const Context *rsc, const Allocation *alloc,
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 c2d1467d..e37299e1 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 @@ struct DrvAllocation {
// 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 @@ struct DrvAllocation {
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 07ca2a6a..cd483409 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 @@ extern "C" bool rsdHalQueryHal(RsHalInitEnums entry, void **fnPtr) {
// 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 @@ void SetPriority(const Context *rsc, int32_t priority) {
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 0e46fd24..3cad348a 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 @@ typedef struct RsdHalRec {
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 498cea4d..504f0980 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 @@ float rsGetDt() {
//////////////////////////////////////////////////////////////////////////////
// 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 78be2fc0..602a666a 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 @@ public:
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 9912c89b..11609851 100644
--- a/rsApiContext.cpp
+++ b/rsApiContext.cpp
@@ -45,7 +45,7 @@ extern "C" void rsaContextSetNativeLibDir(RsContext con, char *libDir, size_t le
// 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 51a8ca90..5167e84a 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 @@ void Context::deinitEGL() {
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(Context *con) {
}
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::runScript(Script *s) {
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 @@ uint32_t Context::runRootScript() {
}
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 @@ void Context::timerPrint() {
}
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 @@ bool Context::setupCheck() {
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 @@ static uint32_t getProp(const char *str) {
}
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::displayDebugStats() {
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 @@ void * Context::threadProc(void *vrsc) {
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 @@ void * Context::threadProc(void *vrsc) {
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 @@ void * Context::threadProc(void *vrsc) {
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 @@ void * Context::threadProc(void *vrsc) {
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 @@ void * Context::threadProc(void *vrsc) {
//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::threadProc(void *vrsc) {
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 @@ Context::~Context() {
}
}
-#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_ContextFinish(Context *rsc) {
}
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 @@ void rsi_ContextBindSampler(Context *rsc, uint32_t slot, RsSampler vs) {
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 @@ void rsi_ObjDestroy(Context *rsc, void *optr) {
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 b6000183..21224604 100644
--- a/rsContext.h
+++ b/rsContext.h
@@ -96,7 +96,7 @@ public:
~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 @@ public:
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 @@ public:
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 @@ protected:
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 2356e0e2..82aa3142 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 @@ namespace renderscript {
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 773fcdf5..48ff9907 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 d08c6f20..956fddf6 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 a4cd9c8e..f076c4b3 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 @@ public:
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 628d063e..5566398c 100644
--- a/rsScriptC.cpp
+++ b/rsScriptC.cpp
@@ -127,7 +127,7 @@ void ScriptC::setupScript(Context *rsc) {
}
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 @@ void ScriptC::Invoke(Context *rsc, uint32_t slot, const void *data, size_t len)
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 @@ static bool dumpBitcodeFile(const char *cacheDir, const char *resName,
return true;
}
-#endif // !ANDROID_RS_SERIALIZE
#endif // !RS_COMPATIBILITY_LIB
@@ -301,7 +299,6 @@ bool ScriptC::runCompiler(Context *rsc,
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 @@ bool ScriptC::runCompiler(Context *rsc,
// 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 @@ bool ScriptC::runCompiler(Context *rsc,
}
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 @@ bool ScriptC::runCompiler(Context *rsc,
return false;
}
-#ifndef RS_COMPATIBILITY_LIB
+#if !defined(RS_VENDOR_LIB) && !defined(RS_COMPATIBILITY_LIB)
if (!strcmp(key, "stateVertex")) {
if (!strcmp(value, "default")) {
continue;