Skip to content

Commit

Permalink
Backed out changeset 9cbb90abba0d (bug 1387325) for build bustage on …
Browse files Browse the repository at this point in the history
…Windows at layout/xul/nsImageBoxFrame.cpp(250): 'LoadImageW': is not a member of 'nsContentUtils'. r=backout on a CLOSED TREE
  • Loading branch information
Archaeopteryx committed Sep 8, 2017
1 parent fe85412 commit 245d696
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 34 deletions.
37 changes: 8 additions & 29 deletions layout/xul/nsImageBoxFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -341,53 +341,32 @@ nsImageBoxFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
aLists.Content()->AppendToTop(&list);
}

already_AddRefed<imgIContainer>
nsImageBoxFrame::GetImageContainerForPainting(const nsPoint& aPt,
DrawResult& aDrawResult,
Maybe<nsPoint>& aAnchorPoint,
nsRect& aDest)
DrawResult
nsImageBoxFrame::PaintImage(gfxContext& aRenderingContext,
const nsRect& aDirtyRect, nsPoint aPt,
uint32_t aFlags)
{
if (!mImageRequest) {
// This probably means we're drawn by a native theme.
aDrawResult = DrawResult::SUCCESS;
return nullptr;
return DrawResult::SUCCESS;
}

// Don't draw if the image's size isn't available.
uint32_t imgStatus;
if (!NS_SUCCEEDED(mImageRequest->GetImageStatus(&imgStatus)) ||
!(imgStatus & imgIRequest::STATUS_SIZE_AVAILABLE)) {
aDrawResult = DrawResult::NOT_READY;
return nullptr;
return DrawResult::NOT_READY;
}

nsCOMPtr<imgIContainer> imgCon;
mImageRequest->GetImage(getter_AddRefs(imgCon));

if (!imgCon) {
aDrawResult = DrawResult::NOT_READY;
return nullptr;
return DrawResult::NOT_READY;
}

aDest = GetDestRect(aPt, aAnchorPoint);
aDrawResult = DrawResult::SUCCESS;
return imgCon.forget();
}

DrawResult
nsImageBoxFrame::PaintImage(gfxContext& aRenderingContext,
const nsRect& aDirtyRect, nsPoint aPt,
uint32_t aFlags)
{
DrawResult result;
Maybe<nsPoint> anchorPoint;
nsRect dest;
nsCOMPtr<imgIContainer> imgCon = GetImageContainerForPainting(aPt, result,
anchorPoint,
dest);
if (!imgCon) {
return result;
}
nsRect dest = GetDestRect(aPt, anchorPoint);

// don't draw if the image is not dirty
// XXX(seth): Can this actually happen anymore?
Expand Down
5 changes: 0 additions & 5 deletions layout/xul/nsImageBoxFrame.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,6 @@ class nsImageBoxFrame final : public nsLeafBoxFrame

virtual ~nsImageBoxFrame();

already_AddRefed<imgIContainer> GetImageContainerForPainting(const nsPoint& aPt,
DrawResult& aDrawResult,
Maybe<nsPoint>& aAnchorPoint,
nsRect& aDest);

DrawResult PaintImage(gfxContext& aRenderingContext,
const nsRect& aDirtyRect,
nsPoint aPt, uint32_t aFlags);
Expand Down

0 comments on commit 245d696

Please sign in to comment.