зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1711061 - Part 5. Expose an ImageProviderId for tracking surface ownership. r=tnikkel
This will be used by layers as a replacement for ImageContainer's ContainerProducerID for tracking if the same imgIRequest/imgIContainer own the cached WebRenderImageProvider. Differential Revision: https://phabricator.services.mozilla.com/D126598
This commit is contained in:
Родитель
546e3f7640
Коммит
dfee884d74
|
@ -128,6 +128,12 @@ DynamicImage::GetProducerId(uint32_t* aId) {
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
DynamicImage::GetProviderId(uint32_t* aId) {
|
||||
*aId = 0;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
DynamicImage::GetAnimated(bool* aAnimated) {
|
||||
*aAnimated = false;
|
||||
|
|
|
@ -145,6 +145,11 @@ ImageWrapper::GetProducerId(uint32_t* aId) {
|
|||
return mInnerImage->GetProducerId(aId);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
ImageWrapper::GetProviderId(uint32_t* aId) {
|
||||
return mInnerImage->GetProviderId(aId);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
ImageWrapper::GetAnimated(bool* aAnimated) {
|
||||
return mInnerImage->GetAnimated(aAnimated);
|
||||
|
|
|
@ -280,6 +280,14 @@ RasterImage::GetProducerId(uint32_t* aId) {
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
RasterImage::GetProviderId(uint32_t* aId) {
|
||||
NS_ENSURE_ARG_POINTER(aId);
|
||||
|
||||
*aId = ImageResource::GetImageProviderId();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
LookupResult RasterImage::LookupFrameInternal(const OrientedIntSize& aSize,
|
||||
uint32_t aFlags,
|
||||
PlaybackType aPlaybackType,
|
||||
|
|
|
@ -627,6 +627,15 @@ VectorImage::GetProducerId(uint32_t* aId) {
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
//******************************************************************************
|
||||
NS_IMETHODIMP
|
||||
VectorImage::GetProviderId(uint32_t* aId) {
|
||||
NS_ENSURE_ARG_POINTER(aId);
|
||||
|
||||
*aId = ImageResource::GetImageProviderId();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//******************************************************************************
|
||||
NS_IMETHODIMP
|
||||
VectorImage::GetAnimated(bool* aAnimated) {
|
||||
|
|
|
@ -174,6 +174,11 @@ interface imgIContainer : nsISupports
|
|||
*/
|
||||
[infallible] readonly attribute unsigned long producerId;
|
||||
|
||||
/**
|
||||
* Provider ID for image providers created by this image.
|
||||
*/
|
||||
[infallible] readonly attribute unsigned long providerId;
|
||||
|
||||
/**
|
||||
* Flags for imgIContainer operations.
|
||||
*
|
||||
|
|
|
@ -35,6 +35,11 @@ interface imgIRequest : nsIRequest
|
|||
*/
|
||||
[infallible] readonly attribute unsigned long producerId;
|
||||
|
||||
/**
|
||||
* Provider ID for image providers created by this image.
|
||||
*/
|
||||
[infallible] readonly attribute unsigned long providerId;
|
||||
|
||||
/**
|
||||
* Bits set in the return value from imageStatus
|
||||
* @name statusflags
|
||||
|
|
|
@ -681,6 +681,21 @@ imgRequestProxy::GetProducerId(uint32_t* aId) {
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
imgRequestProxy::GetProviderId(uint32_t* aId) {
|
||||
NS_ENSURE_TRUE(aId, NS_ERROR_NULL_POINTER);
|
||||
|
||||
nsCOMPtr<imgIContainer> image;
|
||||
nsresult rv = GetImage(getter_AddRefs(image));
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
*aId = image->GetProviderId();
|
||||
} else {
|
||||
*aId = 0;
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
imgRequestProxy::GetImageStatus(uint32_t* aStatus) {
|
||||
if (IsValidating()) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче