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
Родитель 2a7ba86220
Коммит 63f748e97c
2 изменённых файлов: 8 добавлений и 1 удалений

Просмотреть файл

@ -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 |

Просмотреть файл

@ -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|.