Bug 1187464 - Part 1. We can get the wrong texture source type, so deal with it. r=mstange
☠☠ backed out by 52a2a349ff2a ☠ ☠
authorMilan Sreckovic <milan@mozilla.com>
Tue, 02 Feb 2016 11:05:00 +0100
changeset 319198 63e2a056311a04e1275d5e8d7ecb439c19b641b8
parent 319197 ea7d83c65f5d36ca48f0c0d9765411876c0a1787
child 319199 0cee3cdcce999005de31fabfb4841ac70d534b98
push id5913
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 16:57:49 +0000
treeherdermozilla-beta@dcaf0a6fa115 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmstange
bugs1187464
milestone47.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1187464 - Part 1. We can get the wrong texture source type, so deal with it. r=mstange
gfx/2d/Logging.h
gfx/layers/basic/BasicCompositor.cpp
--- a/gfx/2d/Logging.h
+++ b/gfx/2d/Logging.h
@@ -126,16 +126,17 @@ enum class LogReason : int {
   FilterInputFormat,
   FilterNodeD2D1Target,
   FilterNodeD2D1Backend,
   SourceSurfaceIncompatible,
   GlyphAllocFailedCairo,
   GlyphAllocFailedCG,
   InvalidRect,
   CannotDraw3D, // 20
+  IncompatibleBasicTexturedEffect,
   // End
   MustBeLessThanThis = 101,
 };
 
 struct BasicLogger
 {
   // For efficiency, this method exists and copies the logic of the
   // OutputMessage below.  If making any changes here, also make it
--- a/gfx/layers/basic/BasicCompositor.cpp
+++ b/gfx/layers/basic/BasicCompositor.cpp
@@ -425,37 +425,40 @@ BasicCompositor::DrawQuad(const gfx::Rec
       }
       break;
     }
     case EffectTypes::RGB: {
       TexturedEffect* texturedEffect =
           static_cast<TexturedEffect*>(aEffectChain.mPrimaryEffect.get());
       TextureSourceBasic* source = texturedEffect->mTexture->AsSourceBasic();
 
-      if (texturedEffect->mPremultiplied) {
+      if (source && texturedEffect->mPremultiplied) {
           DrawSurfaceWithTextureCoords(dest, aRect,
                                        source->GetSurface(dest),
                                        texturedEffect->mTextureCoords,
                                        texturedEffect->mFilter,
                                        DrawOptions(aOpacity, blendMode),
                                        sourceMask, &maskTransform);
-      } else {
+      } else if (source) {
           RefPtr<DataSourceSurface> srcData = source->GetSurface(dest)->GetDataSurface();
 
           // Yes, we re-create the premultiplied data every time.
           // This might be better with a cache, eventually.
           RefPtr<DataSourceSurface> premultData = gfxUtils::CreatePremultipliedDataSurface(srcData);
 
           DrawSurfaceWithTextureCoords(dest, aRect,
                                        premultData,
                                        texturedEffect->mTextureCoords,
                                        texturedEffect->mFilter,
                                        DrawOptions(aOpacity, blendMode),
                                        sourceMask, &maskTransform);
+      } else {
+        gfxDevCrash(LogReason::IncompatibleBasicTexturedEffect) << "Bad for basic";
       }
+
       break;
     }
     case EffectTypes::YCBCR: {
       NS_RUNTIMEABORT("Can't (easily) support component alpha with BasicCompositor!");
       break;
     }
     case EffectTypes::RENDER_TARGET: {
       EffectRenderTarget* effectRenderTarget =