am 4660966b: am 144e1b59: am ac018fe3: EmuGL: refcount ColorBuffers on the host

* commit '4660966b791d8ea1be086a9ab0c58c672cca36ee':
  EmuGL: refcount ColorBuffers on the host
This commit is contained in:
Jesse Hall
2012-02-23 12:25:47 -08:00
committed by Android Git Automerger
7 changed files with 74 additions and 21 deletions

View File

@@ -279,8 +279,8 @@ static int gralloc_free(alloc_device_t* dev,
if (cb->hostHandle != 0) {
DEFINE_AND_VALIDATE_HOST_CONNECTION;
D("Destroying host ColorBuffer 0x%x\n", cb->hostHandle);
rcEnc->rcDestroyColorBuffer(rcEnc, cb->hostHandle);
D("Closing host ColorBuffer 0x%x\n", cb->hostHandle);
rcEnc->rcCloseColorBuffer(rcEnc, cb->hostHandle);
}
//
@@ -440,6 +440,12 @@ static int gralloc_register_buffer(gralloc_module_t const* module,
return -EINVAL;
}
if (cb->hostHandle != 0) {
DEFINE_AND_VALIDATE_HOST_CONNECTION;
D("Opening host ColorBuffer 0x%x\n", cb->hostHandle);
rcEnc->rcOpenColorBuffer(rcEnc, cb->hostHandle);
}
//
// if the color buffer has ashmem region and it is not mapped in this
// process map it now.
@@ -471,6 +477,12 @@ static int gralloc_unregister_buffer(gralloc_module_t const* module,
return -EINVAL;
}
if (cb->hostHandle != 0) {
DEFINE_AND_VALIDATE_HOST_CONNECTION;
D("Closing host ColorBuffer 0x%x\n", cb->hostHandle);
rcEnc->rcCloseColorBuffer(rcEnc, cb->hostHandle);
}
//
// unmap ashmem region if it was previously mapped in this process
// (through register_buffer)