Backout 76dcfabe0a2a, d8004eb22252, 86e91202ef51 & f9a5736cd6bc (bug 695845) for build failures on windows

This commit is contained in:
Ed Morley
2011-12-19 20:27:59 +00:00
parent b574cbd7c2
commit 968b5c4c1e
4 changed files with 50 additions and 112 deletions

View File

@@ -136,11 +136,10 @@ class THEBES_API ImageContainer {
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(ImageContainer)
public:
ImageContainer(void *aImplData = nsnull) :
ImageContainer() :
mReentrantMonitor("ImageContainer.mReentrantMonitor"),
mPaintCount(0),
mPreviousImagePainted(false),
mImplData(aImplData)
mPreviousImagePainted(false)
{}
virtual ~ImageContainer() {}
@@ -184,20 +183,6 @@ public:
*/
virtual already_AddRefed<Image> GetCurrentImage() = 0;
/**
* Make sure the current image is ready for rendering by this container.
* May only be called from the main thread.
*/
virtual void Flush() {}
/**
* |Disconnect()| is used by ImageContainer hooked up over IPC. It may
* be called at any time, and may not be called at all. Using an
* IPC-enabled layer after Destroy() (drawing etc.) results in a
* safe no-op; no crashy or uaf etc.
*/
virtual void Disconnect() {}
/**
* Get the current image as a gfxASurface. This is useful for fallback
* rendering.
@@ -215,8 +200,6 @@ public:
*/
virtual already_AddRefed<gfxASurface> GetCurrentAsSurface(gfxIntSize* aSizeResult) = 0;
virtual void* ImplData() { return mImplData; }
/**
* Returns the layer manager for this container. This can only
* be used on the main thread, since layer managers should only be
@@ -308,12 +291,11 @@ protected:
// image", and any other state which is shared between threads.
ReentrantMonitor mReentrantMonitor;
ImageContainer(LayerManager* aManager, void* aImplData = nsnull) :
ImageContainer(LayerManager* aManager) :
mManager(aManager),
mReentrantMonitor("ImageContainer.mReentrantMonitor"),
mPaintCount(0),
mPreviousImagePainted(false),
mImplData(aImplData)
mPreviousImagePainted(false)
{}
// Performs necessary housekeeping to ensure the painted frame statistics
@@ -336,8 +318,6 @@ protected:
// Denotes whether the previous image was painted.
bool mPreviousImagePainted;
void* mImplData;
};
/**

View File

@@ -231,25 +231,16 @@ BasicPlanarYCbCrImage::GetAsSurface()
* for the image objects. We use a ReentrantMonitor to synchronize access to
* mImage.
*/
class BasicImageContainer : public ImageContainer,
public ShadowImplData
{
class BasicImageContainer : public ImageContainer {
public:
typedef gfxASurface::gfxImageFormat gfxImageFormat;
BasicImageContainer() :
ImageContainer(nsnull, static_cast<ShadowImplData*>(this)),
ImageContainer(nsnull),
mScaleHint(-1, -1),
mOffscreenFormat(gfxASurface::ImageFormatUnknown),
mDelayed(false)
{}
BasicImageContainer(LayerManager* aManager) :
ImageContainer(aManager, static_cast<ShadowImplData*>(this)),
mScaleHint(-1, -1),
mOffscreenFormat(gfxASurface::ImageFormatUnknown),
mDelayed(false)
{}
virtual already_AddRefed<Image> CreateImage(const Image::Format* aFormats,
PRUint32 aNumFormats);
virtual void SetDelayedConversion(bool aDelayed) { mDelayed = aDelayed; }
@@ -261,8 +252,6 @@ public:
virtual void SetScaleHint(const gfxIntSize& aScaleHint);
void SetOffscreenFormat(gfxImageFormat aFormat) { mOffscreenFormat = aFormat; }
virtual LayerManager::LayersBackend GetBackendType() { return LayerManager::LAYERS_BASIC; }
virtual ShadowableLayer* AsShadowableLayer() { return NULL; }
protected:
nsRefPtr<Image> mImage;

View File

@@ -97,7 +97,7 @@ class ShadowableLayer;
* | |
* +-> BasicImageLayer <--------------+
*/
class BasicImplData : public ShadowImplData {
class BasicImplData {
public:
BasicImplData() : mHidden(false),
mClipToVisibleRegion(false), mOperator(gfxContext::OPERATOR_OVER)
@@ -197,13 +197,6 @@ ToData(Layer* aLayer)
return static_cast<BasicImplData*>(aLayer->ImplData());
}
template <typename T>
static ShadowImplData*
ToShadowData(T* aLayer)
{
return static_cast<ShadowImplData*>(aLayer->ImplData());
}
template<class Container>
static void ContainerInsertAfter(Layer* aChild, Layer* aAfter, Container* aContainer);
template<class Container>
@@ -2037,56 +2030,58 @@ BasicLayerManager::CreateReadbackLayer()
return layer.forget();
}
BasicShadowableLayer::BasicShadowableLayer()
class BasicShadowableThebesLayer;
class BasicShadowableLayer : public ShadowableLayer
{
MOZ_COUNT_CTOR(BasicShadowableLayer);
}
BasicShadowableLayer::~BasicShadowableLayer()
{
if (HasShadow()) {
PLayerChild::Send__delete__(GetShadow());
public:
BasicShadowableLayer()
{
MOZ_COUNT_CTOR(BasicShadowableLayer);
}
MOZ_COUNT_DTOR(BasicShadowableLayer);
}
void
BasicShadowableLayer::SetShadow(PLayerChild* aShadow)
{
NS_ABORT_IF_FALSE(!mShadow, "can't have two shadows (yet)");
mShadow = aShadow;
}
~BasicShadowableLayer()
{
if (HasShadow()) {
PLayerChild::Send__delete__(GetShadow());
}
MOZ_COUNT_DTOR(BasicShadowableLayer);
}
void
BasicShadowableLayer::SetBackBuffer(const SurfaceDescriptor& aBuffer)
{
NS_RUNTIMEABORT("if this default impl is called, |aBuffer| leaks");
}
void SetShadow(PLayerChild* aShadow)
{
NS_ABORT_IF_FALSE(!mShadow, "can't have two shadows (yet)");
mShadow = aShadow;
}
virtual void SetBackBuffer(const SurfaceDescriptor& aBuffer)
{
NS_RUNTIMEABORT("if this default impl is called, |aBuffer| leaks");
}
void
BasicShadowableLayer::SetBackBufferYUVImage(gfxSharedImageSurface* aYBuffer,
gfxSharedImageSurface* aUBuffer,
gfxSharedImageSurface* aVBuffer)
{
NS_RUNTIMEABORT("if this default impl is called, |aBuffer| leaks");
}
virtual void SetBackBufferYUVImage(gfxSharedImageSurface* aYBuffer,
gfxSharedImageSurface* aUBuffer,
gfxSharedImageSurface* aVBuffer)
{
NS_RUNTIMEABORT("if this default impl is called, |aBuffer| leaks");
}
void
BasicShadowableLayer::Disconnect()
{
// This is an "emergency Disconnect()", called when the compositing
// process has died. |mShadow| and our Shmem buffers are
// automatically managed by IPDL, so we don't need to explicitly
// free them here (it's hard to get that right on emergency
// shutdown anyway).
mShadow = nsnull;
}
virtual void Disconnect()
{
// This is an "emergency Disconnect()", called when the compositing
// process has died. |mShadow| and our Shmem buffers are
// automatically managed by IPDL, so we don't need to explicitly
// free them here (it's hard to get that right on emergency
// shutdown anyway).
mShadow = nsnull;
}
virtual BasicShadowableThebesLayer* AsThebes() { return nsnull; }
};
template <typename T>
static ShadowableLayer*
ToShadowable(T* aLayer)
ToShadowable(Layer* aLayer)
{
return ToShadowData(aLayer)->AsShadowableLayer();
return ToData(aLayer)->AsShadowableLayer();
}
// Some layers, like ReadbackLayers, can't be shadowed and shadowing

View File

@@ -59,7 +59,6 @@ class ShadowImageLayer;
class ShadowCanvasLayer;
class ShadowColorLayer;
class ReadbackProcessor;
class BasicShadowableThebesLayer;
/**
* This is a cairo/Thebes-only, main-thread-only implementation of layers.
@@ -273,31 +272,6 @@ private:
LayerRefArray mKeepAlive;
};
class ShadowImplData
{
public:
virtual ShadowableLayer* AsShadowableLayer() = 0;
};
class BasicShadowableLayer : public ShadowableLayer
{
public:
BasicShadowableLayer();
~BasicShadowableLayer();
void SetShadow(PLayerChild* aShadow);
virtual void SetBackBuffer(const SurfaceDescriptor& aBuffer);
virtual void SetBackBufferYUVImage(gfxSharedImageSurface* aYBuffer,
gfxSharedImageSurface* aUBuffer,
gfxSharedImageSurface* aVBuffer);
virtual void Disconnect();
virtual BasicShadowableThebesLayer* AsThebes() { return nsnull; }
};
}
}