diff options
author | Alex Sakhartchouk <alexst@google.com> | 2011-01-31 14:53:24 -0800 |
---|---|---|
committer | Alex Sakhartchouk <alexst@google.com> | 2011-01-31 14:53:24 -0800 |
commit | d0f5bd130bdbd5b357b7f1db4562fa55e06d384c (patch) | |
tree | 48ee3f26d8879c2a92b8ee60df9821d46666e9e2 /libs/rs | |
parent | e62e890b68cce46b4ed19010874707d3d45fa258 (diff) | |
download | frameworks_base-d0f5bd130bdbd5b357b7f1db4562fa55e06d384c.zip frameworks_base-d0f5bd130bdbd5b357b7f1db4562fa55e06d384c.tar.gz frameworks_base-d0f5bd130bdbd5b357b7f1db4562fa55e06d384c.tar.bz2 |
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
Diffstat (limited to 'libs/rs')
-rw-r--r-- | libs/rs/Android.mk | 2 | ||||
-rw-r--r-- | libs/rs/RenderScript.h | 2 | ||||
-rw-r--r-- | libs/rs/rsAdapter.cpp | 4 | ||||
-rw-r--r-- | libs/rs/rsAllocation.cpp | 52 | ||||
-rw-r--r-- | libs/rs/rsAnimation.cpp | 5 | ||||
-rw-r--r-- | libs/rs/rsComponent.cpp | 10 | ||||
-rw-r--r-- | libs/rs/rsContext.h | 50 | ||||
-rw-r--r-- | libs/rs/rsContextHostStub.h | 123 | ||||
-rw-r--r-- | libs/rs/rsDevice.cpp | 4 | ||||
-rw-r--r-- | libs/rs/rsElement.cpp | 4 | ||||
-rw-r--r-- | libs/rs/rsFileA3D.cpp | 5 | ||||
-rw-r--r-- | libs/rs/rsFont.cpp | 4 | ||||
-rw-r--r-- | libs/rs/rsMesh.cpp | 13 | ||||
-rw-r--r-- | libs/rs/rsMesh.h | 2 | ||||
-rw-r--r-- | libs/rs/rsObjectBase.cpp | 6 | ||||
-rw-r--r-- | libs/rs/rsProgram.cpp | 8 | ||||
-rw-r--r-- | libs/rs/rsProgramFragment.cpp | 8 | ||||
-rw-r--r-- | libs/rs/rsProgramRaster.cpp | 8 | ||||
-rw-r--r-- | libs/rs/rsProgramStore.cpp | 8 | ||||
-rw-r--r-- | libs/rs/rsProgramVertex.cpp | 8 | ||||
-rw-r--r-- | libs/rs/rsSampler.cpp | 10 | ||||
-rw-r--r-- | libs/rs/rsShaderCache.cpp | 7 | ||||
-rw-r--r-- | libs/rs/rsStream.cpp | 5 | ||||
-rw-r--r-- | libs/rs/rsType.cpp | 4 | ||||
-rw-r--r-- | libs/rs/rsUtils.h | 2 | ||||
-rw-r--r-- | libs/rs/rsVertexArray.cpp | 5 |
26 files changed, 98 insertions, 261 deletions
diff --git a/libs/rs/Android.mk b/libs/rs/Android.mk index 2d0b6c4..25c8beb 100644 --- a/libs/rs/Android.mk +++ b/libs/rs/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/libs/rs/RenderScript.h b/libs/rs/RenderScript.h index 882a0b0..bb5e4aa 100644 --- a/libs/rs/RenderScript.h +++ b/libs/rs/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/libs/rs/rsAdapter.cpp b/libs/rs/rsAdapter.cpp index 8d363fd..6e8ca70 100644 --- a/libs/rs/rsAdapter.cpp +++ b/libs/rs/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/libs/rs/rsAllocation.cpp b/libs/rs/rsAllocation.cpp index 2839b76..54dcbcb 100644 --- a/libs/rs/rsAllocation.cpp +++ b/libs/rs/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/libs/rs/rsAnimation.cpp b/libs/rs/rsAnimation.cpp index 6abda3c..48b4f02 100644 --- a/libs/rs/rsAnimation.cpp +++ b/libs/rs/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/libs/rs/rsComponent.cpp b/libs/rs/rsComponent.cpp index cb3caf8..4c4987a 100644 --- a/libs/rs/rsComponent.cpp +++ b/libs/rs/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/libs/rs/rsContext.h b/libs/rs/rsContext.h index 9f94f26..c5e32a6 100644 --- a/libs/rs/rsContext.h +++ b/libs/rs/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/libs/rs/rsContextHostStub.h b/libs/rs/rsContextHostStub.h deleted file mode 100644 index 7e8ec39..0000000 --- a/libs/rs/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/libs/rs/rsDevice.cpp b/libs/rs/rsDevice.cpp index dd96445..d7d03f6 100644 --- a/libs/rs/rsDevice.cpp +++ b/libs/rs/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/libs/rs/rsElement.cpp b/libs/rs/rsElement.cpp index 7c3b9e8..477cb61 100644 --- a/libs/rs/rsElement.cpp +++ b/libs/rs/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/libs/rs/rsFileA3D.cpp b/libs/rs/rsFileA3D.cpp index 97ce8c8..cd02c24 100644 --- a/libs/rs/rsFileA3D.cpp +++ b/libs/rs/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/libs/rs/rsFont.cpp b/libs/rs/rsFont.cpp index 7fdfbe0..8a5ab99 100644 --- a/libs/rs/rsFont.cpp +++ b/libs/rs/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/libs/rs/rsMesh.cpp b/libs/rs/rsMesh.cpp index 8cf76e5..76fe62d 100644 --- a/libs/rs/rsMesh.cpp +++ b/libs/rs/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/libs/rs/rsMesh.h b/libs/rs/rsMesh.h index e44f90d..3e080e2 100644 --- a/libs/rs/rsMesh.h +++ b/libs/rs/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/libs/rs/rsObjectBase.cpp b/libs/rs/rsObjectBase.cpp index aec2f67..f428f94 100644 --- a/libs/rs/rsObjectBase.cpp +++ b/libs/rs/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/libs/rs/rsProgram.cpp b/libs/rs/rsProgram.cpp index 39b85e3..4ef05bf 100644 --- a/libs/rs/rsProgram.cpp +++ b/libs/rs/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/libs/rs/rsProgramFragment.cpp b/libs/rs/rsProgramFragment.cpp index 22cd5d3..ff314b7 100644 --- a/libs/rs/rsProgramFragment.cpp +++ b/libs/rs/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/libs/rs/rsProgramRaster.cpp b/libs/rs/rsProgramRaster.cpp index f2b5b9a..ace1572 100644 --- a/libs/rs/rsProgramRaster.cpp +++ b/libs/rs/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/libs/rs/rsProgramStore.cpp b/libs/rs/rsProgramStore.cpp index 72ac574..09b759d 100644 --- a/libs/rs/rsProgramStore.cpp +++ b/libs/rs/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/libs/rs/rsProgramVertex.cpp b/libs/rs/rsProgramVertex.cpp index ad2beaf..403c2a6 100644 --- a/libs/rs/rsProgramVertex.cpp +++ b/libs/rs/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/libs/rs/rsSampler.cpp b/libs/rs/rsSampler.cpp index c80aecc..db2383a 100644 --- a/libs/rs/rsSampler.cpp +++ b/libs/rs/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/libs/rs/rsShaderCache.cpp b/libs/rs/rsShaderCache.cpp index b958021..e8d89c2 100644 --- a/libs/rs/rsShaderCache.cpp +++ b/libs/rs/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/libs/rs/rsStream.cpp b/libs/rs/rsStream.cpp index 49ed567..b9df0cc 100644 --- a/libs/rs/rsStream.cpp +++ b/libs/rs/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/libs/rs/rsType.cpp b/libs/rs/rsType.cpp index b94c2f8..cd2be94 100644 --- a/libs/rs/rsType.cpp +++ b/libs/rs/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/libs/rs/rsUtils.h b/libs/rs/rsUtils.h index 0699b57..3b60af5 100644 --- a/libs/rs/rsUtils.h +++ b/libs/rs/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/libs/rs/rsVertexArray.cpp b/libs/rs/rsVertexArray.cpp index d9393fe..354ee89 100644 --- a/libs/rs/rsVertexArray.cpp +++ b/libs/rs/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; |