Bug 660565 - HTML5 HW accelerated video is slow r=roc

--HG--
extra : rebase_source : 5a46d17c72caf5ec4afd3f59093be803008c61ec
This commit is contained in:
Oleg Romashin 2011-06-16 12:51:05 +02:00
Родитель 7f7cfcb234
Коммит 2db7e3c5b0
1 изменённых файлов: 12 добавлений и 3 удалений

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

@ -335,9 +335,14 @@ Layer::CalculateScissorRect(const nsIntRect& aCurrentScissorRect,
gfxMatrix matrix; gfxMatrix matrix;
DebugOnly<bool> is2D = container->GetEffectiveTransform().Is2D(&matrix); DebugOnly<bool> is2D = container->GetEffectiveTransform().Is2D(&matrix);
// See DefaultComputeEffectiveTransforms below // See DefaultComputeEffectiveTransforms below
NS_ASSERTION(is2D && !matrix.HasNonIntegerTranslation(), NS_ASSERTION(is2D && matrix.PreservesAxisAlignedRectangles(),
"Non-integer-translation transform with clipped child should have forced intermediate surface"); "Non preserves axis aligned transform with clipped child should have forced intermediate surface");
scissor.MoveBy(nsIntPoint(PRInt32(matrix.x0), PRInt32(matrix.y0))); gfxRect r(scissor.x, scissor.y, scissor.width, scissor.height);
gfxRect trScissor = matrix.TransformBounds(r);
trScissor.Round();
if (!gfxUtils::GfxRectToIntRect(trScissor, &scissor)) {
return nsIntRect(currentClip.TopLeft(), nsIntSize(0, 0));
}
// Find the nearest ancestor with an intermediate surface // Find the nearest ancestor with an intermediate surface
do { do {
@ -408,7 +413,11 @@ ContainerLayer::DefaultComputeEffectiveTransforms(const gfx3DMatrix& aTransformT
useIntermediateSurface = PR_FALSE; useIntermediateSurface = PR_FALSE;
gfxMatrix contTransform; gfxMatrix contTransform;
if (!mEffectiveTransform.Is2D(&contTransform) || if (!mEffectiveTransform.Is2D(&contTransform) ||
#ifdef MOZ_GFX_OPTIMIZE_MOBILE
!contTransform.PreservesAxisAlignedRectangles()) {
#else
contTransform.HasNonIntegerTranslation()) { contTransform.HasNonIntegerTranslation()) {
#endif
for (Layer* child = GetFirstChild(); child; child = child->GetNextSibling()) { for (Layer* child = GetFirstChild(); child; child = child->GetNextSibling()) {
const nsIntRect *clipRect = child->GetEffectiveClipRect(); const nsIntRect *clipRect = child->GetEffectiveClipRect();
/* We can't (easily) forward our transform to children with a non-empty clip /* We can't (easily) forward our transform to children with a non-empty clip