Bug 915487 - Error handling for GonkDisplayJB. r=mwu

This commit is contained in:
Vincent Lin 2013-09-12 10:07:53 +08:00
parent 5bc61ef3c4
commit f137273ce9

View File

@ -50,10 +50,10 @@ GonkDisplayJB::GonkDisplayJB()
ALOGW_IF(err, "could not open framebuffer");
}
if (!err) {
if (!err && mFBDevice) {
mWidth = mFBDevice->width;
mHeight = mFBDevice->height;
xdpi = mFBDevice->xdpi;
mHeight = mFBDevice->height;
xdpi = mFBDevice->xdpi;
/* The emulator actually reports RGBA_8888, but EGL doesn't return
* any matching configuration. We force RGBX here to fix it. */
surfaceformat = HAL_PIXEL_FORMAT_RGBX_8888;
@ -116,7 +116,10 @@ GonkDisplayJB::GonkDisplayJB()
status_t 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()