summaryrefslogtreecommitdiffstats
path: root/rsAllocation.cpp
diff options
context:
space:
mode:
authorJason Sams <rjsams@android.com>2009-11-24 12:57:57 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2009-11-24 12:57:57 -0800
commite6c6078f301a197f310b0ae0c12031188e7c1b6b (patch)
tree16d5d303f18f9430855bed2d5cb81b7db1597845 /rsAllocation.cpp
parentb9db990dfa4ef16cfd2574311683e785ecb90fbd (diff)
parent7fa48a132b688d75b843d756ede0211d77baa530 (diff)
downloadandroid_frameworks_rs-e6c6078f301a197f310b0ae0c12031188e7c1b6b.tar.gz
android_frameworks_rs-e6c6078f301a197f310b0ae0c12031188e7c1b6b.tar.bz2
android_frameworks_rs-e6c6078f301a197f310b0ae0c12031188e7c1b6b.zip
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 'rsAllocation.cpp')
-rw-r--r--rsAllocation.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/rsAllocation.cpp b/rsAllocation.cpp
index c997c73a..3aee6b8a 100644
--- a/rsAllocation.cpp
+++ b/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)