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

This commit is contained in:
Oleg Romashin 2011-06-16 12:51:05 +02:00
Родитель caf89c95a3
Коммит 88c6a67f27
1 изменённых файлов: 12 добавлений и 3 удалений

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

@ -335,9 +335,14 @@ Layer::CalculateScissorRect(const nsIntRect& aCurrentScissorRect,
gfxMatrix matrix;
DebugOnly<bool> is2D = container->GetEffectiveTransform().Is2D(&matrix);
// See DefaultComputeEffectiveTransforms below
NS_ASSERTION(is2D && !matrix.HasNonIntegerTranslation(),
"Non-integer-translation transform with clipped child should have forced intermediate surface");
scissor.MoveBy(nsIntPoint(PRInt32(matrix.x0), PRInt32(matrix.y0)));
NS_ASSERTION(is2D && matrix.PreservesAxisAlignedRectangles(),
"Non preserves axis aligned transform with clipped child should have forced intermediate surface");
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
do {
@ -408,7 +413,11 @@ ContainerLayer::DefaultComputeEffectiveTransforms(const gfx3DMatrix& aTransformT
useIntermediateSurface = PR_FALSE;
gfxMatrix contTransform;
if (!mEffectiveTransform.Is2D(&contTransform) ||
#ifdef MOZ_GFX_OPTIMIZE_MOBILE
!contTransform.PreservesAxisAlignedRectangles()) {
#else
contTransform.HasNonIntegerTranslation()) {
#endif
for (Layer* child = GetFirstChild(); child; child = child->GetNextSibling()) {
const nsIntRect *clipRect = child->GetEffectiveClipRect();
/* We can't (easily) forward our transform to children with a non-empty clip