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

This commit is contained in:
Bas Schouten 2012-03-11 22:33:23 +00:00
Родитель 6f940549d6
Коммит e9fa9ad721
1 изменённых файлов: 10 добавлений и 1 удалений

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

@ -1549,7 +1549,13 @@ nsObjectFrame::BuildLayer(nsDisplayListBuilder* aBuilder,
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();
gfxRect r = nsLayoutUtils::RectToGfxRect(area, PresContext()->AppUnitsPerDevPixel());
@ -1572,6 +1578,9 @@ nsObjectFrame::BuildLayer(nsDisplayListBuilder* aBuilder,
ImageLayer* imglayer = static_cast<ImageLayer*>(layer.get());
UpdateImageLayer(r);
if (!mInstanceOwner->UseAsyncRendering()) {
imglayer->SetScaleToSize(size, ImageLayer::SCALE_STRETCH);
}
imglayer->SetContainer(container);
gfxPattern::GraphicsFilter filter =
nsLayoutUtils::GetGraphicsFilterForFrame(this);