am 46820412: am 8eb16af2: Merge "don\'t try to lock a buffer that wasn\'t allocated with SW usage bits" into gingerbread
Merge commit '468204124e95bbf74ae8cc000318ade29e311be6' * commit '468204124e95bbf74ae8cc000318ade29e311be6': don't try to lock a buffer that wasn't allocated with SW usage bits
This commit is contained in:
commit
e34a3d1a29
|
@ -253,12 +253,16 @@ void Layer::reloadTexture(const Region& dirty)
|
|||
} else {
|
||||
slowpath:
|
||||
GGLSurface t;
|
||||
status_t res = buffer->lock(&t, GRALLOC_USAGE_SW_READ_OFTEN);
|
||||
LOGE_IF(res, "error %d (%s) locking buffer %p",
|
||||
res, strerror(res), buffer.get());
|
||||
if (res == NO_ERROR) {
|
||||
mBufferManager.loadTexture(dirty, t);
|
||||
buffer->unlock();
|
||||
if (buffer->usage & GRALLOC_USAGE_SW_READ_MASK) {
|
||||
status_t res = buffer->lock(&t, GRALLOC_USAGE_SW_READ_OFTEN);
|
||||
LOGE_IF(res, "error %d (%s) locking buffer %p",
|
||||
res, strerror(res), buffer.get());
|
||||
if (res == NO_ERROR) {
|
||||
mBufferManager.loadTexture(dirty, t);
|
||||
buffer->unlock();
|
||||
}
|
||||
} else {
|
||||
// we can't do anything
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue