mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 993784 - Part 4: Remove a bunch of dead thebes code in BasicLayers. r=roc
This commit is contained in:
parent
0d1657de44
commit
fa494161c4
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user