Bug 1170052 part 1: Refactor nsImageBoxFrame::PaintImage() so its final failure case is an early return. r=seth

This commit is contained in:
Daniel Holbert 2015-06-12 11:40:36 -07:00
Родитель 1ee7f9ba83
Коммит a3e3a8c1d8
1 изменённых файлов: 9 добавлений и 9 удалений

Просмотреть файл

@ -341,17 +341,17 @@ nsImageBoxFrame::PaintImage(nsRenderingContext& aRenderingContext,
nsCOMPtr<imgIContainer> imgCon;
mImageRequest->GetImage(getter_AddRefs(imgCon));
if (imgCon) {
bool hasSubRect = !mUseSrcAttr && (mSubRect.width > 0 || mSubRect.height > 0);
return
nsLayoutUtils::DrawSingleImage(*aRenderingContext.ThebesContext(),
PresContext(), imgCon,
nsLayoutUtils::GetGraphicsFilterForFrame(this),
rect, dirty, nullptr, aFlags, nullptr,
hasSubRect ? &mSubRect : nullptr);
if (!imgCon) {
return DrawResult::NOT_READY;
}
return DrawResult::NOT_READY;
bool hasSubRect = !mUseSrcAttr && (mSubRect.width > 0 || mSubRect.height > 0);
return nsLayoutUtils::DrawSingleImage(
*aRenderingContext.ThebesContext(),
PresContext(), imgCon,
nsLayoutUtils::GetGraphicsFilterForFrame(this),
rect, dirty, nullptr, aFlags, nullptr,
hasSubRect ? &mSubRect : nullptr);
}
void nsDisplayXULImage::Paint(nsDisplayListBuilder* aBuilder,