Bug 579663. Part 9. Simplify ProcessDisplayItems because all items in a container layer have the same app units per dev pixel. r=roc

This commit is contained in:
Timothy Nikkel 2010-08-08 13:49:07 -05:00
Родитель 3b953e9755
Коммит 987f68275e
1 изменённых файлов: 6 добавлений и 1 удалений

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

@ -906,6 +906,9 @@ void
ContainerState::ProcessDisplayItems(const nsDisplayList& aList, ContainerState::ProcessDisplayItems(const nsDisplayList& aList,
const nsRect* aClipRect) const nsRect* aClipRect)
{ {
PRInt32 appUnitsPerDevPixel =
mContainerFrame->PresContext()->AppUnitsPerDevPixel();
for (nsDisplayItem* item = aList.GetBottom(); item; item = item->GetAbove()) { for (nsDisplayItem* item = aList.GetBottom(); item; item = item->GetAbove()) {
if (item->GetType() == nsDisplayItem::TYPE_CLIP) { if (item->GetType() == nsDisplayItem::TYPE_CLIP) {
nsDisplayClip* clipItem = static_cast<nsDisplayClip*>(item); nsDisplayClip* clipItem = static_cast<nsDisplayClip*>(item);
@ -917,7 +920,9 @@ ContainerState::ProcessDisplayItems(const nsDisplayList& aList,
continue; continue;
} }
PRInt32 appUnitsPerDevPixel = AppUnitsPerDevPixel(item); NS_ASSERTION(appUnitsPerDevPixel == AppUnitsPerDevPixel(item),
"items in a container layer should all have the same app units per dev pixel");
nsIntRect itemVisibleRect = nsIntRect itemVisibleRect =
item->GetVisibleRect().ToNearestPixels(appUnitsPerDevPixel); item->GetVisibleRect().ToNearestPixels(appUnitsPerDevPixel);
nsRect itemContent = item->GetBounds(mBuilder); nsRect itemContent = item->GetBounds(mBuilder);