Bug 1182147: Ensure ImageHost does not attempt to call DrawQuad with an effect unsupported by the compositor. r=nical
authorBas Schouten <bschouten@mozilla.com>
Fri, 04 Sep 2015 18:31:52 +0000
changeset 262594 05202b078d10b15e05b6f1c7151446ac0ca10b02
parent 262593 689f55b551e6a6473a64e4cc806b7e57c85e0854
child 262595 15f2e2c86ca9f9640cd9bc5ac5546f7441ef01e2
push id15198
push userkwierso@gmail.com
push dateWed, 16 Sep 2015 00:21:31 +0000
treeherderfx-team@dbfddd6efb5d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnical
bugs1182147
milestone43.0a1
Bug 1182147: Ensure ImageHost does not attempt to call DrawQuad with an effect unsupported by the compositor. r=nical
gfx/layers/basic/BasicCompositor.cpp
gfx/layers/composite/ImageHost.cpp
--- a/gfx/layers/basic/BasicCompositor.cpp
+++ b/gfx/layers/basic/BasicCompositor.cpp
@@ -143,17 +143,17 @@ BasicCompositor::CreateDataTextureSource
 {
   RefPtr<DataTextureSource> result = new DataTextureSourceBasic();
   return result.forget();
 }
 
 bool
 BasicCompositor::SupportsEffect(EffectTypes aEffect)
 {
-  return static_cast<EffectTypes>(aEffect) != EffectTypes::YCBCR;
+  return aEffect != EffectTypes::YCBCR && aEffect != EffectTypes::COMPONENT_ALPHA;
 }
 
 static void
 DrawSurfaceWithTextureCoords(DrawTarget *aDest,
                              const gfx::Rect& aDestRect,
                              SourceSurface *aSource,
                              const gfx::Rect& aTextureCoords,
                              gfx::Filter aFilter,
--- a/gfx/layers/composite/ImageHost.cpp
+++ b/gfx/layers/composite/ImageHost.cpp
@@ -307,16 +307,20 @@ ImageHost::Composite(LayerComposite* aLa
     RefPtr<TexturedEffect> effect =
         CreateTexturedEffect(img->mFrontBuffer->GetFormat(),
             img->mTextureSource.get(), aFilter, isAlphaPremultiplied,
             GetRenderState());
     if (!effect) {
       return;
     }
 
+    if (!GetCompositor()->SupportsEffect(effect->mType)) {
+      return;
+    }
+
     if (mLastFrameID != img->mFrameID || mLastProducerID != img->mProducerID) {
       if (mImageContainer) {
         aLayer->GetLayerManager()->
             AppendImageCompositeNotification(ImageCompositeNotification(
                 mImageContainer, nullptr,
                 img->mTimeStamp, GetCompositor()->GetCompositionTime(),
                 img->mFrameID, img->mProducerID));
       }