Bug 732988 - Part 2: Use ScaleToSize API for plugin drawing. r=roc

This commit is contained in:
Bas Schouten 2012-03-13 01:41:34 +00:00
Родитель acbb9ef3aa
Коммит 762b23d674
1 изменённых файлов: 10 добавлений и 1 удалений

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

@ -1549,7 +1549,13 @@ nsObjectFrame::BuildLayer(nsDisplayListBuilder* aBuilder,
return nsnull; return nsnull;
} }
gfxIntSize size = container->GetCurrentSize(); gfxIntSize size;
if (mInstanceOwner->UseAsyncRendering()) {
size = container->GetCurrentSize();
} else {
size = gfxIntSize(window->width, window->height);
}
nsRect area = GetContentRectRelativeToSelf() + aItem->ToReferenceFrame(); nsRect area = GetContentRectRelativeToSelf() + aItem->ToReferenceFrame();
gfxRect r = nsLayoutUtils::RectToGfxRect(area, PresContext()->AppUnitsPerDevPixel()); gfxRect r = nsLayoutUtils::RectToGfxRect(area, PresContext()->AppUnitsPerDevPixel());
@ -1572,6 +1578,9 @@ nsObjectFrame::BuildLayer(nsDisplayListBuilder* aBuilder,
ImageLayer* imglayer = static_cast<ImageLayer*>(layer.get()); ImageLayer* imglayer = static_cast<ImageLayer*>(layer.get());
UpdateImageLayer(r); UpdateImageLayer(r);
if (!mInstanceOwner->UseAsyncRendering()) {
imglayer->SetScaleToSize(size, ImageLayer::SCALE_STRETCH);
}
imglayer->SetContainer(container); imglayer->SetContainer(container);
gfxPattern::GraphicsFilter filter = gfxPattern::GraphicsFilter filter =
nsLayoutUtils::GetGraphicsFilterForFrame(this); nsLayoutUtils::GetGraphicsFilterForFrame(this);