summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Sakhartchouk <alexst@google.com>2011-01-31 14:53:24 -0800
committerAlex Sakhartchouk <alexst@google.com>2011-01-31 14:53:24 -0800
commit77d9f4bd05b2d2a161f30c12a2248f9c97eaac42 (patch)
tree3a709b9ac16afd941095e64fa961e4387f9175ee
parent099d7d33e55afeb3399f6e8cf8d665223ca94939 (diff)
downloadrs-77d9f4bd05b2d2a161f30c12a2248f9c97eaac42.tar.gz
Cleaning up the serialization change.
Renaming the define to be more in line with what it does and removing the host stub header file. Change-Id: Ibd3a0a6a398c7f81cc661f71e4478707fe1679ed
-rw-r--r--Android.mk2
-rw-r--r--RenderScript.h2
-rw-r--r--rsAdapter.cpp4
-rw-r--r--rsAllocation.cpp52
-rw-r--r--rsAnimation.cpp5
-rw-r--r--rsComponent.cpp10
-rw-r--r--rsContext.h50
-rw-r--r--rsContextHostStub.h123
-rw-r--r--rsDevice.cpp4
-rw-r--r--rsElement.cpp4
-rw-r--r--rsFileA3D.cpp5
-rw-r--r--rsFont.cpp4
-rw-r--r--rsMesh.cpp13
-rw-r--r--rsMesh.h2
-rw-r--r--rsObjectBase.cpp6
-rw-r--r--rsProgram.cpp8
-rw-r--r--rsProgramFragment.cpp8
-rw-r--r--rsProgramRaster.cpp8
-rw-r--r--rsProgramStore.cpp8
-rw-r--r--rsProgramVertex.cpp8
-rw-r--r--rsSampler.cpp10
-rw-r--r--rsShaderCache.cpp7
-rw-r--r--rsStream.cpp5
-rw-r--r--rsType.cpp4
-rw-r--r--rsUtils.h2
-rw-r--r--rsVertexArray.cpp5
26 files changed, 98 insertions, 261 deletions
diff --git a/Android.mk b/Android.mk
index 2d0b6c4e..25c8beb3 100644
--- a/Android.mk
+++ b/Android.mk
@@ -132,7 +132,7 @@ include $(BUILD_SHARED_LIBRARY)
# Now build a host version for serialization
include $(CLEAR_VARS)
-LOCAL_CFLAGS += -DANDROID_RS_BUILD_FOR_HOST
+LOCAL_CFLAGS += -DANDROID_RS_SERIALIZE
LOCAL_SRC_FILES:= \
rsAllocation.cpp \
diff --git a/RenderScript.h b/RenderScript.h
index 882a0b07..bb5e4aa2 100644
--- a/RenderScript.h
+++ b/RenderScript.h
@@ -365,7 +365,7 @@ RsAllocation rsaAllocationCreateFromBitmap(RsContext con, RsType vtype,
RsAllocation rsaAllocationCubeCreateFromBitmap(RsContext con, RsType vtype,
RsAllocationMipmapControl mips,
const void *data, uint32_t usages);
-#ifdef ANDROID_RS_BUILD_FOR_HOST
+#ifdef ANDROID_RS_SERIALIZE
#define NO_RS_FUNCS
#endif
diff --git a/rsAdapter.cpp b/rsAdapter.cpp
index 8d363fde..6e8ca705 100644
--- a/rsAdapter.cpp
+++ b/rsAdapter.cpp
@@ -15,11 +15,7 @@
* limitations under the License.
*/
-#ifndef ANDROID_RS_BUILD_FOR_HOST
#include "rsContext.h"
-#else
-#include "rsContextHostStub.h"
-#endif
using namespace android;
using namespace android::renderscript;
diff --git a/rsAllocation.cpp b/rsAllocation.cpp
index 2839b76c..54dcbcbe 100644
--- a/rsAllocation.cpp
+++ b/rsAllocation.cpp
@@ -13,15 +13,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-#ifndef ANDROID_RS_BUILD_FOR_HOST
-#include "rsContext.h"
+#include "rsContext.h"
+#ifndef ANDROID_RS_SERIALIZE
#include <GLES/gl.h>
#include <GLES2/gl2.h>
#include <GLES/glext.h>
-#else
-#include "rsContextHostStub.h"
-#endif //ANDROID_RS_BUILD_FOR_HOST
+#endif //ANDROID_RS_SERIALIZE
static void rsaAllocationGenerateScriptMips(RsContext con, RsAllocation va);
@@ -78,7 +76,7 @@ Allocation::~Allocation() {
mPtr = NULL;
}
freeScriptMemory();
-#ifndef ANDROID_RS_BUILD_FOR_HOST
+#ifndef ANDROID_RS_SERIALIZE
if (mBufferID) {
// Causes a SW crash....
//LOGV(" mBufferID %i", mBufferID);
@@ -89,7 +87,7 @@ Allocation::~Allocation() {
glDeleteTextures(1, &mTextureID);
mTextureID = 0;
}
-#endif //ANDROID_RS_BUILD_FOR_HOST
+#endif //ANDROID_RS_SERIALIZE
}
void Allocation::setCpuWritable(bool) {
@@ -114,7 +112,7 @@ void Allocation::deferedUploadToTexture(const Context *rsc) {
}
uint32_t Allocation::getGLTarget() const {
-#ifndef ANDROID_RS_BUILD_FOR_HOST
+#ifndef ANDROID_RS_SERIALIZE
if (getIsTexture()) {
if (mType->getDimFaces()) {
return GL_TEXTURE_CUBE_MAP;
@@ -125,7 +123,7 @@ uint32_t Allocation::getGLTarget() const {
if (getIsBufferObject()) {
return GL_ARRAY_BUFFER;
}
-#endif //ANDROID_RS_BUILD_FOR_HOST
+#endif //ANDROID_RS_SERIALIZE
return 0;
}
@@ -156,7 +154,7 @@ void Allocation::syncAll(Context *rsc, RsAllocationUsageType src) {
}
void Allocation::uploadToTexture(const Context *rsc) {
-#ifndef ANDROID_RS_BUILD_FOR_HOST
+#ifndef ANDROID_RS_SERIALIZE
mUsageFlags |= RS_ALLOCATION_USAGE_GRAPHICS_TEXTURE;
GLenum type = mType->getElement()->getComponent().getGLType();
GLenum format = mType->getElement()->getComponent().getGLFormat();
@@ -193,10 +191,10 @@ void Allocation::uploadToTexture(const Context *rsc) {
}
rsc->checkError("Allocation::uploadToTexture");
-#endif //ANDROID_RS_BUILD_FOR_HOST
+#endif //ANDROID_RS_SERIALIZE
}
-#ifndef ANDROID_RS_BUILD_FOR_HOST
+#ifndef ANDROID_RS_SERIALIZE
const static GLenum gFaceOrder[] = {
GL_TEXTURE_CUBE_MAP_POSITIVE_X,
GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
@@ -205,12 +203,12 @@ const static GLenum gFaceOrder[] = {
GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
GL_TEXTURE_CUBE_MAP_NEGATIVE_Z
};
-#endif //ANDROID_RS_BUILD_FOR_HOST
+#endif //ANDROID_RS_SERIALIZE
void Allocation::update2DTexture(const void *ptr, uint32_t xoff, uint32_t yoff,
uint32_t lod, RsAllocationCubemapFace face,
uint32_t w, uint32_t h) {
-#ifndef ANDROID_RS_BUILD_FOR_HOST
+#ifndef ANDROID_RS_SERIALIZE
GLenum type = mType->getElement()->getComponent().getGLType();
GLenum format = mType->getElement()->getComponent().getGLFormat();
GLenum target = (GLenum)getGLTarget();
@@ -222,11 +220,11 @@ void Allocation::update2DTexture(const void *ptr, uint32_t xoff, uint32_t yoff,
t = gFaceOrder[face];
}
glTexSubImage2D(t, lod, xoff, yoff, w, h, format, type, ptr);
-#endif //ANDROID_RS_BUILD_FOR_HOST
+#endif //ANDROID_RS_SERIALIZE
}
void Allocation::upload2DTexture(bool isFirstUpload) {
-#ifndef ANDROID_RS_BUILD_FOR_HOST
+#ifndef ANDROID_RS_SERIALIZE
GLenum type = mType->getElement()->getComponent().getGLType();
GLenum format = mType->getElement()->getComponent().getGLFormat();
@@ -264,7 +262,7 @@ void Allocation::upload2DTexture(bool isFirstUpload) {
if (mMipmapControl == RS_ALLOCATION_MIPMAP_ON_SYNC_TO_TEXTURE) {
glGenerateMipmap(target);
}
-#endif //ANDROID_RS_BUILD_FOR_HOST
+#endif //ANDROID_RS_SERIALIZE
}
void Allocation::deferedUploadToBufferObject(const Context *rsc) {
@@ -273,7 +271,7 @@ void Allocation::deferedUploadToBufferObject(const Context *rsc) {
}
void Allocation::uploadToBufferObject(const Context *rsc) {
-#ifndef ANDROID_RS_BUILD_FOR_HOST
+#ifndef ANDROID_RS_SERIALIZE
rsAssert(!mType->getDimY());
rsAssert(!mType->getDimZ());
@@ -292,7 +290,7 @@ void Allocation::uploadToBufferObject(const Context *rsc) {
glBufferData(target, mType->getSizeBytes(), getPtr(), GL_DYNAMIC_DRAW);
glBindBuffer(target, 0);
rsc->checkError("Allocation::uploadToBufferObject");
-#endif //ANDROID_RS_BUILD_FOR_HOST
+#endif //ANDROID_RS_SERIALIZE
}
void Allocation::uploadCheck(Context *rsc) {
@@ -450,13 +448,13 @@ void Allocation::elementData(Context *rsc, uint32_t x, uint32_t y,
}
void Allocation::addProgramToDirty(const Program *p) {
-#ifndef ANDROID_RS_BUILD_FOR_HOST
+#ifndef ANDROID_RS_SERIALIZE
mToDirtyList.push(p);
-#endif //ANDROID_RS_BUILD_FOR_HOST
+#endif //ANDROID_RS_SERIALIZE
}
void Allocation::removeProgramToDirty(const Program *p) {
-#ifndef ANDROID_RS_BUILD_FOR_HOST
+#ifndef ANDROID_RS_SERIALIZE
for (size_t ct=0; ct < mToDirtyList.size(); ct++) {
if (mToDirtyList[ct] == p) {
mToDirtyList.removeAt(ct);
@@ -464,7 +462,7 @@ void Allocation::removeProgramToDirty(const Program *p) {
}
}
rsAssert(0);
-#endif //ANDROID_RS_BUILD_FOR_HOST
+#endif //ANDROID_RS_SERIALIZE
}
void Allocation::dumpLOGV(const char *prefix) const {
@@ -539,11 +537,11 @@ Allocation *Allocation::createFromStream(Context *rsc, IStream *stream) {
}
void Allocation::sendDirty() const {
-#ifndef ANDROID_RS_BUILD_FOR_HOST
+#ifndef ANDROID_RS_SERIALIZE
for (size_t ct=0; ct < mToDirtyList.size(); ct++) {
mToDirtyList[ct]->forceDirty();
}
-#endif //ANDROID_RS_BUILD_FOR_HOST
+#endif //ANDROID_RS_SERIALIZE
}
void Allocation::incRefs(const void *ptr, size_t ct, size_t startOff) const {
@@ -602,7 +600,7 @@ void Allocation::resize2D(Context *rsc, uint32_t dimX, uint32_t dimY) {
/////////////////
//
-#ifndef ANDROID_RS_BUILD_FOR_HOST
+#ifndef ANDROID_RS_SERIALIZE
namespace android {
namespace renderscript {
@@ -848,4 +846,4 @@ RsAllocation rsaAllocationCubeCreateFromBitmap(RsContext con, RsType vtype,
return texAlloc;
}
-#endif //ANDROID_RS_BUILD_FOR_HOST
+#endif //ANDROID_RS_SERIALIZE
diff --git a/rsAnimation.cpp b/rsAnimation.cpp
index 6abda3c0..48b4f029 100644
--- a/rsAnimation.cpp
+++ b/rsAnimation.cpp
@@ -14,12 +14,7 @@
* limitations under the License.
*/
-#ifndef ANDROID_RS_BUILD_FOR_HOST
#include "rsContext.h"
-#else
-#include "rsContextHostStub.h"
-#endif //ANDROID_RS_BUILD_FOR_HOST
-
#include "rsAnimation.h"
diff --git a/rsComponent.cpp b/rsComponent.cpp
index cb3caf80..4c4987aa 100644
--- a/rsComponent.cpp
+++ b/rsComponent.cpp
@@ -16,7 +16,7 @@
#include "rsComponent.h"
-#ifndef ANDROID_RS_BUILD_FOR_HOST
+#ifndef ANDROID_RS_SERIALIZE
#include <GLES/gl.h>
#endif
@@ -181,7 +181,7 @@ bool Component::isReference() const {
}
uint32_t Component::getGLType() const {
-#ifndef ANDROID_RS_BUILD_FOR_HOST
+#ifndef ANDROID_RS_SERIALIZE
switch (mType) {
case RS_TYPE_UNSIGNED_5_6_5: return GL_UNSIGNED_SHORT_5_6_5;
case RS_TYPE_UNSIGNED_5_5_5_1: return GL_UNSIGNED_SHORT_5_5_5_1;
@@ -195,12 +195,12 @@ uint32_t Component::getGLType() const {
case RS_TYPE_SIGNED_16: return GL_SHORT;
default: break;
}
-#endif //ANDROID_RS_BUILD_FOR_HOST
+#endif //ANDROID_RS_SERIALIZE
return 0;
}
uint32_t Component::getGLFormat() const {
-#ifndef ANDROID_RS_BUILD_FOR_HOST
+#ifndef ANDROID_RS_SERIALIZE
switch (mKind) {
case RS_KIND_PIXEL_L: return GL_LUMINANCE;
case RS_KIND_PIXEL_A: return GL_ALPHA;
@@ -209,7 +209,7 @@ uint32_t Component::getGLFormat() const {
case RS_KIND_PIXEL_RGBA: return GL_RGBA;
default: break;
}
-#endif //ANDROID_RS_BUILD_FOR_HOST
+#endif //ANDROID_RS_SERIALIZE
return 0;
}
diff --git a/rsContext.h b/rsContext.h
index 9f94f26a..c5e32a67 100644
--- a/rsContext.h
+++ b/rsContext.h
@@ -18,16 +18,16 @@
#define ANDROID_RS_CONTEXT_H
#include "rsUtils.h"
-#include "rsMutex.h"
-
-#include "rsThreadIO.h"
#include "rsType.h"
-#include "rsMatrix.h"
#include "rsAllocation.h"
#include "rsMesh.h"
+
+#ifndef ANDROID_RS_SERIALIZE
+#include "rsMutex.h"
+#include "rsThreadIO.h"
+#include "rsMatrix.h"
#include "rsDevice.h"
#include "rsScriptC.h"
-#include "rsAllocation.h"
#include "rsAdapter.h"
#include "rsSampler.h"
#include "rsFont.h"
@@ -42,6 +42,7 @@
#include "rsLocklessFifo.h"
#include <ui/egl/android_natives.h>
+#endif // ANDROID_RS_SERIALIZE
// ---------------------------------------------------------------------------
namespace android {
@@ -66,6 +67,8 @@ namespace renderscript {
#define CHECK_OBJ_OR_NULL(o)
#endif
+#ifndef ANDROID_RS_SERIALIZE
+
class Context {
public:
static Context * createContext(Device *, const RsSurfaceConfig *sc);
@@ -321,6 +324,39 @@ private:
uint32_t mAverageFPS;
};
-}
-}
+#else
+
+class Context {
+public:
+ Context() {
+ mObjHead = NULL;
+ }
+ ~Context() {
+ ObjectBase::zeroAllUserRef(this);
+ }
+
+ ElementState mStateElement;
+ TypeState mStateType;
+
+ struct {
+ bool mLogTimes;
+ bool mLogScripts;
+ bool mLogObjects;
+ bool mLogShaders;
+ bool mLogShadersAttr;
+ bool mLogShadersUniforms;
+ bool mLogVisual;
+ } props;
+
+ void setError(RsError e, const char *msg = NULL) { }
+
+ mutable const ObjectBase * mObjHead;
+
+protected:
+
+};
+#endif //ANDROID_RS_SERIALIZE
+
+} // renderscript
+} // android
#endif
diff --git a/rsContextHostStub.h b/rsContextHostStub.h
deleted file mode 100644
index 7e8ec397..00000000
--- a/rsContextHostStub.h
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * Copyright (C) 2009 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef ANDROID_RS_CONTEXT_HOST_STUB_H
-#define ANDROID_RS_CONTEXT_HOST_STUB_H
-
-#include "rsUtils.h"
-#include "rsType.h"
-#include "rsAllocation.h"
-#include "rsMesh.h"
-#include "rsAllocation.h"
-
-// ---------------------------------------------------------------------------
-namespace android {
-namespace renderscript {
-
-#define CHECK_OBJ(o)
-#define CHECK_OBJ_OR_NULL(o)
-
-class Device;
-
-class Context {
-public:
- Context(Device *, bool isGraphics, bool useDepth) {
- mObjHead = NULL;
- }
- ~Context() {
- }
-
- //StructuredAllocationContext mStateAllocation;
- ElementState mStateElement;
- TypeState mStateType;
- RsSurfaceConfig mUserSurfaceConfig;
-
- //bool setupCheck();
-
-
- uint32_t getWidth() const {return 0;}
- uint32_t getHeight() const {return 0;}
-
- // Timers
- enum Timers {
- RS_TIMER_IDLE,
- RS_TIMER_INTERNAL,
- RS_TIMER_SCRIPT,
- RS_TIMER_CLEAR_SWAP,
- _RS_TIMER_TOTAL
- };
-
- void timerSet(Timers) { }
-
- bool checkVersion1_1() const {return false; }
- bool checkVersion2_0() const {return false; }
-
- struct {
- bool mLogTimes;
- bool mLogScripts;
- bool mLogObjects;
- bool mLogShaders;
- bool mLogShadersAttr;
- bool mLogShadersUniforms;
- bool mLogVisual;
- } props;
-
- void dumpDebug() const { }
- void checkError(const char *) const { };
- void setError(RsError e, const char *msg = NULL) { }
-
- mutable const ObjectBase * mObjHead;
-
- bool ext_OES_texture_npot() const {return mGL.OES_texture_npot;}
- bool ext_GL_NV_texture_npot_2D_mipmap() const {return mGL.GL_NV_texture_npot_2D_mipmap;}
- float ext_texture_max_aniso() const {return mGL.EXT_texture_max_aniso; }
- uint32_t getMaxFragmentTextures() const {return mGL.mMaxFragmentTextureImageUnits;}
- uint32_t getMaxFragmentUniformVectors() const {return mGL.mMaxFragmentUniformVectors;}
- uint32_t getMaxVertexUniformVectors() const {return mGL.mMaxVertexUniformVectors;}
- uint32_t getMaxVertexAttributes() const {return mGL.mMaxVertexAttribs;}
-
-protected:
-
- struct {
- const uint8_t * mVendor;
- const uint8_t * mRenderer;
- const uint8_t * mVersion;
- const uint8_t * mExtensions;
-
- uint32_t mMajorVersion;
- uint32_t mMinorVersion;
-
- int32_t mMaxVaryingVectors;
- int32_t mMaxTextureImageUnits;
-
- int32_t mMaxFragmentTextureImageUnits;
- int32_t mMaxFragmentUniformVectors;
-
- int32_t mMaxVertexAttribs;
- int32_t mMaxVertexUniformVectors;
- int32_t mMaxVertexTextureUnits;
-
- bool OES_texture_npot;
- bool GL_NV_texture_npot_2D_mipmap;
- float EXT_texture_max_aniso;
- } mGL;
-
-};
-
-}
-}
-#endif
-
diff --git a/rsDevice.cpp b/rsDevice.cpp
index dd964452..d7d03f6a 100644
--- a/rsDevice.cpp
+++ b/rsDevice.cpp
@@ -15,11 +15,7 @@
*/
#include "rsDevice.h"
-#ifndef ANDROID_RS_BUILD_FOR_HOST
#include "rsContext.h"
-#else
-#include "rsContextHostStub.h"
-#endif
using namespace android;
using namespace android::renderscript;
diff --git a/rsElement.cpp b/rsElement.cpp
index 7c3b9e8d..477cb616 100644
--- a/rsElement.cpp
+++ b/rsElement.cpp
@@ -15,11 +15,7 @@
*/
-#ifndef ANDROID_RS_BUILD_FOR_HOST
#include "rsContext.h"
-#else
-#include "rsContextHostStub.h"
-#endif
using namespace android;
using namespace android::renderscript;
diff --git a/rsFileA3D.cpp b/rsFileA3D.cpp
index 97ce8c8a..cd02c24b 100644
--- a/rsFileA3D.cpp
+++ b/rsFileA3D.cpp
@@ -15,12 +15,7 @@
* limitations under the License.
*/
-#ifndef ANDROID_RS_BUILD_FOR_HOST
#include "rsContext.h"
-#else
-#include "rsContextHostStub.h"
-#endif
-
#include "rsFileA3D.h"
#include "rsMesh.h"
diff --git a/rsFont.cpp b/rsFont.cpp
index 7fdfbe05..8a5ab99e 100644
--- a/rsFont.cpp
+++ b/rsFont.cpp
@@ -15,11 +15,7 @@
* limitations under the License.
*/
-#ifndef ANDROID_RS_BUILD_FOR_HOST
#include "rsContext.h"
-#else
-#include "rsContextHostStub.h"
-#endif
#include "rsFont.h"
#include "rsProgramFragment.h"
diff --git a/rsMesh.cpp b/rsMesh.cpp
index 8cf76e5f..76fe62da 100644
--- a/rsMesh.cpp
+++ b/rsMesh.cpp
@@ -14,14 +14,11 @@
* limitations under the License.
*/
-#ifndef ANDROID_RS_BUILD_FOR_HOST
#include "rsContext.h"
-
+#ifndef ANDROID_RS_SERIALIZE
#include <GLES/gl.h>
#include <GLES2/gl2.h>
#include <GLES/glext.h>
-#else
-#include "rsContextHostStub.h"
#endif
using namespace android;
@@ -33,7 +30,7 @@ Mesh::Mesh(Context *rsc) : ObjectBase(rsc) {
mVertexBuffers = NULL;
mVertexBufferCount = 0;
-#ifndef ANDROID_RS_BUILD_FOR_HOST
+#ifndef ANDROID_RS_SERIALIZE
mAttribs = NULL;
mAttribAllocationIndex = NULL;
@@ -53,7 +50,7 @@ Mesh::~Mesh() {
delete[] mPrimitives;
}
-#ifndef ANDROID_RS_BUILD_FOR_HOST
+#ifndef ANDROID_RS_SERIALIZE
if (mAttribs) {
delete[] mAttribs;
delete[] mAttribAllocationIndex;
@@ -134,7 +131,7 @@ Mesh *Mesh::createFromStream(Context *rsc, IStream *stream) {
}
}
-#ifndef ANDROID_RS_BUILD_FOR_HOST
+#ifndef ANDROID_RS_SERIALIZE
mesh->updateGLPrimitives();
mesh->initVertexAttribs();
mesh->uploadAll(rsc);
@@ -142,7 +139,7 @@ Mesh *Mesh::createFromStream(Context *rsc, IStream *stream) {
return mesh;
}
-#ifndef ANDROID_RS_BUILD_FOR_HOST
+#ifndef ANDROID_RS_SERIALIZE
bool Mesh::isValidGLComponent(const Element *elem, uint32_t fieldIdx) {
// Do not create attribs for padding
diff --git a/rsMesh.h b/rsMesh.h
index e44f90d2..3e080e2a 100644
--- a/rsMesh.h
+++ b/rsMesh.h
@@ -54,7 +54,7 @@ public:
virtual RsA3DClassID getClassId() const { return RS_A3D_CLASS_ID_MESH; }
static Mesh *createFromStream(Context *rsc, IStream *stream);
-#ifndef ANDROID_RS_BUILD_FOR_HOST
+#ifndef ANDROID_RS_SERIALIZE
void render(Context *) const;
void renderPrimitive(Context *, uint32_t primIndex) const;
void renderPrimitiveRange(Context *, uint32_t primIndex, uint32_t start, uint32_t len) const;
diff --git a/rsObjectBase.cpp b/rsObjectBase.cpp
index aec2f679..f428f948 100644
--- a/rsObjectBase.cpp
+++ b/rsObjectBase.cpp
@@ -15,13 +15,7 @@
*/
#include "rsObjectBase.h"
-
-#ifndef ANDROID_RS_BUILD_FOR_HOST
#include "rsContext.h"
-#else
-#include "rsContextHostStub.h"
-#endif
-
using namespace android;
using namespace android::renderscript;
diff --git a/rsProgram.cpp b/rsProgram.cpp
index 39b85e39..4ef05bf4 100644
--- a/rsProgram.cpp
+++ b/rsProgram.cpp
@@ -14,15 +14,11 @@
* limitations under the License.
*/
-#ifndef ANDROID_RS_BUILD_FOR_HOST
#include "rsContext.h"
+#ifndef ANDROID_RS_SERIALIZE
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
-#else
-#include "rsContextHostStub.h"
-#include <OpenGL/gl.h>
-#include <OpenGL/glext.h>
-#endif //ANDROID_RS_BUILD_FOR_HOST
+#endif //ANDROID_RS_SERIALIZE
#include "rsProgram.h"
diff --git a/rsProgramFragment.cpp b/rsProgramFragment.cpp
index 22cd5d39..ff314b7f 100644
--- a/rsProgramFragment.cpp
+++ b/rsProgramFragment.cpp
@@ -14,17 +14,13 @@
* limitations under the License.
*/
-#ifndef ANDROID_RS_BUILD_FOR_HOST
#include "rsContext.h"
+#ifndef ANDROID_RS_SERIALIZE
#include <GLES/gl.h>
#include <GLES/glext.h>
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
-#else
-#include "rsContextHostStub.h"
-#include <OpenGL/gl.h>
-#include <OpenGL/glext.h>
-#endif //ANDROID_RS_BUILD_FOR_HOST
+#endif //ANDROID_RS_SERIALIZE
#include "rsProgramFragment.h"
diff --git a/rsProgramRaster.cpp b/rsProgramRaster.cpp
index f2b5b9af..ace1572f 100644
--- a/rsProgramRaster.cpp
+++ b/rsProgramRaster.cpp
@@ -14,15 +14,11 @@
* limitations under the License.
*/
-#ifndef ANDROID_RS_BUILD_FOR_HOST
#include "rsContext.h"
+#ifndef ANDROID_RS_SERIALIZE
#include <GLES/gl.h>
#include <GLES/glext.h>
-#else
-#include "rsContextHostStub.h"
-#include <OpenGL/gl.h>
-#include <OpenGl/glext.h>
-#endif //ANDROID_RS_BUILD_FOR_HOST
+#endif //ANDROID_RS_SERIALIZE
#include "rsProgramRaster.h"
diff --git a/rsProgramStore.cpp b/rsProgramStore.cpp
index 72ac574a..09b759d9 100644
--- a/rsProgramStore.cpp
+++ b/rsProgramStore.cpp
@@ -14,15 +14,11 @@
* limitations under the License.
*/
-#ifndef ANDROID_RS_BUILD_FOR_HOST
#include "rsContext.h"
+#ifndef ANDROID_RS_SERIALIZE
#include <GLES/gl.h>
#include <GLES/glext.h>
-#else
-#include "rsContextHostStub.h"
-#include <OpenGL/gl.h>
-#include <OpenGl/glext.h>
-#endif //ANDROID_RS_BUILD_FOR_HOST
+#endif //ANDROID_RS_SERIALIZE
#include "rsProgramStore.h"
diff --git a/rsProgramVertex.cpp b/rsProgramVertex.cpp
index ad2beafb..403c2a6e 100644
--- a/rsProgramVertex.cpp
+++ b/rsProgramVertex.cpp
@@ -14,17 +14,13 @@
* limitations under the License.
*/
-#ifndef ANDROID_RS_BUILD_FOR_HOST
#include "rsContext.h"
+#ifndef ANDROID_RS_SERIALIZE
#include <GLES/gl.h>
#include <GLES/glext.h>
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
-#else
-#include "rsContextHostStub.h"
-#include <OpenGL/gl.h>
-#include <OpenGL/glext.h>
-#endif //ANDROID_RS_BUILD_FOR_HOST
+#endif //ANDROID_RS_SERIALIZE
#include "rsProgramVertex.h"
diff --git a/rsSampler.cpp b/rsSampler.cpp
index c80aecca..db2383ac 100644
--- a/rsSampler.cpp
+++ b/rsSampler.cpp
@@ -14,15 +14,11 @@
* limitations under the License.
*/
-#ifndef ANDROID_RS_BUILD_FOR_HOST
+#include "rsContext.h"
+#ifndef ANDROID_RS_SERIALIZE
#include <GLES/gl.h>
#include <GLES/glext.h>
-#include "rsContext.h"
-#else
-#include "rsContextHostStub.h"
-#include <OpenGL/gl.h>
-#include <OpenGL/glext.h>
-#endif //ANDROID_RS_BUILD_FOR_HOST
+#endif //ANDROID_RS_SERIALIZE
#include "rsSampler.h"
diff --git a/rsShaderCache.cpp b/rsShaderCache.cpp
index b958021b..e8d89c21 100644
--- a/rsShaderCache.cpp
+++ b/rsShaderCache.cpp
@@ -14,14 +14,11 @@
* limitations under the License.
*/
-#ifndef ANDROID_RS_BUILD_FOR_HOST
#include "rsContext.h"
+#ifndef ANDROID_RS_SERIALIZE
#include <GLES/gl.h>
#include <GLES2/gl2.h>
-#else
-#include "rsContextHostStub.h"
-#include <OpenGL/gl.h>
-#endif //ANDROID_RS_BUILD_FOR_HOST
+#endif //ANDROID_RS_SERIALIZE
using namespace android;
using namespace android::renderscript;
diff --git a/rsStream.cpp b/rsStream.cpp
index 49ed567d..b9df0ccf 100644
--- a/rsStream.cpp
+++ b/rsStream.cpp
@@ -15,12 +15,7 @@
* limitations under the License.
*/
-#ifndef ANDROID_RS_BUILD_FOR_HOST
#include "rsContext.h"
-#else
-#include "rsContextHostStub.h"
-#endif
-
#include "rsStream.h"
using namespace android;
diff --git a/rsType.cpp b/rsType.cpp
index b94c2f8e..cd2be949 100644
--- a/rsType.cpp
+++ b/rsType.cpp
@@ -14,11 +14,7 @@
* limitations under the License.
*/
-#ifndef ANDROID_RS_BUILD_FOR_HOST
#include "rsContext.h"
-#else
-#include "rsContextHostStub.h"
-#endif
using namespace android;
using namespace android::renderscript;
diff --git a/rsUtils.h b/rsUtils.h
index 0699b57f..3b60af58 100644
--- a/rsUtils.h
+++ b/rsUtils.h
@@ -32,7 +32,7 @@
#include <time.h>
#include <cutils/atomic.h>
-#ifndef ANDROID_RS_BUILD_FOR_HOST
+#ifndef ANDROID_RS_SERIALIZE
#include <EGL/egl.h>
#endif
diff --git a/rsVertexArray.cpp b/rsVertexArray.cpp
index d9393fe3..354ee89f 100644
--- a/rsVertexArray.cpp
+++ b/rsVertexArray.cpp
@@ -14,13 +14,10 @@
* limitations under the License.
*/
-#ifndef ANDROID_RS_BUILD_FOR_HOST
#include "rsContext.h"
+#ifndef ANDROID_RS_SERIALIZE
#include <GLES/gl.h>
#include <GLES2/gl2.h>
-#else
-#include "rsContextHostStub.h"
-#include <OpenGL/gl.h>
#endif
using namespace android;