Bug 915487 - Error handling for GonkDisplayJB. r=mwu

This commit is contained in:
Vincent Lin 2013-09-12 10:07:53 +08:00
Родитель 8457407669
Коммит 550cdda790
1 изменённых файлов: 7 добавлений и 4 удалений

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

@ -50,10 +50,10 @@ GonkDisplayJB::GonkDisplayJB()
ALOGW_IF(err, "could not open framebuffer"); ALOGW_IF(err, "could not open framebuffer");
} }
if (!err) { if (!err && mFBDevice) {
mWidth = mFBDevice->width; mWidth = mFBDevice->width;
mHeight = mFBDevice->height; mHeight = mFBDevice->height;
xdpi = mFBDevice->xdpi; xdpi = mFBDevice->xdpi;
/* The emulator actually reports RGBA_8888, but EGL doesn't return /* The emulator actually reports RGBA_8888, but EGL doesn't return
* any matching configuration. We force RGBX here to fix it. */ * any matching configuration. We force RGBX here to fix it. */
surfaceformat = HAL_PIXEL_FORMAT_RGBX_8888; surfaceformat = HAL_PIXEL_FORMAT_RGBX_8888;
@ -116,7 +116,10 @@ GonkDisplayJB::GonkDisplayJB()
status_t error; status_t error;
mBootAnimBuffer = mAlloc->createGraphicBuffer(mWidth, mHeight, surfaceformat, GRALLOC_USAGE_HW_FB | GRALLOC_USAGE_HW_RENDER | GRALLOC_USAGE_HW_COMPOSER, &error); mBootAnimBuffer = mAlloc->createGraphicBuffer(mWidth, mHeight, surfaceformat, GRALLOC_USAGE_HW_FB | GRALLOC_USAGE_HW_RENDER | GRALLOC_USAGE_HW_COMPOSER, &error);
StartBootAnimation(); if (error == NO_ERROR && mBootAnimBuffer.get())
StartBootAnimation();
else
ALOGW("Couldn't show bootanimation (%s)", strerror(-error));
} }
GonkDisplayJB::~GonkDisplayJB() GonkDisplayJB::~GonkDisplayJB()