зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1366984 - Fix image container check for background image layer. r=mattwoodrow
--HG-- extra : source : 14a2665a64f6e78b7c470a3eb0635e491660955a
This commit is contained in:
Родитель
017d00381d
Коммит
054093eb1e
|
@ -1969,23 +1969,32 @@ nsCSSRendering::CanBuildWebRenderDisplayItemsForStyleImageLayer(LayerManager* aM
|
|||
}
|
||||
}
|
||||
|
||||
// We only support painting gradients and image for a single style image layer
|
||||
const nsStyleImage* styleImage = &aBackgroundStyle->mImage.mLayers[aLayer].mImage;
|
||||
|
||||
// We only support image with image container.
|
||||
if (!styleImage->IsEmpty() && styleImage->GetType() == eStyleImageType_Image) {
|
||||
imgRequestProxy* requestProxy = styleImage->GetImageData();
|
||||
if (requestProxy) {
|
||||
nsCOMPtr<imgIContainer> srcImage;
|
||||
requestProxy->GetImage(getter_AddRefs(srcImage));
|
||||
if (srcImage && !srcImage->IsImageContainerAvailable(aManager, imgIContainer::FLAG_NONE)) {
|
||||
return false;
|
||||
}
|
||||
if (styleImage->GetType() == eStyleImageType_Image) {
|
||||
if (styleImage->GetCropRect()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
imgRequestProxy* requestProxy = styleImage->GetImageData();
|
||||
if (!requestProxy) {
|
||||
return false;
|
||||
}
|
||||
|
||||
nsCOMPtr<imgIContainer> srcImage;
|
||||
requestProxy->GetImage(getter_AddRefs(srcImage));
|
||||
if (!srcImage || !srcImage->IsImageContainerAvailable(aManager, imgIContainer::FLAG_NONE)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// We only support painting gradients and image for a single style image layer
|
||||
return styleImage->GetType() == eStyleImageType_Gradient ||
|
||||
styleImage->GetType() == eStyleImageType_Image;
|
||||
if (styleImage->GetType() == eStyleImageType_Gradient) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
DrawResult
|
||||
|
|
Загрузка…
Ссылка в новой задаче