Bug 1016540 - GrallocTextureSource::DeallocateDeviceData must assert that it has a compositor, rather than a gl context. r=sotaro
authorNicolas Silva <nsilva@mozilla.com>
Tue, 07 Oct 2014 10:45:04 +0200
changeset 209129 c890e0fa846d02d879547df458a9d6c25e540cbc
parent 209128 344c06f4460b1f03a76f79c832c5e3677b6e0fa8
child 209130 8d52ce400c01ec33ffa9d2682f3e9dec8e36537f
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewerssotaro
bugs1016540
milestone35.0a1
Bug 1016540 - GrallocTextureSource::DeallocateDeviceData must assert that it has a compositor, rather than a gl context. r=sotaro
gfx/layers/RotatedBuffer.cpp
gfx/layers/opengl/GrallocTextureHost.cpp
--- a/gfx/layers/RotatedBuffer.cpp
+++ b/gfx/layers/RotatedBuffer.cpp
@@ -722,21 +722,21 @@ RotatedContentBuffer::BorrowDrawTargetFo
     drawPtr = &aIter->mDrawRegion;
   }
   if (result->GetBackendType() == BackendType::DIRECT2D ||
       result->GetBackendType() == BackendType::DIRECT2D1_1) {
     drawPtr->SimplifyOutwardByArea(100 * 100);
   }
 
   if (aPaintState.mMode == SurfaceMode::SURFACE_COMPONENT_ALPHA) {
-    MOZ_ASSERT(mDTBuffer && mDTBufferOnWhite);
     if (!mDTBuffer || !mDTBufferOnWhite) {
       // This can happen in release builds if allocating one of the two buffers
       // failed. This is pretty bad and the reason for the failure is already
       // reported through gfxCriticalError.
+      MOZ_ASSERT(false);
       return nullptr;
     }
     nsIntRegionRectIterator iter(*drawPtr);
     const nsIntRect *iterRect;
     while ((iterRect = iter.Next())) {
       mDTBuffer->FillRect(Rect(iterRect->x, iterRect->y, iterRect->width, iterRect->height),
                           ColorPattern(Color(0.0, 0.0, 0.0, 1.0)));
       mDTBufferOnWhite->FillRect(Rect(iterRect->x, iterRect->y, iterRect->width, iterRect->height),
--- a/gfx/layers/opengl/GrallocTextureHost.cpp
+++ b/gfx/layers/opengl/GrallocTextureHost.cpp
@@ -290,17 +290,17 @@ GrallocTextureSourceOGL::GetSize() const
   }
   return gfx::IntSize(mGraphicBuffer->getWidth(), mGraphicBuffer->getHeight());
 }
 
 void
 GrallocTextureSourceOGL::DeallocateDeviceData()
 {
   if (mEGLImage) {
-    MOZ_ASSERT(gl());
+    MOZ_ASSERT(mCompositor);
     if (!gl() || !gl()->MakeCurrent()) {
       return;
     }
     if (mTextureBackendSpecificData) {
       mTextureBackendSpecificData->ClearBoundEGLImage(mEGLImage);
     }
     EGLImageDestroy(gl(), mEGLImage);
     mEGLImage = EGL_NO_IMAGE;