Bug 1254134 - Remove unused mask flag. r=mattwoodrow
authorKartikaya Gupta <kgupta@mozilla.com>
Wed, 23 Mar 2016 21:12:04 -0400
changeset 290230 49b1c3749ae6de5a8fe5b1a151f0924ee17f30dd
parent 290229 24789e0f53313d1b95cbcffcf60aaf59d4210846
child 290231 bc443e4eaecaf1007c242cbcd954aaf1fe9ad493
push id19656
push usergwagner@mozilla.com
push dateMon, 04 Apr 2016 13:43:23 +0000
treeherderb2g-inbound@e99061fde28a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow
bugs1254134
milestone48.0a1
Bug 1254134 - Remove unused mask flag. r=mattwoodrow
gfx/layers/LayerTreeInvalidation.cpp
--- a/gfx/layers/LayerTreeInvalidation.cpp
+++ b/gfx/layers/LayerTreeInvalidation.cpp
@@ -40,17 +40,17 @@
 #endif
 
 using namespace mozilla::gfx;
 
 namespace mozilla {
 namespace layers {
 
 struct LayerPropertiesBase;
-UniquePtr<LayerPropertiesBase> CloneLayerTreePropertiesInternal(Layer* aRoot, bool aIsMask = false);
+UniquePtr<LayerPropertiesBase> CloneLayerTreePropertiesInternal(Layer* aRoot);
 
 /**
  * Get accumulated transform of from the context creating layer to the
  * given layer.
  */
 static Matrix4x4
 GetTransformIn3DContext(Layer* aLayer) {
   Matrix4x4 transform = aLayer->GetLocalTransform();
@@ -149,21 +149,21 @@ struct LayerPropertiesBase : public Laye
     , mInvalidRegion(aLayer->GetInvalidRegion())
     , mPostXScale(aLayer->GetPostXScale())
     , mPostYScale(aLayer->GetPostYScale())
     , mOpacity(aLayer->GetLocalOpacity())
     , mUseClipRect(!!aLayer->GetEffectiveClipRect())
   {
     MOZ_COUNT_CTOR(LayerPropertiesBase);
     if (aLayer->GetMaskLayer()) {
-      mMaskLayer = CloneLayerTreePropertiesInternal(aLayer->GetMaskLayer(), true);
+      mMaskLayer = CloneLayerTreePropertiesInternal(aLayer->GetMaskLayer());
     }
     for (size_t i = 0; i < aLayer->GetAncestorMaskLayerCount(); i++) {
       Layer* maskLayer = aLayer->GetAncestorMaskLayerAt(i);
-      mAncestorMaskLayers.AppendElement(CloneLayerTreePropertiesInternal(maskLayer, true));
+      mAncestorMaskLayers.AppendElement(CloneLayerTreePropertiesInternal(maskLayer));
     }
     if (mUseClipRect) {
       mClipRect = *aLayer->GetEffectiveClipRect();
     }
     mTransform = GetTransformForInvalidation(aLayer);
   }
   LayerPropertiesBase()
     : mLayer(nullptr)
@@ -480,26 +480,25 @@ static ImageHost* GetImageHost(Layer* aL
   if (composite) {
     return static_cast<ImageHost*>(composite->GetCompositableHost());
   }
   return nullptr;
 }
 
 struct ImageLayerProperties : public LayerPropertiesBase
 {
-  explicit ImageLayerProperties(ImageLayer* aImage, bool aIsMask)
+  explicit ImageLayerProperties(ImageLayer* aImage)
     : LayerPropertiesBase(aImage)
     , mContainer(aImage->GetContainer())
     , mImageHost(GetImageHost(aImage))
     , mFilter(aImage->GetFilter())
     , mScaleToSize(aImage->GetScaleToSize())
     , mScaleMode(aImage->GetScaleMode())
     , mLastProducerID(-1)
     , mLastFrameID(-1)
-    , mIsMask(aIsMask)
   {
     if (mContainer) {
       mRect.SizeTo(mContainer->GetCurrentSize());
     }
     if (mImageHost) {
       mRect.SizeTo(mImageHost->GetImageSize());
       mLastProducerID = mImageHost->GetLastProducerID();
       mLastFrameID = mImageHost->GetLastFrameID();
@@ -567,17 +566,16 @@ struct ImageLayerProperties : public Lay
   RefPtr<ImageContainer> mContainer;
   RefPtr<ImageHost> mImageHost;
   Filter mFilter;
   gfx::IntSize mScaleToSize;
   ScaleMode mScaleMode;
   IntRect mRect;
   int32_t mLastProducerID;
   int32_t mLastFrameID;
-  bool mIsMask;
 };
 
 struct CanvasLayerProperties : public LayerPropertiesBase
 {
   explicit CanvasLayerProperties(CanvasLayer* aCanvas)
     : LayerPropertiesBase(aCanvas)
     , mImageHost(GetImageHost(aCanvas))
   {
@@ -600,32 +598,30 @@ struct CanvasLayerProperties : public La
     return IntRect();
   }
 
   RefPtr<ImageHost> mImageHost;
   int32_t mFrameID;
 };
 
 UniquePtr<LayerPropertiesBase>
-CloneLayerTreePropertiesInternal(Layer* aRoot, bool aIsMask /* = false */)
+CloneLayerTreePropertiesInternal(Layer* aRoot)
 {
   if (!aRoot) {
     return MakeUnique<LayerPropertiesBase>();
   }
 
-  MOZ_ASSERT(!aIsMask || aRoot->GetType() == Layer::TYPE_IMAGE);
-
   switch (aRoot->GetType()) {
     case Layer::TYPE_CONTAINER:
     case Layer::TYPE_REF:
       return MakeUnique<ContainerLayerProperties>(aRoot->AsContainerLayer());
     case Layer::TYPE_COLOR:
       return MakeUnique<ColorLayerProperties>(static_cast<ColorLayer*>(aRoot));
     case Layer::TYPE_IMAGE:
-      return MakeUnique<ImageLayerProperties>(static_cast<ImageLayer*>(aRoot), aIsMask);
+      return MakeUnique<ImageLayerProperties>(static_cast<ImageLayer*>(aRoot));
     case Layer::TYPE_CANVAS:
       return MakeUnique<CanvasLayerProperties>(static_cast<CanvasLayer*>(aRoot));
     case Layer::TYPE_READBACK:
     case Layer::TYPE_SHADOW:
     case Layer::TYPE_PAINTED:
       return MakeUnique<LayerPropertiesBase>(aRoot);
   }