Bug 601894 - Compare covered rects when computing whether a transform display list item is opaque / uniform. r=roc, a=betaN

This commit is contained in:
Markus Stange 2010-11-27 00:31:08 +01:00
Родитель ec3ed004f8
Коммит 8e77ad1573
5 изменённых файлов: 46 добавлений и 1 удалений

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

@ -1985,7 +1985,7 @@ nsRect nsDisplayTransform::GetBounds(nsDisplayListBuilder *aBuilder)
}
/* The transform is opaque iff the transform consists solely of scales and
* transforms and if the underlying content is opaque. Thus if the transform
* translations and if the underlying content is opaque. Thus if the transform
* is of the form
*
* |a c e|
@ -1993,6 +1993,12 @@ nsRect nsDisplayTransform::GetBounds(nsDisplayListBuilder *aBuilder)
* |0 0 1|
*
* We need b and c to be zero.
*
* We also need to check whether the underlying opaque content completely fills
* our visible rect. We use UntransformRect which expands to the axis-aligned
* bounding rect, but that's OK since if
* mStoredList.GetVisibleRect().Contains(untransformedVisible), then it
* certainly contains the actual (non-axis-aligned) untransformed rect.
*/
PRBool nsDisplayTransform::IsOpaque(nsDisplayListBuilder *aBuilder,
PRBool* aForceTransparentSurface)
@ -2001,8 +2007,11 @@ PRBool nsDisplayTransform::IsOpaque(nsDisplayListBuilder *aBuilder,
*aForceTransparentSurface = PR_FALSE;
}
const nsStyleDisplay* disp = mFrame->GetStyleDisplay();
nsRect untransformedVisible =
UntransformRect(mVisibleRect, mFrame, ToReferenceFrame());
return disp->mTransform.GetMainMatrixEntry(1) == 0.0f &&
disp->mTransform.GetMainMatrixEntry(2) == 0.0f &&
mStoredList.GetVisibleRect().Contains(untransformedVisible) &&
mStoredList.IsOpaque(aBuilder);
}
@ -2013,8 +2022,11 @@ PRBool nsDisplayTransform::IsOpaque(nsDisplayListBuilder *aBuilder,
PRBool nsDisplayTransform::IsUniform(nsDisplayListBuilder *aBuilder, nscolor* aColor)
{
const nsStyleDisplay* disp = mFrame->GetStyleDisplay();
nsRect untransformedVisible =
UntransformRect(mVisibleRect, mFrame, ToReferenceFrame());
return disp->mTransform.GetMainMatrixEntry(1) == 0.0f &&
disp->mTransform.GetMainMatrixEntry(2) == 0.0f &&
mStoredList.GetVisibleRect().Contains(untransformedVisible) &&
mStoredList.IsUniform(aBuilder, aColor);
}

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

@ -0,0 +1,20 @@
<!DOCTYPE html>
<html>
<body style="background: -moz-linear-gradient(lime, lime) fixed; overflow: hidden;">
<div style="position: absolute; left: 21.0138px; top: 507.24px; z-index: 17567; -moz-transform: scale(8);">
<div style="height: 128px; left: -64px; position: absolute; top: -64px; visibility: visible; width: 128px;"></div>
</div>
<div style="position: absolute; left: 640.572px; top: 386.574px; -moz-transform: scale(1); z-index: -157863;">
<div style="position: absolute; top: -64px; left: -64px; width: 128px; height: 128px; visibility: visible;"></div>
</div>
<div style="position: absolute; left: 568.346px; top: 582.669px; -moz-transform: scale(1); z-index: -62592;">
<div style="position: absolute; top: -64px; left: -64px; width: 128px; height: 128px; visibility: visible;"></div>
</div>
<div style="position: absolute; left: 573.27px; top: 168.861px; -moz-transform: scale(1); z-index: -137632;">
<div style="position: absolute; top: -64px; left: -64px; width: 128px; height: 128px; visibility: visible;"></div>
</div>
<div style="position: absolute; left: 519.063px; top: 182.9px; -moz-transform: scale(1); z-index: -50558;">
<div style="position: absolute; top: -64px; left: -64px; width: 128px; height: 128px; visibility: visible;"></div>
</div>
</body>
</html>

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

@ -0,0 +1,8 @@
<!DOCTYPE html>
<html>
<body style="background: -moz-linear-gradient(lime, lime) fixed;">
<div style="position: absolute; left: 0; top: 0; -moz-transform: scale(1)">
<div style="position: absolute; width: 200px; height: 200px;"></div>
</div>
</body>
</html>

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

@ -0,0 +1,2 @@
<!DOCTYPE html>
<body style="background: lime;">

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

@ -105,3 +105,6 @@ fails-if(d2d) == abspos-1d.html abspos-1-ref.html
== propagate-inherit-boolean.html propagate-inherit-boolean-ref.html
# Ensure you can't move outside an iframe
== iframe-1.html iframe-1-ref.html
# Bugs
== 601894-1.html 601894-ref.html
== 601894-2.html 601894-ref.html