Bug 695845 - Part 1: Add ImplData to ImageContainer. r=roc

This commit is contained in:
Matt Woodrow
2011-12-19 14:49:45 -05:00
parent 92eb6c0e9e
commit d560b9919e

View File

@@ -136,10 +136,11 @@ class THEBES_API ImageContainer {
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(ImageContainer) NS_INLINE_DECL_THREADSAFE_REFCOUNTING(ImageContainer)
public: public:
ImageContainer() : ImageContainer(void *aImplData = nsnull) :
mReentrantMonitor("ImageContainer.mReentrantMonitor"), mReentrantMonitor("ImageContainer.mReentrantMonitor"),
mPaintCount(0), mPaintCount(0),
mPreviousImagePainted(false) mPreviousImagePainted(false),
mImplData(aImplData)
{} {}
virtual ~ImageContainer() {} virtual ~ImageContainer() {}
@@ -200,6 +201,8 @@ public:
*/ */
virtual already_AddRefed<gfxASurface> GetCurrentAsSurface(gfxIntSize* aSizeResult) = 0; virtual already_AddRefed<gfxASurface> GetCurrentAsSurface(gfxIntSize* aSizeResult) = 0;
virtual void* ImplData() { return mImplData; }
/** /**
* Returns the layer manager for this container. This can only * Returns the layer manager for this container. This can only
* be used on the main thread, since layer managers should only be * be used on the main thread, since layer managers should only be
@@ -291,11 +294,12 @@ protected:
// image", and any other state which is shared between threads. // image", and any other state which is shared between threads.
ReentrantMonitor mReentrantMonitor; ReentrantMonitor mReentrantMonitor;
ImageContainer(LayerManager* aManager) : ImageContainer(LayerManager* aManager, void* aImplData = nsnull) :
mManager(aManager), mManager(aManager),
mReentrantMonitor("ImageContainer.mReentrantMonitor"), mReentrantMonitor("ImageContainer.mReentrantMonitor"),
mPaintCount(0), mPaintCount(0),
mPreviousImagePainted(false) mPreviousImagePainted(false),
mImplData(aImplData)
{} {}
// Performs necessary housekeeping to ensure the painted frame statistics // Performs necessary housekeeping to ensure the painted frame statistics
@@ -318,6 +322,8 @@ protected:
// Denotes whether the previous image was painted. // Denotes whether the previous image was painted.
bool mPreviousImagePainted; bool mPreviousImagePainted;
void* mImplData;
}; };
/** /**