mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 07:42:04 +00:00
Bug 1128769 (Part 6) - Remove imgIContainer::IsDecoded and all remaining callers. r=tn
This commit is contained in:
parent
a1186f0369
commit
c582df8664
@ -116,7 +116,7 @@ native nsIntSizeByVal(nsIntSize);
|
||||
*
|
||||
* Internally, imgIContainer also manages animation of images.
|
||||
*/
|
||||
[scriptable, builtinclass, uuid(4e7d0b17-cb57-4d68-860f-59b303a86dbd)]
|
||||
[scriptable, builtinclass, uuid(9a43298b-bf49-44fc-9abe-9ff702f1bd25)]
|
||||
interface imgIContainer : nsISupports
|
||||
{
|
||||
/**
|
||||
@ -425,14 +425,6 @@ interface imgIContainer : nsISupports
|
||||
[noscript] void requestDecodeForSize([const] in nsIntSize aSize,
|
||||
in uint32_t aFlags);
|
||||
|
||||
/*
|
||||
* Returns true if no more decoding can be performed on this image. Images
|
||||
* with errors return true since they cannot be decoded any further. Note that
|
||||
* because decoded images may be discarded, isDecoded() may return false even
|
||||
* if it has returned true in the past.
|
||||
*/
|
||||
[noscript, notxpcom, nostdcall] bool isDecoded();
|
||||
|
||||
/**
|
||||
* Increments the lock count on the image. An image will not be discarded
|
||||
* as long as the lock count is nonzero. Note that it is still possible for
|
||||
|
@ -260,12 +260,6 @@ DynamicImage::RequestDecodeForSize(const nsIntSize& aSize, uint32_t aFlags)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
bool
|
||||
DynamicImage::IsDecoded()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
DynamicImage::LockImage()
|
||||
{
|
||||
|
@ -230,12 +230,6 @@ ImageWrapper::RequestDecodeForSize(const nsIntSize& aSize, uint32_t aFlags)
|
||||
return mInnerImage->RequestDecodeForSize(aSize, aFlags);
|
||||
}
|
||||
|
||||
bool
|
||||
ImageWrapper::IsDecoded()
|
||||
{
|
||||
return mInnerImage->IsDecoded();
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
ImageWrapper::LockImage()
|
||||
{
|
||||
|
@ -1469,13 +1469,6 @@ RasterImage::RequestDecodeForSize(const nsIntSize& aSize, uint32_t aFlags)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
bool
|
||||
RasterImage::IsDecoded()
|
||||
{
|
||||
// XXX(seth): We need to get rid of this; it's not reliable.
|
||||
return mHasBeenDecoded || mError || (mDecodeOnDraw && mHasSourceData);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
RasterImage::Decode(const Maybe<nsIntSize>& aSize, uint32_t aFlags)
|
||||
{
|
||||
|
@ -928,12 +928,6 @@ VectorImage::RequestDecodeForSize(const nsIntSize& aSize, uint32_t aFlags)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
bool
|
||||
VectorImage::IsDecoded()
|
||||
{
|
||||
return mIsFullyLoaded || mError;
|
||||
}
|
||||
|
||||
//******************************************************************************
|
||||
/* void lockImage() */
|
||||
NS_IMETHODIMP
|
||||
|
@ -3348,34 +3348,6 @@ nsCSSRendering::GetBackgroundLayerRect(nsPresContext* aPresContext,
|
||||
return state.mFillArea;
|
||||
}
|
||||
|
||||
/* static */ bool
|
||||
nsCSSRendering::IsBackgroundImageDecodedForStyleContextAndLayer(
|
||||
const nsStyleBackground *aBackground, uint32_t aLayer)
|
||||
{
|
||||
const nsStyleImage* image = &aBackground->mLayers[aLayer].mImage;
|
||||
if (image->GetType() == eStyleImageType_Image) {
|
||||
nsCOMPtr<imgIContainer> img;
|
||||
if (NS_SUCCEEDED(image->GetImageData()->GetImage(getter_AddRefs(img)))) {
|
||||
if (!img->IsDecoded()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/* static */ bool
|
||||
nsCSSRendering::AreAllBackgroundImagesDecodedForFrame(nsIFrame* aFrame)
|
||||
{
|
||||
const nsStyleBackground *bg = aFrame->StyleContext()->StyleBackground();
|
||||
NS_FOR_VISIBLE_BACKGROUND_LAYERS_BACK_TO_FRONT(i, bg) {
|
||||
if (!IsBackgroundImageDecodedForStyleContextAndLayer(bg, i)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
static void
|
||||
DrawBorderImage(nsPresContext* aPresContext,
|
||||
nsRenderingContext& aRenderingContext,
|
||||
|
@ -598,18 +598,6 @@ struct nsCSSRendering {
|
||||
const nsStyleBackground::Layer& aLayer,
|
||||
uint32_t aFlags);
|
||||
|
||||
/**
|
||||
* Checks if image in layer aLayer of aBackground is currently decoded.
|
||||
*/
|
||||
static bool IsBackgroundImageDecodedForStyleContextAndLayer(
|
||||
const nsStyleBackground *aBackground, uint32_t aLayer);
|
||||
|
||||
/**
|
||||
* Checks if all images that are part of the background for aFrame are
|
||||
* currently decoded.
|
||||
*/
|
||||
static bool AreAllBackgroundImagesDecodedForFrame(nsIFrame* aFrame);
|
||||
|
||||
/**
|
||||
* Called when we start creating a display list. The frame tree will not
|
||||
* change until a matching EndFrameTreeLocked is called.
|
||||
|
@ -1991,20 +1991,6 @@ nsDisplayItem::nsDisplayItem(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame)
|
||||
aBuilder->GetCurrentFrameOffsetToReferenceFrame();
|
||||
}
|
||||
|
||||
void
|
||||
nsDisplayItem::AddInvalidRegionForSyncDecodeBackgroundImages(
|
||||
nsDisplayListBuilder* aBuilder,
|
||||
const nsDisplayItemGeometry* aGeometry,
|
||||
nsRegion* aInvalidRegion)
|
||||
{
|
||||
if (aBuilder->ShouldSyncDecodeImages()) {
|
||||
if (!nsCSSRendering::AreAllBackgroundImagesDecodedForFrame(mFrame)) {
|
||||
bool snap;
|
||||
aInvalidRegion->Or(*aInvalidRegion, GetBounds(aBuilder, &snap));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* static */ bool
|
||||
nsDisplayItem::ForceActiveLayers()
|
||||
{
|
||||
|
@ -1166,16 +1166,6 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* For display items types that just draw a background we use this function
|
||||
* to do any invalidation that might be needed if we are asked to sync decode
|
||||
* images.
|
||||
*/
|
||||
void AddInvalidRegionForSyncDecodeBackgroundImages(
|
||||
nsDisplayListBuilder* aBuilder,
|
||||
const nsDisplayItemGeometry* aGeometry,
|
||||
nsRegion* aInvalidRegion);
|
||||
|
||||
/**
|
||||
* Called when the area rendered by this display item has changed (been
|
||||
* invalidated or changed geometry) since the last paint. This includes
|
||||
|
Loading…
Reference in New Issue
Block a user