Bug 993784 - Part 4: Remove a bunch of dead thebes code in BasicLayers. r=roc

This commit is contained in:
Matt Woodrow 2014-04-09 21:15:19 +12:00
Родитель 7eb134032b
Коммит 90fd035479
5 изменённых файлов: 0 добавлений и 96 удалений

Просмотреть файл

@ -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<gfxASurface> mSurface;
AutoMaskData(const AutoMaskData&) MOZ_DELETE;
AutoMaskData& operator=(const AutoMaskData&) MOZ_DELETE;
};
class MOZ_STACK_CLASS AutoMoz2DMaskData {
public:
AutoMoz2DMaskData() { }

Просмотреть файл

@ -53,7 +53,6 @@ public:
virtual void Paint(DrawTarget* aDT, Layer* aMaskLayer) MOZ_OVERRIDE;
virtual bool GetAsSurface(gfxASurface** aSurface);
virtual TemporaryRef<SourceSurface> 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<gfxASurface> surface = mContainer->DeprecatedGetCurrentAsSurface(&dontCare);
surface.forget(aSurface);
return true;
}
TemporaryRef<SourceSurface>
BasicImageLayer::GetAsSourceSurface()
{

Просмотреть файл

@ -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<gfx::SourceSurface> GetAsSourceSurface() { return nullptr; }
bool GetClipToVisibleRegion() { return mClipToVisibleRegion; }

Просмотреть файл

@ -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<gfxASurface> surface;
if (static_cast<BasicImplData*>(aMaskLayer->ImplData())
->GetAsSurface(getter_AddRefs(surface)) &&
surface) {
Matrix transform;
Matrix4x4 effectiveTransform = aMaskLayer->GetEffectiveTransform();
DebugOnly<bool> 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)
{

Просмотреть файл

@ -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