From 90fd0354793626abd569031890dc40c4ec2f5328 Mon Sep 17 00:00:00 2001 From: Matt Woodrow Date: Wed, 9 Apr 2014 21:15:19 +1200 Subject: [PATCH] Bug 993784 - Part 4: Remove a bunch of dead thebes code in BasicLayers. r=roc --- gfx/layers/basic/AutoMaskData.h | 29 ----------------- gfx/layers/basic/BasicImageLayer.cpp | 14 -------- gfx/layers/basic/BasicImplData.h | 2 -- gfx/layers/basic/BasicLayersImpl.cpp | 48 ---------------------------- gfx/layers/basic/BasicLayersImpl.h | 3 -- 5 files changed, 96 deletions(-) diff --git a/gfx/layers/basic/AutoMaskData.h b/gfx/layers/basic/AutoMaskData.h index f9cfc54f57cc..15127f1eedae 100644 --- a/gfx/layers/basic/AutoMaskData.h +++ b/gfx/layers/basic/AutoMaskData.h @@ -18,35 +18,6 @@ namespace layers { * This helper class manages the gfxASurface * logic. */ -class MOZ_STACK_CLASS AutoMaskData { -public: - AutoMaskData() { } - ~AutoMaskData() { } - - /** - * Construct this out of either a gfxASurface or a - * SurfaceDescriptor. Construct() must only be called once. - * GetSurface() and GetTransform() must not be called until this has - * been constructed. - */ - - void Construct(const gfx::Matrix& aTransform, - gfxASurface* aSurface); - - /** The returned surface can't escape the scope of |this|. */ - gfxASurface* GetSurface(); - const gfx::Matrix& GetTransform(); - -private: - bool IsConstructed(); - - gfx::Matrix mTransform; - nsRefPtr mSurface; - - AutoMaskData(const AutoMaskData&) MOZ_DELETE; - AutoMaskData& operator=(const AutoMaskData&) MOZ_DELETE; -}; - class MOZ_STACK_CLASS AutoMoz2DMaskData { public: AutoMoz2DMaskData() { } diff --git a/gfx/layers/basic/BasicImageLayer.cpp b/gfx/layers/basic/BasicImageLayer.cpp index 372ad7790b90..4ea15c905909 100644 --- a/gfx/layers/basic/BasicImageLayer.cpp +++ b/gfx/layers/basic/BasicImageLayer.cpp @@ -53,7 +53,6 @@ public: virtual void Paint(DrawTarget* aDT, Layer* aMaskLayer) MOZ_OVERRIDE; - virtual bool GetAsSurface(gfxASurface** aSurface); virtual TemporaryRef GetAsSourceSurface() MOZ_OVERRIDE; protected: @@ -132,19 +131,6 @@ BasicImageLayer::GetAndPaintCurrentImage(DrawTarget* aTarget, mContainer->UnlockCurrentImage(); } -bool -BasicImageLayer::GetAsSurface(gfxASurface** aSurface) -{ - if (!mContainer) { - return false; - } - - gfx::IntSize dontCare; - nsRefPtr surface = mContainer->DeprecatedGetCurrentAsSurface(&dontCare); - surface.forget(aSurface); - return true; -} - TemporaryRef BasicImageLayer::GetAsSourceSurface() { diff --git a/gfx/layers/basic/BasicImplData.h b/gfx/layers/basic/BasicImplData.h index b112c0ca6160..aebc001745c2 100644 --- a/gfx/layers/basic/BasicImplData.h +++ b/gfx/layers/basic/BasicImplData.h @@ -117,8 +117,6 @@ public: * return false if a surface cannot be created. If true is * returned, only one of |aSurface| or |aDescriptor| is valid. */ - virtual bool GetAsSurface(gfxASurface** aSurface) - { return false; } virtual TemporaryRef GetAsSourceSurface() { return nullptr; } bool GetClipToVisibleRegion() { return mClipToVisibleRegion; } diff --git a/gfx/layers/basic/BasicLayersImpl.cpp b/gfx/layers/basic/BasicLayersImpl.cpp index 8d1926bd4f10..fcc600e7233f 100644 --- a/gfx/layers/basic/BasicLayersImpl.cpp +++ b/gfx/layers/basic/BasicLayersImpl.cpp @@ -18,54 +18,6 @@ using namespace mozilla::gfx; namespace mozilla { namespace layers { -void -AutoMaskData::Construct(const gfx::Matrix& aTransform, - gfxASurface* aSurface) -{ - MOZ_ASSERT(!IsConstructed()); - mTransform = aTransform; - mSurface = aSurface; -} - -gfxASurface* -AutoMaskData::GetSurface() -{ - MOZ_ASSERT(IsConstructed()); - return mSurface.get(); -} - -const gfx::Matrix& -AutoMaskData::GetTransform() -{ - MOZ_ASSERT(IsConstructed()); - return mTransform; -} - -bool -AutoMaskData::IsConstructed() -{ - return !!mSurface; -} - -bool -GetMaskData(Layer* aMaskLayer, AutoMaskData* aMaskData) -{ - if (aMaskLayer) { - nsRefPtr surface; - if (static_cast(aMaskLayer->ImplData()) - ->GetAsSurface(getter_AddRefs(surface)) && - surface) { - Matrix transform; - Matrix4x4 effectiveTransform = aMaskLayer->GetEffectiveTransform(); - DebugOnly maskIs2D = effectiveTransform.CanDraw2D(&transform); - NS_ASSERTION(maskIs2D, "How did we end up with a 3D transform here?!"); - aMaskData->Construct(transform, surface); - return true; - } - } - return false; -} - bool GetMaskData(Layer* aMaskLayer, AutoMoz2DMaskData* aMaskData) { diff --git a/gfx/layers/basic/BasicLayersImpl.h b/gfx/layers/basic/BasicLayersImpl.h index e54fcead8c60..1388fec134bb 100644 --- a/gfx/layers/basic/BasicLayersImpl.h +++ b/gfx/layers/basic/BasicLayersImpl.h @@ -25,7 +25,6 @@ class DrawTarget; namespace layers { -class AutoMaskData; class AutoMoz2DMaskData; class BasicContainerLayer; class Layer; @@ -84,8 +83,6 @@ protected: * The transform for the layer will be put in aMaskData */ bool -GetMaskData(Layer* aMaskLayer, AutoMaskData* aMaskData); -bool GetMaskData(Layer* aMaskLayer, AutoMoz2DMaskData* aMaskData); // Paint the current source to a context using a mask, if present