Bug 946958 part 5. Misc tidy ups. r=mattwoodrow
☠☠ backed out by 45193a6d7994 ☠ ☠
authorNicholas Cameron <ncameron@mozilla.com>
Mon, 09 Dec 2013 14:41:00 +1300
changeset 175157 6dd0a6cb9ab335b8aefbd4a21cf991d3e8ee4f68
parent 175156 498152aec5b1eadb68ad76e9d9b9f95cef5e97f5
child 175158 45193a6d79940ecb744556386d47aa8a7fbc37f1
push id445
push userffxbld
push dateMon, 10 Mar 2014 22:05:19 +0000
treeherdermozilla-release@dc38b741b04e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow
bugs946958
milestone28.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 946958 part 5. Misc tidy ups. r=mattwoodrow
gfx/layers/composite/LayerManagerComposite.cpp
gfx/layers/composite/LayerManagerComposite.h
--- a/gfx/layers/composite/LayerManagerComposite.cpp
+++ b/gfx/layers/composite/LayerManagerComposite.cpp
@@ -297,17 +297,17 @@ LayerManagerComposite::CreateCanvasLayer
 LayerComposite*
 LayerManagerComposite::RootLayer() const
 {
   if (mDestroyed) {
     NS_WARNING("Call on destroyed layer manager");
     return nullptr;
   }
 
-  return static_cast<LayerComposite*>(mRoot->ImplData());
+  return ToLayerComposite(mRoot);
 }
 
 static uint16_t sFrameCount = 0;
 void
 LayerManagerComposite::RenderDebugOverlay(const Rect& aBounds)
 {
   if (!gfxPlatform::DrawFrameCounter()) {
     return;
@@ -713,17 +713,17 @@ LayerManagerComposite::AutoAddMaskEffect
                                                             EffectChain& aEffects,
                                                             bool aIs3D)
   : mCompositable(nullptr)
 {
   if (!aMaskLayer) {
     return;
   }
 
-  mCompositable = static_cast<LayerComposite*>(aMaskLayer->ImplData())->GetCompositableHost();
+  mCompositable = ToLayerComposite(aMaskLayer)->GetCompositableHost();
   if (!mCompositable) {
     NS_WARNING("Mask layer with no compositable host");
     return;
   }
 
   gfx::Matrix4x4 transform;
   ToMatrix4x4(aMaskLayer->GetEffectiveTransform(), transform);
   mCompositable->AddMaskEffect(aEffects, transform, aIs3D);
--- a/gfx/layers/composite/LayerManagerComposite.h
+++ b/gfx/layers/composite/LayerManagerComposite.h
@@ -137,27 +137,26 @@ public:
   already_AddRefed<ContainerLayerComposite> CreateContainerLayerComposite();
   already_AddRefed<ImageLayerComposite> CreateImageLayerComposite();
   already_AddRefed<ColorLayerComposite> CreateColorLayerComposite();
   already_AddRefed<CanvasLayerComposite> CreateCanvasLayerComposite();
   already_AddRefed<RefLayerComposite> CreateRefLayerComposite();
 
   virtual LayersBackend GetBackendType() MOZ_OVERRIDE
   {
-    return LAYERS_NONE;
+    MOZ_CRASH("Shouldn't be called for composited layer manager");
   }
   virtual void GetBackendName(nsAString& name) MOZ_OVERRIDE
   {
     MOZ_CRASH("Shouldn't be called for composited layer manager");
   }
 
   virtual already_AddRefed<gfxASurface>
     CreateOptimalMaskSurface(const gfxIntSize &aSize) MOZ_OVERRIDE;
 
-
   virtual const char* Name() const MOZ_OVERRIDE { return ""; }
 
   enum WorldTransforPolicy {
     ApplyWorldTransform,
     DontApplyWorldTransform
   };
 
   /**
@@ -184,17 +183,17 @@ public:
     CompositableHost* mCompositable;
   };
 
   /**
    * Creates a DrawTarget which is optimized for inter-operating with this
    * layermanager.
    */
   virtual TemporaryRef<mozilla::gfx::DrawTarget>
-    CreateDrawTarget(const mozilla::gfx::IntSize &aSize,
+    CreateDrawTarget(const mozilla::gfx::IntSize& aSize,
                      mozilla::gfx::SurfaceFormat aFormat) MOZ_OVERRIDE;
 
   /**
    * Calculates the 'completeness' of the rendering that intersected with the
    * screen on the last render. This is only useful when progressive tile
    * drawing is enabled, otherwise this will always return 1.0.
    * This function's expense scales with the size of the layer tree and the
    * complexity of individual layers' valid regions.
@@ -230,17 +229,17 @@ public:
   { mDebugOverlayWantsNextFrame = aVal; }
 
 private:
   /** Region we're clipping our current drawing to. */
   nsIntRegion mClippingRegion;
   nsIntRect mRenderBounds;
 
   /** Current root layer. */
-  LayerComposite *RootLayer() const;
+  LayerComposite* RootLayer() const;
 
   /**
    * Recursive helper method for use by ComputeRenderIntegrity. Subtracts
    * any incomplete rendering on aLayer from aScreenRegion. Any low-precision
    * rendering is included in aLowPrecisionScreenRegion. aTransform is the
    * accumulated transform of intermediate surfaces beneath aLayer.
    */
   static void ComputeRenderIntegrityInternal(Layer* aLayer,