Bug 792966: Don't try to gralloc small buffers. r=kanru

This commit is contained in:
Chris Jones 2013-01-28 23:49:38 -08:00
parent ae2267c2fc
commit 739aae6070
2 changed files with 8 additions and 1 deletions

View File

@ -1822,7 +1822,7 @@ public:
#endif
#ifdef MOZ_WIDGET_GONK
if (gUseBackingSurface) {
if (gUseBackingSurface && aSize.width >= 64) {
mGLContext->MakeCurrent(true);
PixelFormat format = PixelFormatForImage(mUpdateFormat);
uint32_t usage = GraphicBuffer::USAGE_HW_TEXTURE |

View File

@ -294,6 +294,13 @@ ShadowLayerForwarder::PlatformAllocBuffer(const gfxIntSize& aSize,
uint32_t aCaps,
SurfaceDescriptor* aBuffer)
{
// Some GL implementations fail to render gralloc textures with
// width < 64. There's not much point in gralloc'ing buffers that
// small anyway, so fall back on shared memory plus a texture
// upload.
if (aSize.width < 64) {
return false;
}
SAMPLE_LABEL("ShadowLayerForwarder", "PlatformAllocBuffer");
// Gralloc buffers are efficiently mappable as gfxImageSurface, so
// no need to check |aCaps & MAP_AS_IMAGE_SURFACE|.