OSDN Git Service

add an offset field to gralloc handles so the framebuffer can work with copybit
authorMathias Agopian <mathias@google.com>
Wed, 10 Jun 2009 23:06:28 +0000 (16:06 -0700)
committerMathias Agopian <mathias@google.com>
Wed, 10 Jun 2009 23:06:28 +0000 (16:06 -0700)
modules/gralloc/gralloc.cpp
modules/gralloc/gralloc_priv.h

index 5a38b33..6ec65e9 100644 (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;
index 2aaf141..4d5afdc 100644 (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;