diff options
author | Jason Sams <rjsams@android.com> | 2009-11-24 12:57:57 -0800 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2009-11-24 12:57:57 -0800 |
commit | 0a2e7a39632cb5e98b1e9ae593609bbdda829dc2 (patch) | |
tree | d79893c80cf6190f31ff800fa7a7587cc100026f /libs/rs | |
parent | 5bb9771ec74b6e8db7136c1b10aefececcb33719 (diff) | |
parent | e4df64bdaaf86fb7d06715de122a97d723d7fea2 (diff) | |
download | frameworks_base-0a2e7a39632cb5e98b1e9ae593609bbdda829dc2.zip frameworks_base-0a2e7a39632cb5e98b1e9ae593609bbdda829dc2.tar.gz frameworks_base-0a2e7a39632cb5e98b1e9ae593609bbdda829dc2.tar.bz2 |
am e4df64bd: am 66358e24: am 9dab667e: Force a crash under conditions where white square bug in all apps is likely to occur.
Merge commit 'e4df64bdaaf86fb7d06715de122a97d723d7fea2'
* commit 'e4df64bdaaf86fb7d06715de122a97d723d7fea2':
Force a crash under conditions where white square bug in all apps is likely to occur.
Diffstat (limited to 'libs/rs')
-rw-r--r-- | libs/rs/rsAllocation.cpp | 13 | ||||
-rw-r--r-- | libs/rs/rsAllocation.h | 2 | ||||
-rw-r--r-- | libs/rs/rsContext.cpp | 18 | ||||
-rw-r--r-- | libs/rs/rsContext.h | 2 |
4 files changed, 32 insertions, 3 deletions
diff --git a/libs/rs/rsAllocation.cpp b/libs/rs/rsAllocation.cpp index c997c73..3aee6b8 100644 --- a/libs/rs/rsAllocation.cpp +++ b/libs/rs/rsAllocation.cpp @@ -88,7 +88,7 @@ bool Allocation::fixAllocation() return false; } -void Allocation::uploadToTexture(uint32_t lodOffset) +void Allocation::uploadToTexture(Context *rsc, uint32_t lodOffset) { //rsAssert(!mTextureId); rsAssert(lodOffset < mType->getLODCount()); @@ -102,6 +102,15 @@ void Allocation::uploadToTexture(uint32_t lodOffset) if (!mTextureID) { glGenTextures(1, &mTextureID); + + if (!mTextureID) { + // This should not happen, however, its likely the cause of the + // white sqare bug. + // Force a crash to 1: restart the app, 2: make sure we get a bugreport. + LOGE("Upload to texture failed to gen mTextureID"); + rsc->dumpDebug(); + ((char *)0)[0] = 0; + } } glBindTexture(GL_TEXTURE_2D, mTextureID); glPixelStorei(GL_UNPACK_ALIGNMENT, 1); @@ -262,7 +271,7 @@ RsAllocation rsi_AllocationCreateSized(Context *rsc, RsElement e, size_t count) void rsi_AllocationUploadToTexture(Context *rsc, RsAllocation va, uint32_t baseMipLevel) { Allocation *alloc = static_cast<Allocation *>(va); - alloc->uploadToTexture(baseMipLevel); + alloc->uploadToTexture(rsc, baseMipLevel); } void rsi_AllocationUploadToBufferObject(Context *rsc, RsAllocation va) diff --git a/libs/rs/rsAllocation.h b/libs/rs/rsAllocation.h index ac2edf8..490abcf 100644 --- a/libs/rs/rsAllocation.h +++ b/libs/rs/rsAllocation.h @@ -46,7 +46,7 @@ public: void * getPtr() const {return mPtr;} const Type * getType() const {return mType.get();} - void uploadToTexture(uint32_t lodOffset = 0); + void uploadToTexture(Context *rsc, uint32_t lodOffset = 0); uint32_t getTextureID() const {return mTextureID;} void uploadToBufferObject(); diff --git a/libs/rs/rsContext.cpp b/libs/rs/rsContext.cpp index 5cca60f..c1943c0 100644 --- a/libs/rs/rsContext.cpp +++ b/libs/rs/rsContext.cpp @@ -718,6 +718,24 @@ void Context::deinitToClient() mIO.mToClient.shutdown(); } +void Context::dumpDebug() const +{ + LOGE("RS Context debug %p", this); + LOGE("RS Context debug"); + + LOGE(" EGL ver %i %i", mEGL.mMajorVersion, mEGL.mMinorVersion); + LOGE(" EGL context %p surface %p, w=%i h=%i Display=%p", mEGL.mContext, + mEGL.mSurface, mEGL.mWidth, mEGL.mHeight, mEGL.mDisplay); + LOGE(" GL vendor: %s", mGL.mVendor); + LOGE(" GL renderer: %s", mGL.mRenderer); + LOGE(" GL Version: %s", mGL.mVersion); + LOGE(" GL Extensions: %s", mGL.mExtensions); + LOGE(" GL int Versions %i %i", mGL.mMajorVersion, mGL.mMinorVersion); + LOGE(" RS width %i, height %i", mWidth, mHeight); + LOGE(" RS running %i, exit %i, useDepth %i, paused %i", mRunning, mExit, mUseDepth, mPaused); + LOGE(" RS pThreadID %li, nativeThreadID %i", mThreadId, mNativeThreadId); + +} /////////////////////////////////////////////////////////////////////////////////////////// // diff --git a/libs/rs/rsContext.h b/libs/rs/rsContext.h index 07cb7ba..991e2ef 100644 --- a/libs/rs/rsContext.h +++ b/libs/rs/rsContext.h @@ -161,6 +161,8 @@ public: bool mLogObjects; } props; + void dumpDebug() const; + mutable const ObjectBase * mObjHead; protected: |