зеркало из https://github.com/mozilla/gecko-dev.git
Bug 792966: Don't try to gralloc small buffers. r=kanru
This commit is contained in:
Родитель
2a7ba86220
Коммит
63f748e97c
|
@ -1822,7 +1822,7 @@ public:
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MOZ_WIDGET_GONK
|
#ifdef MOZ_WIDGET_GONK
|
||||||
if (gUseBackingSurface) {
|
if (gUseBackingSurface && aSize.width >= 64) {
|
||||||
mGLContext->MakeCurrent(true);
|
mGLContext->MakeCurrent(true);
|
||||||
PixelFormat format = PixelFormatForImage(mUpdateFormat);
|
PixelFormat format = PixelFormatForImage(mUpdateFormat);
|
||||||
uint32_t usage = GraphicBuffer::USAGE_HW_TEXTURE |
|
uint32_t usage = GraphicBuffer::USAGE_HW_TEXTURE |
|
||||||
|
|
|
@ -294,6 +294,13 @@ ShadowLayerForwarder::PlatformAllocBuffer(const gfxIntSize& aSize,
|
||||||
uint32_t aCaps,
|
uint32_t aCaps,
|
||||||
SurfaceDescriptor* aBuffer)
|
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");
|
SAMPLE_LABEL("ShadowLayerForwarder", "PlatformAllocBuffer");
|
||||||
// Gralloc buffers are efficiently mappable as gfxImageSurface, so
|
// Gralloc buffers are efficiently mappable as gfxImageSurface, so
|
||||||
// no need to check |aCaps & MAP_AS_IMAGE_SURFACE|.
|
// no need to check |aCaps & MAP_AS_IMAGE_SURFACE|.
|
||||||
|
|
Загрузка…
Ссылка в новой задаче