Bug 1152080 - Plugin configuration clip rects should be treated as visible rects. r=roc
authorJim Mathies <jmathies@mozilla.com>
Tue, 11 Aug 2015 13:07:34 -0500
changeset 257591 be020690f03288bbbcf8e061a2f0bc80de498195
parent 257590 bbc8646e83432bd74a37b6a6950a53c9e5a4644d
child 257592 373f429e2549d67dab20a0209dadeb51f41a13e4
push id29223
push userkwierso@gmail.com
push dateThu, 13 Aug 2015 22:18:08 +0000
treeherdermozilla-central@4b35236fc76e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs1152080
milestone43.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1152080 - Plugin configuration clip rects should be treated as visible rects. r=roc
gfx/layers/ipc/CompositorChild.cpp
--- a/gfx/layers/ipc/CompositorChild.cpp
+++ b/gfx/layers/ipc/CompositorChild.cpp
@@ -212,24 +212,24 @@ static void CalculatePluginClip(const gf
                                 const nsTArray<gfx::IntRect>& aPluginClipRects,
                                 const nsIntPoint& aContentOffset,
                                 const nsIntRegion& aParentLayerVisibleRegion,
                                 nsTArray<gfx::IntRect>& aResult,
                                 gfx::IntRect& aVisibleBounds,
                                 bool& aPluginIsVisible)
 {
   aPluginIsVisible = true;
-  // aBounds (content origin)
-  nsIntRegion contentVisibleRegion(aBounds);
-  // aPluginClipRects (plugin widget origin)
+  nsIntRegion contentVisibleRegion;
+  // aPluginClipRects (plugin widget origin) - contains *visible* rects
   for (uint32_t idx = 0; idx < aPluginClipRects.Length(); idx++) {
     gfx::IntRect rect = aPluginClipRects[idx];
     // shift to content origin
     rect.MoveBy(aBounds.x, aBounds.y);
-    contentVisibleRegion.AndWith(rect);
+    // accumulate visible rects
+    contentVisibleRegion.OrWith(rect);
   }
   // apply layers clip (window origin)
   nsIntRegion region = aParentLayerVisibleRegion;
   region.MoveBy(-aContentOffset.x, -aContentOffset.y);
   contentVisibleRegion.AndWith(region);
   if (contentVisibleRegion.IsEmpty()) {
     aPluginIsVisible = false;
     return;