зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1207355
(Part 8) - Remove imgIContainer::RequestDecode() and imgIRequest::RequestDecode(). r=tn
This commit is contained in:
Родитель
698cb76c02
Коммит
0fa74a123c
|
@ -246,12 +246,6 @@ DynamicImage::Draw(gfxContext* aContext,
|
|||
return DrawResult::SUCCESS;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
DynamicImage::RequestDecode()
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
DynamicImage::StartDecoding()
|
||||
{
|
||||
|
|
|
@ -214,12 +214,6 @@ ImageWrapper::Draw(gfxContext* aContext,
|
|||
aFilter, aSVGContext, aFlags);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
ImageWrapper::RequestDecode()
|
||||
{
|
||||
return mInnerImage->RequestDecode();
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
ImageWrapper::StartDecoding()
|
||||
{
|
||||
|
|
|
@ -1166,15 +1166,6 @@ RasterImage::CanDiscard() {
|
|||
!mAnim; // Can never discard animated images
|
||||
}
|
||||
|
||||
//******************************************************************************
|
||||
|
||||
NS_IMETHODIMP
|
||||
RasterImage::RequestDecode()
|
||||
{
|
||||
return RequestDecodeForSize(mSize, DECODE_FLAGS_DEFAULT);
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
RasterImage::StartDecoding()
|
||||
{
|
||||
|
@ -1799,7 +1790,7 @@ RasterImage::FinalizeDecoder(Decoder* aDecoder)
|
|||
// If we were a metadata decode and a full decode was requested, do it.
|
||||
if (done && wasMetadata && mWantFullDecode) {
|
||||
mWantFullDecode = false;
|
||||
RequestDecode();
|
||||
RequestDecodeForSize(mSize, DECODE_FLAGS_DEFAULT);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -964,15 +964,6 @@ VectorImage::RecoverFromLossOfSurfaces()
|
|||
SurfaceCache::RemoveImage(ImageKey(this));
|
||||
}
|
||||
|
||||
//******************************************************************************
|
||||
|
||||
NS_IMETHODIMP
|
||||
VectorImage::RequestDecode()
|
||||
{
|
||||
// Nothing to do for SVG images
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
VectorImage::StartDecoding()
|
||||
{
|
||||
|
|
|
@ -75,7 +75,7 @@ native nsIntSizeByVal(nsIntSize);
|
|||
*
|
||||
* Internally, imgIContainer also manages animation of images.
|
||||
*/
|
||||
[scriptable, builtinclass, uuid(7c795421-a79c-43ac-9e20-6d4e8a9dfb76)]
|
||||
[scriptable, builtinclass, uuid(a8dbee24-ff86-4755-b40e-51175caf31af)]
|
||||
interface imgIContainer : nsISupports
|
||||
{
|
||||
/**
|
||||
|
@ -383,22 +383,16 @@ interface imgIContainer : nsISupports
|
|||
|
||||
/*
|
||||
* Ensures that an image is decoding. Calling this function guarantees that
|
||||
* the image will at some point fire off decode notifications. Calling draw()
|
||||
* or getFrame() triggers the same mechanism internally. Thus, if you want to
|
||||
* be sure that the image will be decoded but don't want to access it until
|
||||
* then, you must call requestDecode().
|
||||
*/
|
||||
void requestDecode();
|
||||
|
||||
/*
|
||||
* This is equivalent to requestDecode() but it also synchronously decodes
|
||||
* images that can be decoded "quickly" according to some heuristic.
|
||||
* the image will at some point fire off decode notifications. Images that
|
||||
* can be decoded "quickly" according to some heuristic will be decoded
|
||||
* synchronously.
|
||||
*/
|
||||
[noscript] void startDecoding();
|
||||
|
||||
/*
|
||||
* This method is equivalent to requestDecode(), but enables the caller to
|
||||
* provide more detailed information about the decode request.
|
||||
* This method triggers decoding for an image, but unlike startDecoding() it
|
||||
* enables the caller to provide more detailed information about the decode
|
||||
* request.
|
||||
*
|
||||
* @param aSize The size to which the image should be scaled while decoding,
|
||||
* if possible. If the image cannot be scaled to this size while
|
||||
|
|
|
@ -19,7 +19,7 @@ interface nsIPrincipal;
|
|||
* @version 0.1
|
||||
* @see imagelib2
|
||||
*/
|
||||
[scriptable, builtinclass, uuid(4cb01f0a-ef94-4345-a8d7-1a93f15ff548)]
|
||||
[scriptable, builtinclass, uuid(db0a945c-3883-424a-98d0-2ee0523b0255)]
|
||||
interface imgIRequest : nsIRequest
|
||||
{
|
||||
/**
|
||||
|
@ -145,15 +145,14 @@ interface imgIRequest : nsIRequest
|
|||
void cancelAndForgetObserver(in nsresult aStatus);
|
||||
|
||||
/**
|
||||
* Requests a decode for the image.
|
||||
* Requests a synchronous decode for the image.
|
||||
*
|
||||
* imgIContainer has a requestDecode() method, but callers may want to request
|
||||
* imgIContainer has a startDecoding() method, but callers may want to request
|
||||
* a decode before the container has necessarily been instantiated. Calling
|
||||
* requestDecode() on the imgIRequest simply forwards along the request if the
|
||||
* container already exists, or calls it once it gets OnStartContainer if the
|
||||
* container does not yet exist.
|
||||
* startDecoding() on the imgIRequest simply forwards along the request if the
|
||||
* container already exists, or calls it once the container becomes available
|
||||
* if it does not yet exist.
|
||||
*/
|
||||
void requestDecode();
|
||||
void startDecoding();
|
||||
|
||||
/**
|
||||
|
|
|
@ -1590,7 +1590,7 @@ imgLoader::ValidateRequestWithNewChannel(imgRequest* request,
|
|||
// We will send notifications from imgCacheValidator::OnStartRequest().
|
||||
// In the mean time, we must defer notifications because we are added to
|
||||
// the imgRequest's proxy list, and we can get extra notifications
|
||||
// resulting from methods such as RequestDecode(). See bug 579122.
|
||||
// resulting from methods such as StartDecoding(). See bug 579122.
|
||||
proxy->SetNotificationsDeferred(true);
|
||||
|
||||
// Attach the proxy without notifying
|
||||
|
@ -1666,7 +1666,7 @@ imgLoader::ValidateRequestWithNewChannel(imgRequest* request,
|
|||
// We will send notifications from imgCacheValidator::OnStartRequest().
|
||||
// In the mean time, we must defer notifications because we are added to
|
||||
// the imgRequest's proxy list, and we can get extra notifications
|
||||
// resulting from methods such as RequestDecode(). See bug 579122.
|
||||
// resulting from methods such as StartDecoding(). See bug 579122.
|
||||
req->SetNotificationsDeferred(true);
|
||||
|
||||
// Add the proxy without notifying
|
||||
|
|
|
@ -413,7 +413,7 @@ imgRequest::ContinueEvict()
|
|||
}
|
||||
|
||||
void
|
||||
imgRequest::RequestDecode()
|
||||
imgRequest::StartDecoding()
|
||||
{
|
||||
MutexAutoLock lock(mMutex);
|
||||
mDecodeRequested = true;
|
||||
|
|
|
@ -95,7 +95,7 @@ public:
|
|||
void ContinueEvict();
|
||||
|
||||
// Request that we start decoding the image as soon as data becomes available.
|
||||
void RequestDecode();
|
||||
void StartDecoding();
|
||||
|
||||
inline uint64_t InnerWindowID() const {
|
||||
return mInnerWindowId;
|
||||
|
@ -220,7 +220,7 @@ private:
|
|||
// Update the cache entry size based on the image container.
|
||||
void UpdateCacheEntrySize();
|
||||
|
||||
/// Returns true if RequestDecode() was called.
|
||||
/// Returns true if StartDecoding() was called.
|
||||
bool IsDecodeRequested() const;
|
||||
|
||||
// Weak reference to parent loader; this request cannot outlive its owner.
|
||||
|
|
|
@ -371,19 +371,12 @@ imgRequestProxy::StartDecoding()
|
|||
}
|
||||
|
||||
if (GetOwner()) {
|
||||
GetOwner()->RequestDecode();
|
||||
GetOwner()->StartDecoding();
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
imgRequestProxy::RequestDecode()
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
imgRequestProxy::LockImage()
|
||||
{
|
||||
|
|
|
@ -48,12 +48,6 @@ function ImageListener(start_callback, stop_callback)
|
|||
{
|
||||
do_check_false(this.synchronous);
|
||||
|
||||
try {
|
||||
aRequest.requestDecode();
|
||||
} catch (e) {
|
||||
do_print("requestDecode threw " + e);
|
||||
}
|
||||
|
||||
this.state |= LOAD_COMPLETE;
|
||||
|
||||
if (this.stop_callback)
|
||||
|
|
|
@ -962,9 +962,6 @@ struct nsStyleBorder {
|
|||
return mBorderImageSource.IsLoaded();
|
||||
}
|
||||
|
||||
// Defined in nsStyleStructInlines.h
|
||||
inline nsresult RequestDecode();
|
||||
|
||||
void GetBorderColor(mozilla::css::Side aSide, nscolor& aColor,
|
||||
bool& aForeground) const
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче