Bug 624647 followup: Minor cleanup in nsVideoFrame::BuildLayer(); restore a local variable which shouldn't have been removed. (no review)

An earlier patch for this bug (changeset 466d3ff030e6) removed local variable
"nsRect area", but then ended up effectively re-creating it further down in the
function as "contentBoxRect". (I added contentBoxRect as a late-breaking
change, as part of addressing a review comment.)

I've now realized that contentBoxRect is the same rect as "area", and it's
simpler to just declare the original "area" rect at the function's start
instead of dynamically creating it further down.

(Not requesting review, since this is a no-functional-change tweak, which is
following up on a change that I'd made in response to review feedback on a r+'d
patch.)
This commit is contained in:
Daniel Holbert 2014-11-25 15:40:02 -08:00
parent 2ebbbcd51e
commit 09ee9e8968

View File

@ -159,12 +159,12 @@ nsVideoFrame::BuildLayer(nsDisplayListBuilder* aBuilder,
nsDisplayItem* aItem,
const ContainerLayerParameters& aContainerParameters)
{
nsSize contentBoxSize = GetContentRectRelativeToSelf().Size();
nsRect area = GetContentRectRelativeToSelf() + aItem->ToReferenceFrame();
HTMLVideoElement* element = static_cast<HTMLVideoElement*>(GetContent());
nsIntSize videoSizeInPx;
if (NS_FAILED(element->GetVideoSize(&videoSizeInPx)) ||
contentBoxSize.IsEmpty()) {
area.IsEmpty()) {
return nullptr;
}
@ -189,11 +189,7 @@ nsVideoFrame::BuildLayer(nsDisplayListBuilder* aBuilder,
intrinsicSize.width.SetCoordValue(aspectRatio.width);
intrinsicSize.height.SetCoordValue(aspectRatio.height);
nsRect contentBoxRect(
GetContentRectRelativeToSelf().TopLeft() + aItem->ToReferenceFrame(),
contentBoxSize);
nsRect dest = nsLayoutUtils::ComputeObjectDestRect(contentBoxRect,
nsRect dest = nsLayoutUtils::ComputeObjectDestRect(area,
intrinsicSize,
aspectRatio,
StylePosition());