summaryrefslogtreecommitdiffstats
path: root/libs/rs/rsAllocation.cpp
diff options
context:
space:
mode:
authorJason Sams <rjsams@android.com>2009-11-24 12:53:32 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2009-11-24 12:53:32 -0800
commite4df64bdaaf86fb7d06715de122a97d723d7fea2 (patch)
tree6b8bc8c6b5da6985d58de5031957d9fec22379f5 /libs/rs/rsAllocation.cpp
parentb867594323f430d83e4b51279c79d1f057b70267 (diff)
parent66358e24a6bbc2017c2edd921a64e616b4c9cac4 (diff)
downloadframeworks_base-e4df64bdaaf86fb7d06715de122a97d723d7fea2.zip
frameworks_base-e4df64bdaaf86fb7d06715de122a97d723d7fea2.tar.gz
frameworks_base-e4df64bdaaf86fb7d06715de122a97d723d7fea2.tar.bz2
am 66358e24: am 9dab667e: Force a crash under conditions where white square bug in all apps is likely to occur.
Merge commit '66358e24a6bbc2017c2edd921a64e616b4c9cac4' into eclair-mr2-plus-aosp * commit '66358e24a6bbc2017c2edd921a64e616b4c9cac4': Force a crash under conditions where white square bug in all apps is likely to occur.
Diffstat (limited to 'libs/rs/rsAllocation.cpp')
-rw-r--r--libs/rs/rsAllocation.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/libs/rs/rsAllocation.cpp b/libs/rs/rsAllocation.cpp
index b71d10c..ff8d29f 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);
@@ -238,7 +247,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)