Bug 1037028 - More namespace cleanups in imglib, r=seth

This commit is contained in:
Michael Wu 2014-07-10 11:00:31 -04:00
parent 6d782be30e
commit 8144fa3e46
28 changed files with 119 additions and 104 deletions

View File

@ -13,12 +13,13 @@
#include "Orientation.h"
#include "SVGImageContext.h"
using namespace mozilla;
using namespace mozilla::gfx;
using mozilla::layers::LayerManager;
using mozilla::layers::ImageContainer;
namespace mozilla {
using namespace gfx;
using layers::LayerManager;
using layers::ImageContainer;
namespace image {
class ClippedImageCachedSurface

View File

@ -26,7 +26,7 @@ class DrawSingleTileCallback;
*/
class ClippedImage : public ImageWrapper
{
typedef mozilla::gfx::SourceSurface SourceSurface;
typedef gfx::SourceSurface SourceSurface;
public:
NS_DECL_ISUPPORTS_INHERITED
@ -37,10 +37,10 @@ public:
NS_IMETHOD GetHeight(int32_t* aHeight) MOZ_OVERRIDE;
NS_IMETHOD GetIntrinsicSize(nsSize* aSize) MOZ_OVERRIDE;
NS_IMETHOD GetIntrinsicRatio(nsSize* aRatio) MOZ_OVERRIDE;
NS_IMETHOD_(mozilla::TemporaryRef<SourceSurface>)
NS_IMETHOD_(TemporaryRef<SourceSurface>)
GetFrame(uint32_t aWhichFrame, uint32_t aFlags) MOZ_OVERRIDE;
NS_IMETHOD GetImageContainer(mozilla::layers::LayerManager* aManager,
mozilla::layers::ImageContainer** _retval) MOZ_OVERRIDE;
NS_IMETHOD GetImageContainer(layers::LayerManager* aManager,
layers::ImageContainer** _retval) MOZ_OVERRIDE;
NS_IMETHOD Draw(gfxContext* aContext,
GraphicsFilter aFilter,
const gfxMatrix& aUserSpaceToImageSpace,
@ -60,7 +60,7 @@ protected:
virtual ~ClippedImage();
private:
mozilla::TemporaryRef<SourceSurface>
TemporaryRef<SourceSurface>
GetFrameInternal(const nsIntSize& aViewportSize,
const SVGImageContext* aSVGContext,
uint32_t aWhichFrame,

View File

@ -24,7 +24,7 @@ static const char* sDiscardTimeoutPref = "image.mem.min_discard_timeout_ms";
/* static */ uint32_t DiscardTracker::sMaxDecodedImageKB = 42 * 1024;
/* static */ uint32_t DiscardTracker::sHardLimitDecodedImageKB = 0;
/* static */ PRLock * DiscardTracker::sAllocationLock = nullptr;
/* static */ mozilla::Mutex* DiscardTracker::sNodeListMutex = nullptr;
/* static */ Mutex* DiscardTracker::sNodeListMutex = nullptr;
/* static */ Atomic<bool> DiscardTracker::sShutdown(false);
/*

View File

@ -123,14 +123,14 @@ class DiscardTracker
static nsCOMPtr<nsITimer> sTimer;
static bool sInitialized;
static bool sTimerOn;
static mozilla::Atomic<bool> sDiscardRunnablePending;
static Atomic<bool> sDiscardRunnablePending;
static uint64_t sCurrentDecodedImageBytes;
static uint32_t sMinDiscardTimeoutMs;
static uint32_t sMaxDecodedImageKB;
static uint32_t sHardLimitDecodedImageKB;
// Lock for safegarding the 64-bit sCurrentDecodedImageBytes
static PRLock *sAllocationLock;
static mozilla::Mutex* sNodeListMutex;
static Mutex* sNodeListMutex;
static Atomic<bool> sShutdown;
};

View File

@ -8,8 +8,8 @@
#include "imgIContainer.h"
using namespace mozilla::image;
using namespace mozilla;
namespace mozilla {
namespace image {
FrameAnimator::FrameAnimator(FrameBlender& aFrameBlender,
uint16_t aAnimationMode)
@ -177,7 +177,7 @@ FrameAnimator::AdvanceFrame(TimeStamp aTime)
}
FrameAnimator::RefreshResult
FrameAnimator::RequestRefresh(const mozilla::TimeStamp& aTime)
FrameAnimator::RequestRefresh(const TimeStamp& aTime)
{
// only advance the frame if the current time is greater than or
// equal to the current frame's end time.
@ -263,4 +263,5 @@ FrameAnimator::GetFirstFrameRefreshArea() const
return mFirstFrameRefreshArea;
}
} // namespace image
} // namespace mozilla

View File

@ -61,7 +61,7 @@ public:
* Returns the result of that blending, including whether the current frame
* changed and what the resulting dirty rectangle is.
*/
RefreshResult RequestRefresh(const mozilla::TimeStamp& aTime);
RefreshResult RequestRefresh(const TimeStamp& aTime);
/**
* Call when this image is finished decoding so we know that there aren't any
@ -136,14 +136,14 @@ private: // methods
* @returns a RefreshResult that shows whether the frame was successfully
* advanced, and its resulting dirty rect.
*/
RefreshResult AdvanceFrame(mozilla::TimeStamp aTime);
RefreshResult AdvanceFrame(TimeStamp aTime);
/**
* Get the time the frame we're currently displaying is supposed to end.
*
* In the error case, returns an "infinity" timestamp.
*/
mozilla::TimeStamp GetCurrentImgFrameEndTime() const;
TimeStamp GetCurrentImgFrameEndTime() const;
private: // data
//! Area of the first frame that needs to be redrawn on subsequent loops.

View File

@ -10,9 +10,6 @@
#include "pixman.h"
using namespace mozilla;
using namespace mozilla::image;
namespace mozilla {
namespace image {

View File

@ -12,11 +12,11 @@
#include "FrameSequence.h"
#include "nsCOMPtr.h"
class imgFrame;
namespace mozilla {
namespace image {
class imgFrame;
/**
* FrameBlender stores and gives access to imgFrames. It also knows how to
* blend frames from previous to next, looping if necessary.
@ -78,7 +78,7 @@ public:
void SetSize(nsIntSize aSize) { mSize = aSize; }
size_t SizeOfDecodedWithComputedFallbackIfHeap(gfxMemoryLocation aLocation,
mozilla::MallocSizeOf aMallocSizeOf) const;
MallocSizeOf aMallocSizeOf) const;
void ResetAnimation();

View File

@ -5,9 +5,6 @@
#include "FrameSequence.h"
using namespace mozilla;
using namespace mozilla::image;
namespace mozilla {
namespace image {

View File

@ -174,7 +174,7 @@ public:
uint32_t GetNumFrames() const;
size_t SizeOfDecodedWithComputedFallbackIfHeap(gfxMemoryLocation aLocation,
mozilla::MallocSizeOf aMallocSizeOf) const;
MallocSizeOf aMallocSizeOf) const;
private: // data
//! All the frames of the image

View File

@ -5,9 +5,10 @@
#include "FrozenImage.h"
using namespace mozilla::gfx;
namespace mozilla {
using namespace gfx;
namespace image {
NS_IMPL_ISUPPORTS_INHERITED0(FrozenImage, ImageWrapper)
@ -86,7 +87,7 @@ FrozenImage::Draw(gfxContext* aContext,
}
NS_IMETHODIMP_(void)
FrozenImage::RequestRefresh(const mozilla::TimeStamp& aTime)
FrozenImage::RequestRefresh(const TimeStamp& aTime)
{
// Do nothing.
}

View File

@ -26,7 +26,7 @@ namespace image {
*/
class FrozenImage : public ImageWrapper
{
typedef mozilla::gfx::SourceSurface SourceSurface;
typedef gfx::SourceSurface SourceSurface;
public:
NS_DECL_ISUPPORTS_INHERITED
@ -50,7 +50,7 @@ public:
const SVGImageContext* aSVGContext,
uint32_t aWhichFrame,
uint32_t aFlags) MOZ_OVERRIDE;
NS_IMETHOD_(void) RequestRefresh(const mozilla::TimeStamp& aTime) MOZ_OVERRIDE;
NS_IMETHOD_(void) RequestRefresh(const TimeStamp& aTime) MOZ_OVERRIDE;
NS_IMETHOD GetAnimationMode(uint16_t* aAnimationMode) MOZ_OVERRIDE;
NS_IMETHOD SetAnimationMode(uint16_t aAnimationMode) MOZ_OVERRIDE;
NS_IMETHOD ResetAnimation() MOZ_OVERRIDE;

View File

@ -80,8 +80,8 @@ public:
/**
* The components that make up SizeOfData().
*/
virtual size_t HeapSizeOfSourceWithComputedFallback(mozilla::MallocSizeOf aMallocSizeOf) const = 0;
virtual size_t HeapSizeOfDecodedWithComputedFallback(mozilla::MallocSizeOf aMallocSizeOf) const = 0;
virtual size_t HeapSizeOfSourceWithComputedFallback(MallocSizeOf aMallocSizeOf) const = 0;
virtual size_t HeapSizeOfDecodedWithComputedFallback(MallocSizeOf aMallocSizeOf) const = 0;
virtual size_t NonHeapSizeOfDecoded() const = 0;
virtual size_t OutOfProcessSizeOfDecoded() const = 0;
@ -195,7 +195,7 @@ protected:
*
* Otherwise, this method updates mLastRefreshTime to aTime & returns false.
*/
bool HadRecentRefresh(const mozilla::TimeStamp& aTime);
bool HadRecentRefresh(const TimeStamp& aTime);
/**
* Decides whether animation should or should not be happening,

View File

@ -236,7 +236,7 @@ ImageFactory::CreateRasterImage(nsIRequest* aRequest,
nsAutoCString ref;
aURI->GetRef(ref);
mozilla::net::nsMediaFragmentURIParser parser(ref);
net::nsMediaFragmentURIParser parser(ref);
if (parser.HasResolution()) {
newImage->SetRequestedResolution(parser.GetResolution());
}

View File

@ -11,7 +11,8 @@
#include "nsISupportsPrimitives.h"
#include "nsXPCOMCID.h"
using namespace mozilla::image;
namespace mozilla {
namespace image {
void
ImageMetadata::SetOnImage(RasterImage* image)
@ -31,3 +32,6 @@ ImageMetadata::SetOnImage(RasterImage* image)
image->SetFrameAsNonPremult(i, mIsNonPremultiplied);
}
}
} // namespace image
} // namespace mozilla

View File

@ -10,12 +10,13 @@
#include "mozilla/MemoryReporting.h"
using mozilla::gfx::DataSourceSurface;
using mozilla::gfx::SourceSurface;
using mozilla::layers::LayerManager;
using mozilla::layers::ImageContainer;
namespace mozilla {
using gfx::DataSourceSurface;
using gfx::SourceSurface;
using layers::LayerManager;
using layers::ImageContainer;
namespace image {
// Inherited methods from Image.
@ -45,13 +46,13 @@ ImageWrapper::SizeOfData()
}
size_t
ImageWrapper::HeapSizeOfSourceWithComputedFallback(mozilla::MallocSizeOf aMallocSizeOf) const
ImageWrapper::HeapSizeOfSourceWithComputedFallback(MallocSizeOf aMallocSizeOf) const
{
return mInnerImage->HeapSizeOfSourceWithComputedFallback(aMallocSizeOf);
}
size_t
ImageWrapper::HeapSizeOfDecodedWithComputedFallback(mozilla::MallocSizeOf aMallocSizeOf) const
ImageWrapper::HeapSizeOfDecodedWithComputedFallback(MallocSizeOf aMallocSizeOf) const
{
return mInnerImage->HeapSizeOfDecodedWithComputedFallback(aMallocSizeOf);
}
@ -276,7 +277,7 @@ ImageWrapper::RequestDiscard()
}
NS_IMETHODIMP_(void)
ImageWrapper::RequestRefresh(const mozilla::TimeStamp& aTime)
ImageWrapper::RequestRefresh(const TimeStamp& aTime)
{
return mInnerImage->RequestRefresh(aTime);
}
@ -312,7 +313,7 @@ ImageWrapper::GetFirstFrameDelay()
}
NS_IMETHODIMP_(void)
ImageWrapper::SetAnimationStartTime(const mozilla::TimeStamp& aTime)
ImageWrapper::SetAnimationStartTime(const TimeStamp& aTime)
{
mInnerImage->SetAnimationStartTime(aTime);
}

View File

@ -28,8 +28,8 @@ public:
virtual nsIntRect FrameRect(uint32_t aWhichFrame) MOZ_OVERRIDE;
virtual uint32_t SizeOfData() MOZ_OVERRIDE;
virtual size_t HeapSizeOfSourceWithComputedFallback(mozilla::MallocSizeOf aMallocSizeOf) const MOZ_OVERRIDE;
virtual size_t HeapSizeOfDecodedWithComputedFallback(mozilla::MallocSizeOf aMallocSizeOf) const MOZ_OVERRIDE;
virtual size_t HeapSizeOfSourceWithComputedFallback(MallocSizeOf aMallocSizeOf) const MOZ_OVERRIDE;
virtual size_t HeapSizeOfDecodedWithComputedFallback(MallocSizeOf aMallocSizeOf) const MOZ_OVERRIDE;
virtual size_t NonHeapSizeOfDecoded() const MOZ_OVERRIDE;
virtual size_t OutOfProcessSizeOfDecoded() const MOZ_OVERRIDE;

View File

@ -11,13 +11,14 @@
#include "OrientedImage.h"
using namespace mozilla::gfx;
using std::swap;
using mozilla::layers::LayerManager;
using mozilla::layers::ImageContainer;
namespace mozilla {
using namespace gfx;
using layers::LayerManager;
using layers::ImageContainer;
namespace image {
NS_IMPL_ISUPPORTS_INHERITED0(OrientedImage, ImageWrapper)
@ -107,7 +108,7 @@ OrientedImage::GetFrame(uint32_t aWhichFrame,
}
// Create a surface to draw into.
mozilla::RefPtr<DrawTarget> target =
RefPtr<DrawTarget> target =
gfxPlatform::GetPlatform()->
CreateOffscreenContentDrawTarget(IntSize(width, height), surfaceFormat);
if (!target) {

View File

@ -23,7 +23,7 @@ namespace image {
*/
class OrientedImage : public ImageWrapper
{
typedef mozilla::gfx::SourceSurface SourceSurface;
typedef gfx::SourceSurface SourceSurface;
public:
NS_DECL_ISUPPORTS_INHERITED
@ -34,10 +34,10 @@ public:
NS_IMETHOD GetHeight(int32_t* aHeight) MOZ_OVERRIDE;
NS_IMETHOD GetIntrinsicSize(nsSize* aSize) MOZ_OVERRIDE;
NS_IMETHOD GetIntrinsicRatio(nsSize* aRatio) MOZ_OVERRIDE;
NS_IMETHOD_(mozilla::TemporaryRef<SourceSurface>)
NS_IMETHOD_(TemporaryRef<SourceSurface>)
GetFrame(uint32_t aWhichFrame, uint32_t aFlags) MOZ_OVERRIDE;
NS_IMETHOD GetImageContainer(mozilla::layers::LayerManager* aManager,
mozilla::layers::ImageContainer** _retval) MOZ_OVERRIDE;
NS_IMETHOD GetImageContainer(layers::LayerManager* aManager,
layers::ImageContainer** _retval) MOZ_OVERRIDE;
NS_IMETHOD Draw(gfxContext* aContext,
GraphicsFilter aFilter,
const gfxMatrix& aUserSpaceToImageSpace,

View File

@ -53,10 +53,12 @@
#include "ipc/Nuwa.h"
#endif
using namespace mozilla;
using namespace mozilla::gfx;
using namespace mozilla::image;
using namespace mozilla::layers;
namespace mozilla {
using namespace gfx;
using namespace layers;
namespace image {
// a mask for flags that will affect the decoding
#define DECODE_FLAGS_MASK (imgIContainer::FLAG_DECODE_NO_PREMULTIPLY_ALPHA | imgIContainer::FLAG_DECODE_NO_COLORSPACE_CONVERSION)
@ -371,9 +373,6 @@ private:
nsAutoPtr<ScaleRequest> mScaleRequest;
};
namespace mozilla {
namespace image {
/* static */ StaticRefPtr<RasterImage::DecodePool> RasterImage::DecodePool::sSingleton;
static nsCOMPtr<nsIThread> sScaleWorkerThread = nullptr;

View File

@ -121,8 +121,6 @@ class nsIRequest;
* it's not allocated until the second frame is added.
*/
class ScaleRequest;
namespace mozilla {
namespace layers {
@ -133,6 +131,7 @@ class Image;
namespace image {
class ScaleRequest;
class Decoder;
class FrameAnimator;

View File

@ -8,7 +8,8 @@
#include "imgIScriptedNotificationObserver.h"
#include "nsCycleCollectionParticipant.h"
using namespace mozilla::image;
namespace mozilla {
namespace image {
NS_IMPL_CYCLE_COLLECTION(ScriptedNotificationObserver, mInner)
@ -47,3 +48,6 @@ ScriptedNotificationObserver::Notify(imgIRequest* aRequest,
return mInner->IsAnimated(aRequest);
return NS_OK;
}
} // namespace image
} // namespace mozilla

View File

@ -31,9 +31,11 @@
using std::max;
using std::min;
using namespace mozilla::gfx;
namespace mozilla {
using namespace gfx;
namespace image {
class CachedSurface;
@ -218,7 +220,7 @@ public:
, mMaxCost(aSurfaceCacheSize)
, mAvailableCost(aSurfaceCacheSize)
{
nsCOMPtr<nsIObserverService> os = mozilla::services::GetObserverService();
nsCOMPtr<nsIObserverService> os = services::GetObserverService();
if (os)
os->AddObserver(mMemoryPressureObserver, "memory-pressure", false);
}
@ -226,7 +228,7 @@ public:
private:
virtual ~SurfaceCacheImpl()
{
nsCOMPtr<nsIObserverService> os = mozilla::services::GetObserverService();
nsCOMPtr<nsIObserverService> os = services::GetObserverService();
if (os)
os->RemoveObserver(mMemoryPressureObserver, "memory-pressure");

View File

@ -135,7 +135,7 @@ struct SurfaceCache
* @param aImageKey Key data identifying which image the surface belongs to.
* @param aSurfaceKey Key data which uniquely identifies the requested surface.
*/
static void Insert(mozilla::gfx::DrawTarget* aTarget,
static void Insert(gfx::DrawTarget* aTarget,
const ImageKey aImageKey,
const SurfaceKey& aSurfaceKey);

View File

@ -364,7 +364,7 @@ VectorImage::FrameRect(uint32_t aWhichFrame)
}
size_t
VectorImage::HeapSizeOfSourceWithComputedFallback(mozilla::MallocSizeOf aMallocSizeOf) const
VectorImage::HeapSizeOfSourceWithComputedFallback(MallocSizeOf aMallocSizeOf) const
{
// We're not storing the source data -- we just feed that directly to
// our helper SVG document as we receive it, for it to parse.
@ -376,7 +376,7 @@ VectorImage::HeapSizeOfSourceWithComputedFallback(mozilla::MallocSizeOf aMallocS
}
size_t
VectorImage::HeapSizeOfDecodedWithComputedFallback(mozilla::MallocSizeOf aMallocSizeOf) const
VectorImage::HeapSizeOfDecodedWithComputedFallback(MallocSizeOf aMallocSizeOf) const
{
// If implementing this, we'll need to restructure our callers to make sure
// any amount we return is attributed to the vector images measure (i.e.
@ -503,7 +503,7 @@ VectorImage::ShouldAnimate()
}
NS_IMETHODIMP_(void)
VectorImage::SetAnimationStartTime(const mozilla::TimeStamp& aTime)
VectorImage::SetAnimationStartTime(const TimeStamp& aTime)
{
// We don't care about animation start time.
}
@ -533,7 +533,7 @@ VectorImage::GetWidth(int32_t* aWidth)
//******************************************************************************
/* [notxpcom] void requestRefresh ([const] in TimeStamp aTime); */
NS_IMETHODIMP_(void)
VectorImage::RequestRefresh(const mozilla::TimeStamp& aTime)
VectorImage::RequestRefresh(const TimeStamp& aTime)
{
if (HadRecentRefresh(aTime)) {
return;
@ -755,7 +755,7 @@ VectorImage::GetFrame(uint32_t aWhichFrame,
/* [noscript] ImageContainer getImageContainer(); */
NS_IMETHODIMP
VectorImage::GetImageContainer(LayerManager* aManager,
mozilla::layers::ImageContainer** _retval)
layers::ImageContainer** _retval)
{
*_retval = nullptr;
return NS_OK;
@ -915,7 +915,7 @@ VectorImage::CreateDrawableAndShow(const SVGDrawingParameters& aParams)
return Show(svgDrawable, aParams);
// Try to create an offscreen surface.
mozilla::RefPtr<mozilla::gfx::DrawTarget> target =
RefPtr<gfx::DrawTarget> target =
gfxPlatform::GetPlatform()->CreateOffscreenContentDrawTarget(aParams.imageRect.Size(), gfx::SurfaceFormat::B8G8R8A8);
// If we couldn't create the draw target, it was probably because it would end

View File

@ -42,8 +42,8 @@ public:
uint32_t aFlags);
virtual nsIntRect FrameRect(uint32_t aWhichFrame) MOZ_OVERRIDE;
virtual size_t HeapSizeOfSourceWithComputedFallback(mozilla::MallocSizeOf aMallocSizeOf) const;
virtual size_t HeapSizeOfDecodedWithComputedFallback(mozilla::MallocSizeOf aMallocSizeOf) const;
virtual size_t HeapSizeOfSourceWithComputedFallback(MallocSizeOf aMallocSizeOf) const;
virtual size_t HeapSizeOfDecodedWithComputedFallback(MallocSizeOf aMallocSizeOf) const;
virtual size_t NonHeapSizeOfDecoded() const;
virtual size_t OutOfProcessSizeOfDecoded() const;

View File

@ -23,9 +23,12 @@ static bool gDisableOptimize = false;
#include "mozilla/CheckedInt.h"
#include "mozilla/gfx/Tools.h"
using namespace mozilla;
using namespace mozilla::gfx;
using namespace mozilla::image;
namespace mozilla {
using namespace gfx;
namespace image {
static UserDataKey kVolatileBuffer;
@ -750,7 +753,7 @@ void imgFrame::SetCompositingFailed(bool val)
// |aMallocSizeOf|. If that fails (because the platform doesn't support it) or
// it's non-heap memory, we fall back to computing the size analytically.
size_t
imgFrame::SizeOfExcludingThisWithComputedFallbackIfHeap(gfxMemoryLocation aLocation, mozilla::MallocSizeOf aMallocSizeOf) const
imgFrame::SizeOfExcludingThisWithComputedFallbackIfHeap(gfxMemoryLocation aLocation, MallocSizeOf aMallocSizeOf) const
{
// aMallocSizeOf is only used if aLocation==gfxMemoryLocation::IN_PROCESS_HEAP. It
// should be nullptr otherwise.
@ -787,3 +790,6 @@ imgFrame::SizeOfExcludingThisWithComputedFallbackIfHeap(gfxMemoryLocation aLocat
return n;
}
} // namespace image
} // namespace mozilla

View File

@ -13,13 +13,16 @@
#include "gfxDrawable.h"
#include "imgIContainer.h"
namespace mozilla {
namespace image {
class imgFrame
{
typedef mozilla::gfx::Color Color;
typedef mozilla::gfx::DataSourceSurface DataSourceSurface;
typedef mozilla::gfx::IntSize IntSize;
typedef mozilla::gfx::SourceSurface SourceSurface;
typedef mozilla::gfx::SurfaceFormat SurfaceFormat;
typedef gfx::Color Color;
typedef gfx::DataSourceSurface DataSourceSurface;
typedef gfx::IntSize IntSize;
typedef gfx::SourceSurface SourceSurface;
typedef gfx::SurfaceFormat SurfaceFormat;
public:
imgFrame();
@ -67,7 +70,7 @@ public:
void SetDiscardable();
mozilla::TemporaryRef<SourceSurface> GetSurface();
TemporaryRef<SourceSurface> GetSurface();
Color
SinglePixelColor()
@ -80,11 +83,11 @@ public:
return mSinglePixel;
}
mozilla::TemporaryRef<SourceSurface> CachedSurface();
TemporaryRef<SourceSurface> CachedSurface();
size_t SizeOfExcludingThisWithComputedFallbackIfHeap(
gfxMemoryLocation aLocation,
mozilla::MallocSizeOf aMallocSizeOf) const;
MallocSizeOf aMallocSizeOf) const;
uint8_t GetPaletteDepth() const { return mPaletteDepth; }
uint32_t PaletteDataLength() const {
@ -117,15 +120,15 @@ private: // methods
SourceSurface* aSurface);
private: // data
mozilla::RefPtr<DataSourceSurface> mImageSurface;
mozilla::RefPtr<SourceSurface> mOptSurface;
RefPtr<DataSourceSurface> mImageSurface;
RefPtr<SourceSurface> mOptSurface;
IntSize mSize;
nsIntPoint mOffset;
nsIntRect mDecoded;
mutable mozilla::Mutex mDecodedMutex;
mutable Mutex mDecodedMutex;
// The palette and image data for images that are paletted, since Cairo
// doesn't support these images.
@ -142,8 +145,8 @@ private: // data
/** Indicates how many readers currently have locked this frame */
int32_t mLockCount;
mozilla::RefPtr<mozilla::VolatileBuffer> mVBuf;
mozilla::VolatileBufferPtr<uint8_t> mVBufPtr;
RefPtr<VolatileBuffer> mVBuf;
VolatileBufferPtr<uint8_t> mVBufPtr;
SurfaceFormat mFormat;
uint8_t mPaletteDepth;
@ -157,8 +160,6 @@ private: // data
bool mInformedDiscardTracker;
};
namespace mozilla {
namespace image {
// An RAII class to ensure it's easy to balance locks and unlocks on
// imgFrames.
class AutoFrameLocker
@ -183,7 +184,8 @@ namespace image {
imgFrame* mFrame;
bool mSucceeded;
};
}
}
} // namespace image
} // namespace mozilla
#endif /* imgFrame_h */