зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1102048 (Part 18) - Make image/src files comply with the Mozilla Coding Style Guide. r=seth
This commit is contained in:
Родитель
5410322d22
Коммит
fd54a9af75
|
@ -38,7 +38,8 @@ public:
|
||||||
* @param aClip The rectangle to clip the image against.
|
* @param aClip The rectangle to clip the image against.
|
||||||
*/
|
*/
|
||||||
static already_AddRefed<Image> Clip(Image* aImage, nsIntRect aClip);
|
static already_AddRefed<Image> Clip(Image* aImage, nsIntRect aClip);
|
||||||
static already_AddRefed<imgIContainer> Clip(imgIContainer* aImage, nsIntRect aClip);
|
static already_AddRefed<imgIContainer> Clip(imgIContainer* aImage,
|
||||||
|
nsIntRect aClip);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a version of an existing image which is rotated and/or flipped to
|
* Creates a version of an existing image which is rotated and/or flipped to
|
||||||
|
@ -47,15 +48,18 @@ public:
|
||||||
* @param aImage The existing image.
|
* @param aImage The existing image.
|
||||||
* @param aOrientation The desired orientation.
|
* @param aOrientation The desired orientation.
|
||||||
*/
|
*/
|
||||||
static already_AddRefed<Image> Orient(Image* aImage, Orientation aOrientation);
|
static already_AddRefed<Image> Orient(Image* aImage,
|
||||||
static already_AddRefed<imgIContainer> Orient(imgIContainer* aImage, Orientation aOrientation);
|
Orientation aOrientation);
|
||||||
|
static already_AddRefed<imgIContainer> Orient(imgIContainer* aImage,
|
||||||
|
Orientation aOrientation);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates an image from a gfxDrawable.
|
* Creates an image from a gfxDrawable.
|
||||||
*
|
*
|
||||||
* @param aDrawable The gfxDrawable.
|
* @param aDrawable The gfxDrawable.
|
||||||
*/
|
*/
|
||||||
static already_AddRefed<imgIContainer> CreateFromDrawable(gfxDrawable* aDrawable);
|
static already_AddRefed<imgIContainer>
|
||||||
|
CreateFromDrawable(gfxDrawable* aDrawable);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// This is a static utility class, so disallow instantiation.
|
// This is a static utility class, so disallow instantiation.
|
||||||
|
|
|
@ -28,7 +28,8 @@ namespace image {
|
||||||
class ImageURL
|
class ImageURL
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit ImageURL(nsIURI* aURI) {
|
explicit ImageURL(nsIURI* aURI)
|
||||||
|
{
|
||||||
MOZ_ASSERT(NS_IsMainThread(), "Cannot use nsIURI off main thread!");
|
MOZ_ASSERT(NS_IsMainThread(), "Cannot use nsIURI off main thread!");
|
||||||
aURI->GetSpec(mSpec);
|
aURI->GetSpec(mSpec);
|
||||||
aURI->GetScheme(mScheme);
|
aURI->GetScheme(mScheme);
|
||||||
|
@ -37,12 +38,14 @@ public:
|
||||||
|
|
||||||
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(ImageURL)
|
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(ImageURL)
|
||||||
|
|
||||||
nsresult GetSpec(nsACString &result) {
|
nsresult GetSpec(nsACString& result)
|
||||||
|
{
|
||||||
result = mSpec;
|
result = mSpec;
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult GetScheme(nsACString &result) {
|
nsresult GetScheme(nsACString& result)
|
||||||
|
{
|
||||||
result = mScheme;
|
result = mScheme;
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
@ -56,12 +59,14 @@ public:
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult GetRef(nsACString &result) {
|
nsresult GetRef(nsACString& result)
|
||||||
|
{
|
||||||
result = mRef;
|
result = mRef;
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
already_AddRefed<nsIURI> ToIURI() {
|
already_AddRefed<nsIURI> ToIURI()
|
||||||
|
{
|
||||||
MOZ_ASSERT(NS_IsMainThread(),
|
MOZ_ASSERT(NS_IsMainThread(),
|
||||||
"Convert to nsIURI on main thread only; it is not threadsafe.");
|
"Convert to nsIURI on main thread only; it is not threadsafe.");
|
||||||
nsCOMPtr<nsIURI> newURI;
|
nsCOMPtr<nsIURI> newURI;
|
||||||
|
|
|
@ -93,7 +93,8 @@ ImageWrapper::OnImageDataComplete(nsIRequest* aRequest,
|
||||||
nsresult aStatus,
|
nsresult aStatus,
|
||||||
bool aLastPart)
|
bool aLastPart)
|
||||||
{
|
{
|
||||||
return mInnerImage->OnImageDataComplete(aRequest, aContext, aStatus, aLastPart);
|
return mInnerImage->OnImageDataComplete(aRequest, aContext, aStatus,
|
||||||
|
aLastPart);
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
|
@ -204,7 +205,8 @@ ImageWrapper::IsOpaque()
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
ImageWrapper::GetImageContainer(LayerManager* aManager, ImageContainer** _retval)
|
ImageWrapper::GetImageContainer(LayerManager* aManager,
|
||||||
|
ImageContainer** _retval)
|
||||||
{
|
{
|
||||||
return mInnerImage->GetImageContainer(aManager, _retval);
|
return mInnerImage->GetImageContainer(aManager, _retval);
|
||||||
}
|
}
|
||||||
|
@ -305,10 +307,12 @@ ImageWrapper::SetAnimationStartTime(const TimeStamp& aTime)
|
||||||
}
|
}
|
||||||
|
|
||||||
nsIntSize
|
nsIntSize
|
||||||
ImageWrapper::OptimalImageSizeForDest(const gfxSize& aDest, uint32_t aWhichFrame,
|
ImageWrapper::OptimalImageSizeForDest(const gfxSize& aDest,
|
||||||
|
uint32_t aWhichFrame,
|
||||||
GraphicsFilter aFilter, uint32_t aFlags)
|
GraphicsFilter aFilter, uint32_t aFlags)
|
||||||
{
|
{
|
||||||
return mInnerImage->OptimalImageSizeForDest(aDest, aWhichFrame, aFilter, aFlags);
|
return mInnerImage->OptimalImageSizeForDest(aDest, aWhichFrame, aFilter,
|
||||||
|
aFlags);
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP_(nsIntRect)
|
NS_IMETHODIMP_(nsIntRect)
|
||||||
|
|
|
@ -27,8 +27,12 @@ public:
|
||||||
virtual already_AddRefed<ProgressTracker> GetProgressTracker() MOZ_OVERRIDE;
|
virtual already_AddRefed<ProgressTracker> GetProgressTracker() MOZ_OVERRIDE;
|
||||||
virtual nsIntRect FrameRect(uint32_t aWhichFrame) MOZ_OVERRIDE;
|
virtual nsIntRect FrameRect(uint32_t aWhichFrame) MOZ_OVERRIDE;
|
||||||
|
|
||||||
virtual size_t SizeOfSourceWithComputedFallback(MallocSizeOf aMallocSizeOf) const MOZ_OVERRIDE;
|
virtual size_t
|
||||||
virtual size_t SizeOfDecoded(gfxMemoryLocation aLocation, MallocSizeOf aMallocSizeOf) const MOZ_OVERRIDE;
|
SizeOfSourceWithComputedFallback( MallocSizeOf aMallocSizeOf) const
|
||||||
|
MOZ_OVERRIDE;
|
||||||
|
virtual size_t
|
||||||
|
SizeOfDecoded(gfxMemoryLocation aLocation,
|
||||||
|
MallocSizeOf aMallocSizeOf) const MOZ_OVERRIDE;
|
||||||
|
|
||||||
virtual void IncrementAnimationConsumers() MOZ_OVERRIDE;
|
virtual void IncrementAnimationConsumers() MOZ_OVERRIDE;
|
||||||
virtual void DecrementAnimationConsumers() MOZ_OVERRIDE;
|
virtual void DecrementAnimationConsumers() MOZ_OVERRIDE;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче