зеркало из https://github.com/mozilla/gecko-dev.git
changes for creating the image container from the decoder. Needed for supporting different image container types (needed for ART support in the short term).
This commit is contained in:
Родитель
a717446397
Коммит
eba6e78ed4
|
@ -43,7 +43,7 @@ interface imgIRequest : nsIRequest
|
|||
* @return the image object associated with the request.
|
||||
* @attention NEED DOCS
|
||||
*/
|
||||
readonly attribute imgIContainer image;
|
||||
attribute imgIContainer image;
|
||||
|
||||
/**
|
||||
* Bits set in the return value from imageStatus
|
||||
|
|
|
@ -85,9 +85,6 @@ nsresult imgRequest::Init(nsIChannel *aChannel, nsICacheEntryDescriptor *aCacheE
|
|||
mCacheEntry = aCacheEntry;
|
||||
#endif
|
||||
|
||||
// XXX do not init the image here. this has to be done from the image decoder.
|
||||
mImage = do_CreateInstance("@mozilla.org/image/container;1");
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -296,7 +293,7 @@ NS_IMETHODIMP imgRequest::Resume()
|
|||
|
||||
/** imgIRequest methods **/
|
||||
|
||||
/* readonly attribute imgIContainer image; */
|
||||
/* attribute imgIContainer image; */
|
||||
NS_IMETHODIMP imgRequest::GetImage(imgIContainer * *aImage)
|
||||
{
|
||||
PR_LOG(gImgLog, PR_LOG_DEBUG,
|
||||
|
@ -306,6 +303,16 @@ NS_IMETHODIMP imgRequest::GetImage(imgIContainer * *aImage)
|
|||
NS_IF_ADDREF(*aImage);
|
||||
return NS_OK;
|
||||
}
|
||||
NS_IMETHODIMP imgRequest::SetImage(imgIContainer *aImage)
|
||||
{
|
||||
PR_LOG(gImgLog, PR_LOG_DEBUG,
|
||||
("[this=%p] imgRequest::SetImage\n", this));
|
||||
|
||||
if (mImage) return NS_ERROR_FAILURE;
|
||||
|
||||
mImage = aImage;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute unsigned long imageStatus; */
|
||||
NS_IMETHODIMP imgRequest::GetImageStatus(PRUint32 *aStatus)
|
||||
|
@ -421,7 +428,8 @@ NS_IMETHODIMP imgRequest::OnDataAvailable(imgIRequest *request, nsISupports *cx,
|
|||
LOG_SCOPE(gImgLog, "imgRequest::OnDataAvailable");
|
||||
|
||||
nsCOMPtr<imgIDecoderObserver> container = do_QueryInterface(mImage);
|
||||
container->OnDataAvailable(request, cx, frame, rect);
|
||||
if (container)
|
||||
container->OnDataAvailable(request, cx, frame, rect);
|
||||
|
||||
PRInt32 i = -1;
|
||||
PRInt32 count = mObservers.Count();
|
||||
|
|
|
@ -150,7 +150,7 @@ NS_IMETHODIMP imgRequestProxy::Resume()
|
|||
|
||||
/** imgIRequest methods **/
|
||||
|
||||
/* readonly attribute imgIContainer image; */
|
||||
/* attribute imgIContainer image; */
|
||||
NS_IMETHODIMP imgRequestProxy::GetImage(imgIContainer * *aImage)
|
||||
{
|
||||
if (!mOwner)
|
||||
|
@ -158,6 +158,10 @@ NS_IMETHODIMP imgRequestProxy::GetImage(imgIContainer * *aImage)
|
|||
|
||||
return mOwner->GetImage(aImage);
|
||||
}
|
||||
NS_IMETHODIMP imgRequestProxy::SetImage(imgIContainer *aImage)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
/* readonly attribute unsigned long imageStatus; */
|
||||
NS_IMETHODIMP imgRequestProxy::GetImageStatus(PRUint32 *aStatus)
|
||||
|
|
Загрузка…
Ссылка в новой задаче