Merge "don't try to lock a buffer that wasn't allocated with SW usage bits" into gingerbread
This commit is contained in:
committed by
Android (Google) Code Review
commit
8eb16af293
@ -196,12 +196,16 @@ void Layer::reloadTexture(const Region& dirty)
|
|||||||
} else {
|
} else {
|
||||||
slowpath:
|
slowpath:
|
||||||
GGLSurface t;
|
GGLSurface t;
|
||||||
status_t res = buffer->lock(&t, GRALLOC_USAGE_SW_READ_OFTEN);
|
if (buffer->usage & GRALLOC_USAGE_SW_READ_MASK) {
|
||||||
LOGE_IF(res, "error %d (%s) locking buffer %p",
|
status_t res = buffer->lock(&t, GRALLOC_USAGE_SW_READ_OFTEN);
|
||||||
res, strerror(res), buffer.get());
|
LOGE_IF(res, "error %d (%s) locking buffer %p",
|
||||||
if (res == NO_ERROR) {
|
res, strerror(res), buffer.get());
|
||||||
mBufferManager.loadTexture(dirty, t);
|
if (res == NO_ERROR) {
|
||||||
buffer->unlock();
|
mBufferManager.loadTexture(dirty, t);
|
||||||
|
buffer->unlock();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// we can't do anything
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user