Bug 1097441 - Use SetScaleToSize for scaling videos so that it works for asynchronous size changes. r=roc

This commit is contained in:
Matt Woodrow 2014-11-12 17:11:53 +13:00
parent 127aa9579f
commit fb90898fa4

View File

@ -223,9 +223,8 @@ nsVideoFrame::BuildLayer(nsDisplayListBuilder* aBuilder,
// Set a transform on the layer to draw the video in the right place
gfxPoint p = r.TopLeft() + aContainerParameters.mOffset;
Matrix transform = Matrix::Translation(p.x, p.y);
transform.PreScale(r.Width() / frameSize.width,
r.Height() / frameSize.height);
layer->SetBaseTransform(gfx::Matrix4x4::From2D(transform));
layer->SetScaleToSize(IntSize(r.width, r.height), ScaleMode::STRETCH);
nsRefPtr<Layer> result = layer.forget();
return result.forget();
}