Bug 629100 - Fullscreen video stretches top and bottom rows of pixels to edge of screen [r=roc a=blocking-fennec]
authorAlex Pakhotin <alexp@mozilla.com>
Fri, 11 Feb 2011 18:31:09 -0800
changeset 62452 645fce13f10acd57edf0d8210c8e3afe4f6a0adb
parent 62451 63817ae85b308788af122cb08e15759c0bc30b4a
child 62453 edf89132ec20b0408562a9bf214eca8c78699775
push id1
push userroot
push dateTue, 10 Dec 2013 15:46:25 +0000
reviewersroc, blocking-fennec
bugs629100
milestone2.0b12pre
Bug 629100 - Fullscreen video stretches top and bottom rows of pixels to edge of screen [r=roc a=blocking-fennec]
gfx/layers/basic/BasicLayers.cpp
--- a/gfx/layers/basic/BasicLayers.cpp
+++ b/gfx/layers/basic/BasicLayers.cpp
@@ -2392,18 +2392,25 @@ BasicShadowImageLayer::Paint(gfxContext*
                              void* aCallbackData)
 {
   if (!mFrontSurface) {
     return;
   }
 
   nsRefPtr<gfxPattern> pat = new gfxPattern(mFrontSurface);
   pat->SetFilter(mFilter);
-  BasicImageLayer::PaintContext(
-    pat, GetEffectiveVisibleRegion(), GetTileSourceRect(), GetEffectiveOpacity(), aContext);
+
+  // The visible region can extend outside the image.  If we're not
+  // tiling, we don't want to draw into that area, so just draw within
+  // the image bounds.
+  const nsIntRect* tileSrcRect = GetTileSourceRect();
+  BasicImageLayer::PaintContext(pat,
+                                tileSrcRect ? GetEffectiveVisibleRegion() : nsIntRegion(nsIntRect(0, 0, mSize.width, mSize.height)),
+                                tileSrcRect,
+                                GetEffectiveOpacity(), aContext);
 }
 
 class BasicShadowColorLayer : public ShadowColorLayer,
                               BasicImplData
 {
 public:
   BasicShadowColorLayer(BasicShadowLayerManager* aLayerManager) :
     ShadowColorLayer(aLayerManager, static_cast<BasicImplData*>(this))