Bug 615794. Part 1: Be conservative when converting visible regions and opaque regions from appunits to pixels. r=tnikkel a=blocking

This commit is contained in:
Robert O'Callahan 2011-01-04 23:35:57 +13:00
Родитель 17544ff657
Коммит ee8f74d861
1 изменённых файлов: 6 добавлений и 5 удалений

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

@ -936,7 +936,8 @@ ContainerState::ThebesLayerData::Accumulate(nsDisplayListBuilder* aBuilder,
const FrameLayerBuilder::Clip& aClip)
{
nscolor uniformColor;
if (aItem->IsUniform(aBuilder, &uniformColor)) {
if (aItem->IsUniform(aBuilder, &uniformColor) &&
aItem->GetBounds(aBuilder).ToInsidePixels(AppUnitsPerDevPixel(aItem)).Contains(aVisibleRect)) {
if (mVisibleRegion.IsEmpty()) {
// This color is all we have
mSolidColor = uniformColor;
@ -968,7 +969,7 @@ ContainerState::ThebesLayerData::Accumulate(nsDisplayListBuilder* aBuilder,
// is a large opaque background at the bottom of z-order (e.g.,
// a canvas background), so we need to make sure that the first rect
// we see doesn't get discarded.
nsIntRect rect = aClip.ApproximateIntersect(*r).ToNearestPixels(appUnitsPerDevPixel);
nsIntRect rect = aClip.ApproximateIntersect(*r).ToInsidePixels(appUnitsPerDevPixel);
nsIntRegion tmp;
tmp.Or(mOpaqueRegion, rect);
// Opaque display items in chrome documents whose window is partially
@ -1077,7 +1078,7 @@ BuildTempManagerForInactiveLayer(nsDisplayListBuilder* aBuilder,
}
PRInt32 appUnitsPerDevPixel = AppUnitsPerDevPixel(aItem);
nsIntRect itemVisibleRect =
aItem->GetVisibleRect().ToNearestPixels(appUnitsPerDevPixel);
aItem->GetVisibleRect().ToOutsidePixels(appUnitsPerDevPixel);
SetVisibleRectForLayer(layer, itemVisibleRect);
tempManager->SetRoot(layer);
@ -1121,12 +1122,12 @@ ContainerState::ProcessDisplayItems(const nsDisplayList& aList,
"items in a container layer should all have the same app units per dev pixel");
nsIntRect itemVisibleRect =
item->GetVisibleRect().ToNearestPixels(appUnitsPerDevPixel);
item->GetVisibleRect().ToOutsidePixels(appUnitsPerDevPixel);
nsRect itemContent = item->GetBounds(mBuilder);
if (aClip.mHaveClipRect) {
itemContent.IntersectRect(aClip.mClipRect, itemContent);
}
nsIntRect itemDrawRect = itemContent.ToNearestPixels(appUnitsPerDevPixel);
nsIntRect itemDrawRect = itemContent.ToOutsidePixels(appUnitsPerDevPixel);
nsDisplayItem::LayerState layerState =
item->GetLayerState(mBuilder, mManager);