Bug 918839 - Extend ThebesLayerBuffer's height to more than 32. r=jmuizelaar, a=koi+
authorSotaro Ikeda <sikeda@mozilla.com>
Mon, 23 Sep 2013 09:04:35 -0400
changeset 160410 4cb0a48b757422c7ebdbebe208b52dd0e0cfb9d0
parent 160409 a59d0e8196a05f54c876ed3def373108a53e5d57
child 160411 227ace83cdbd98ef1c8523aa50a0d2e8ed8ccf93
push id2961
push userlsblakk@mozilla.com
push dateMon, 28 Oct 2013 21:59:28 +0000
treeherdermozilla-beta@73ef4f13486f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjmuizelaar, koi
bugs918839
milestone26.0a2
Bug 918839 - Extend ThebesLayerBuffer's height to more than 32. r=jmuizelaar, a=koi+
gfx/layers/ThebesLayerBuffer.cpp
--- a/gfx/layers/ThebesLayerBuffer.cpp
+++ b/gfx/layers/ThebesLayerBuffer.cpp
@@ -501,16 +501,30 @@ ComputeBufferRect(const nsIntRect& aRequ
 {
   nsIntRect rect(aRequestedRect);
   // Set a minimum width to guarantee a minimum size of buffers we
   // allocate (and work around problems on some platforms with smaller
   // dimensions).  64 is the magic number needed to work around the
   // rendering glitch, and guarantees image rows can be SIMD'd for
   // even r5g6b5 surfaces pretty much everywhere.
   rect.width = std::max(aRequestedRect.width, 64);
+#ifdef MOZ_WIDGET_GONK
+  // Set a minumum height to guarantee a minumum height of buffers we
+  // allocate. Some GL implementations fail to render gralloc textures
+  // with a height 9px-16px. It happens on Adreno 200. Adreno 320 does not
+  // have this problem. 32 is choosed as alignment of gralloc buffers.
+  // See Bug 873937.
+  // Increase the height only when the requested height is more than 0.
+  // See Bug 895976.
+  // XXX it might be better to disable it on the gpu that does not have
+  // the height problem.
+  if (rect.height > 0) {
+    rect.height = std::max(aRequestedRect.height, 32);
+  }
+#endif
   return rect;
 }
 
 ThebesLayerBuffer::PaintState
 ThebesLayerBuffer::BeginPaint(ThebesLayer* aLayer, ContentType aContentType,
                               uint32_t aFlags)
 {
   PaintState result;