b=777946 use SetScaleToSize image layers even for non-XP_WIN plugins r=BenWa
authorKarl Tomlinson <karlt+@karlt.net>
Tue, 18 Sep 2012 15:16:33 +1200
changeset 107538 1b9d7c2c4310f5a24c5077f5232d099108c7865e
parent 107537 e8382a09b0e5c02b36fc9744f89329d2da05da75
child 107539 68b2fa9dc89a214074cc2ddac163f995260159f1
push id82
push usershu@rfrn.org
push dateFri, 05 Oct 2012 13:20:22 +0000
reviewersBenWa
bugs777946
milestone18.0a1
b=777946 use SetScaleToSize image layers even for non-XP_WIN plugins r=BenWa
layout/generic/nsObjectFrame.cpp
--- a/layout/generic/nsObjectFrame.cpp
+++ b/layout/generic/nsObjectFrame.cpp
@@ -1626,26 +1626,17 @@ nsObjectFrame::BuildLayer(nsDisplayListB
   // Create image
   nsRefPtr<ImageContainer> container = mInstanceOwner->GetImageContainer();
 
   if (!container) {
     // This can occur if our instance is gone.
     return nullptr;
   }
 
-  gfxIntSize size;
-
-#ifdef XP_MACOSX
-  if (mInstanceOwner->GetDrawingModel() == NPDrawingModelCoreAnimation) {
-    size = container->GetCurrentSize();
-  } else
-#endif
-  {
-    size = gfxIntSize(window->width, window->height);
-  }
+  gfxIntSize size(window->width, window->height);
 
   nsRect area = GetContentRectRelativeToSelf() + aItem->ToReferenceFrame();
   gfxRect r = nsLayoutUtils::RectToGfxRect(area, PresContext()->AppUnitsPerDevPixel());
   // to provide crisper and faster drawing.
   r.Round();
   nsRefPtr<Layer> layer =
     (aManager->GetLayerBuilder()->GetLeafLayerFor(aBuilder, aManager, aItem));
 
@@ -1658,19 +1649,17 @@ nsObjectFrame::BuildLayer(nsDisplayListB
         return nullptr;
     }
 
     NS_ASSERTION(layer->GetType() == Layer::TYPE_IMAGE, "Bad layer type");
 
     ImageLayer* imglayer = static_cast<ImageLayer*>(layer.get());
     UpdateImageLayer(r);
 
-#ifdef XP_WIN
     imglayer->SetScaleToSize(size, ImageLayer::SCALE_STRETCH);
-#endif
     imglayer->SetContainer(container);
     gfxPattern::GraphicsFilter filter =
       nsLayoutUtils::GetGraphicsFilterForFrame(this);
 #ifdef MOZ_GFX_OPTIMIZE_MOBILE
     if (!aManager->IsCompositingCheap()) {
       // Pixman just horrible with bilinear filter scaling
       filter = gfxPattern::FILTER_NEAREST;
     }