diff --git a/gfx/layers/ThebesLayerBuffer.cpp b/gfx/layers/ThebesLayerBuffer.cpp index 852155e7cf5..fbd36827584 100644 --- a/gfx/layers/ThebesLayerBuffer.cpp +++ b/gfx/layers/ThebesLayerBuffer.cpp @@ -506,6 +506,20 @@ ComputeBufferRect(const nsIntRect& aRequestedRect) // 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; }