add an offset field to gralloc handles so the framebuffer can work with copybit

This commit is contained in:
Mathias Agopian
2009-06-10 16:06:28 -07:00
parent 5115665397
commit 72c8508db9
2 changed files with 5 additions and 3 deletions

View File

@@ -147,6 +147,7 @@ static int gralloc_alloc_framebuffer_locked(alloc_device_t* dev,
}
hnd->base = vaddr;
hnd->offset = vaddr - intptr_t(m->framebuffer->base);
*pHandle = hnd;
return 0;

View File

@@ -82,18 +82,19 @@ struct private_handle_t : public native_handle
int magic;
int flags;
int size;
int offset; // used with copybit
// FIXME: the attributes below should be out-of-line
int base;
int lockState;
int writeOwner;
static const int sNumInts = 6;
static const int sNumInts = 7;
static const int sNumFds = 1;
static const int sMagic = 0x3141592;
private_handle_t(int fd, int size, int flags) :
fd(fd), magic(sMagic), flags(flags), size(size), base(0),
lockState(0), writeOwner(0)
fd(fd), magic(sMagic), flags(flags), size(size), offset(0),
base(0), lockState(0), writeOwner(0)
{
version = sizeof(native_handle);
numInts = sNumInts;