Bug 687392 - Use nearest filter for mobile video/plugin rendering. r=roc
authorOleg Romashin <romaxa@gmail.com>
Mon, 19 Sep 2011 12:12:16 +0100
changeset 77130 9ae43404500df0ed167c90ffad1348c4cc3c50d7
parent 77129 bb708067dd5715d9f9be19916a92b970617134e8
child 77131 75086668aebb002726a7e9dd27739bf5cd8b1177
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersroc
bugs687392
milestone9.0a1
Bug 687392 - Use nearest filter for mobile video/plugin rendering. r=roc
layout/generic/nsObjectFrame.cpp
--- a/layout/generic/nsObjectFrame.cpp
+++ b/layout/generic/nsObjectFrame.cpp
@@ -1626,17 +1626,25 @@ nsObjectFrame::BuildLayer(nsDisplayListB
     }
 
     NS_ASSERTION(layer->GetType() == Layer::TYPE_IMAGE, "Bad layer type");
 
     ImageLayer* imglayer = static_cast<ImageLayer*>(layer.get());
     UpdateImageLayer(container, r);
 
     imglayer->SetContainer(container);
-    imglayer->SetFilter(nsLayoutUtils::GetGraphicsFilterForFrame(this));
+    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;
+    }
+#endif
+    imglayer->SetFilter(filter);
 
     layer->SetContentFlags(IsOpaque() ? Layer::CONTENT_OPAQUE : 0);
   } else {
     NS_ASSERTION(aItem->GetType() == nsDisplayItem::TYPE_PLUGIN_READBACK,
                  "Unknown item type");
     NS_ABORT_IF_FALSE(!IsOpaque(), "Opaque plugins don't use backgrounds");
 
     if (!layer) {