Bug 1000103 - Fix intermittent OSX crash in TextureImageTextureSourceOGL::GetFormat. r=mattwoodrow

This commit is contained in:
Nicolas Silva 2014-06-09 17:30:53 -04:00
parent f6a64bf117
commit fad7865258
4 changed files with 8 additions and 12 deletions

View File

@ -929,6 +929,7 @@ ContentClientIncremental::GetUpdateSurface(BufferType aType,
mContentType,
&desc)) {
NS_WARNING("creating SurfaceDescriptor failed!");
Clear();
return nullptr;
}

View File

@ -406,14 +406,6 @@ ContentHostIncremental::~ContentHostIncremental()
{
}
void
ContentHostIncremental::DestroyTextures()
{
mSource = nullptr;
mSourceOnWhite = nullptr;
mUpdateList.Clear();
}
bool
ContentHostIncremental::CreatedIncrementalTexture(ISurfaceAllocator* aAllocator,
const TextureInfo& aTextureInfo,
@ -501,6 +493,8 @@ ContentHostIncremental::TextureCreationRequest::Execute(ContentHostIncremental*
}
if (mTextureInfo.mDeprecatedTextureHostFlags & DeprecatedTextureHostFlags::COPY_PREVIOUS) {
MOZ_ASSERT(aHost->mSource);
MOZ_ASSERT(aHost->mSource->IsValid());
nsIntRect bufferRect = aHost->mBufferRect;
nsIntPoint bufferRotation = aHost->mBufferRotation;
nsIntRect overlap;

View File

@ -281,8 +281,6 @@ public:
virtual void PrintInfo(nsACString& aTo, const char* aPrefix) MOZ_OVERRIDE;
virtual void DestroyTextures();
virtual bool Lock() {
MOZ_ASSERT(!mLocked);
ProcessTextureUpdates();

View File

@ -385,8 +385,11 @@ TextureImageTextureSourceOGL::GetSize() const
gfx::SurfaceFormat
TextureImageTextureSourceOGL::GetFormat() const
{
MOZ_ASSERT(mTexImage);
return mTexImage->GetTextureFormat();
if (mTexImage) {
return mTexImage->GetTextureFormat();
}
NS_WARNING("Trying to query the format of an empty TextureSource.");
return gfx::SurfaceFormat::UNKNOWN;
}
nsIntRect TextureImageTextureSourceOGL::GetTileRect()