Fix a crasher is surfaceflinger.
this bug introduced recently would happen when the very first buffer of a surface was rejected for not having the right size Bug: 6577035 Change-Id: I9fabf20006019f2a6c308be7c7f5c05bdcfd5014
This commit is contained in:
parent
2c8207e962
commit
e31564d8eb
@ -617,20 +617,20 @@ void Layer::lockPageFlip(bool& recomputeVisibleRegions)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// update the active buffer
|
// update the active buffer
|
||||||
mActiveBuffer = mSurfaceTexture->getCurrentBuffer();
|
mActiveBuffer = mSurfaceTexture->getCurrentBuffer();
|
||||||
|
if (mActiveBuffer == NULL) {
|
||||||
|
// this can only happen if the very first buffer was rejected.
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
mFrameLatencyNeeded = true;
|
mFrameLatencyNeeded = true;
|
||||||
if (oldActiveBuffer == NULL && mActiveBuffer != NULL) {
|
if (oldActiveBuffer == NULL) {
|
||||||
// the first time we receive a buffer, we need to trigger a
|
// the first time we receive a buffer, we need to trigger a
|
||||||
// geometry invalidation.
|
// geometry invalidation.
|
||||||
mFlinger->invalidateHwcGeometry();
|
mFlinger->invalidateHwcGeometry();
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t bufWidth = mActiveBuffer->getWidth();
|
|
||||||
uint32_t bufHeight = mActiveBuffer->getHeight();
|
|
||||||
|
|
||||||
Rect crop(mSurfaceTexture->getCurrentCrop());
|
Rect crop(mSurfaceTexture->getCurrentCrop());
|
||||||
const uint32_t transform(mSurfaceTexture->getCurrentTransform());
|
const uint32_t transform(mSurfaceTexture->getCurrentTransform());
|
||||||
const uint32_t scalingMode(mSurfaceTexture->getCurrentScalingMode());
|
const uint32_t scalingMode(mSurfaceTexture->getCurrentScalingMode());
|
||||||
@ -645,6 +645,8 @@ void Layer::lockPageFlip(bool& recomputeVisibleRegions)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (oldActiveBuffer != NULL) {
|
if (oldActiveBuffer != NULL) {
|
||||||
|
uint32_t bufWidth = mActiveBuffer->getWidth();
|
||||||
|
uint32_t bufHeight = mActiveBuffer->getHeight();
|
||||||
if (bufWidth != uint32_t(oldActiveBuffer->width) ||
|
if (bufWidth != uint32_t(oldActiveBuffer->width) ||
|
||||||
bufHeight != uint32_t(oldActiveBuffer->height)) {
|
bufHeight != uint32_t(oldActiveBuffer->height)) {
|
||||||
mFlinger->invalidateHwcGeometry();
|
mFlinger->invalidateHwcGeometry();
|
||||||
|
Loading…
Reference in New Issue
Block a user