diff options
author | Mathias Agopian <mathias@google.com> | 2010-02-11 17:30:52 -0800 |
---|---|---|
committer | Mathias Agopian <mathias@google.com> | 2010-02-21 23:27:25 -0800 |
commit | 98e71ddaede9a0bfb681fd237bec1f66c6c53193 (patch) | |
tree | b99491347832c92e1e5af62d11d3a9baf946dd18 /include/ui/GraphicBuffer.h | |
parent | e4f5055ad281096e5b89c4240be29d2c95a43b65 (diff) | |
download | frameworks_native-98e71ddaede9a0bfb681fd237bec1f66c6c53193.zip frameworks_native-98e71ddaede9a0bfb681fd237bec1f66c6c53193.tar.gz frameworks_native-98e71ddaede9a0bfb681fd237bec1f66c6c53193.tar.bz2 |
remove a dependency of GraphicBuffer (libui) on Parcel (libbinder).
Add a Flattenable interface to libutils which can be used to flatten
an object into bytestream + filedescriptor stream.
Parcel is modified to handle Flattenable. And GraphicBuffer implements
Flattenable.
Except for the overlay classes libui is now independent of libbinder.
Diffstat (limited to 'include/ui/GraphicBuffer.h')
-rw-r--r-- | include/ui/GraphicBuffer.h | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/include/ui/GraphicBuffer.h b/include/ui/GraphicBuffer.h index b9c491b..e72b6b3 100644 --- a/include/ui/GraphicBuffer.h +++ b/include/ui/GraphicBuffer.h @@ -23,6 +23,7 @@ #include <ui/android_native_buffer.h> #include <ui/PixelFormat.h> #include <ui/Rect.h> +#include <utils/Flattenable.h> #include <pixelflinger/pixelflinger.h> struct android_native_buffer_t; @@ -30,7 +31,6 @@ struct android_native_buffer_t; namespace android { class GraphicBufferMapper; -class Parcel; // =========================================================================== // GraphicBuffer @@ -40,7 +40,7 @@ class GraphicBuffer : public EGLNativeBase< android_native_buffer_t, GraphicBuffer, - LightRefBase<GraphicBuffer> > + LightRefBase<GraphicBuffer> >, public Flattenable { public: @@ -97,7 +97,6 @@ public: uint32_t getVerticalStride() const; protected: - GraphicBuffer(const Parcel& reply); virtual ~GraphicBuffer(); enum { @@ -122,8 +121,16 @@ private: status_t initSize(uint32_t w, uint32_t h, PixelFormat format, uint32_t usage); - static status_t writeToParcel(Parcel* reply, - android_native_buffer_t const* buffer); + void free_handle(); + + // Flattenable interface + size_t getFlattenedSize() const; + size_t getFdCount() const; + status_t flatten(void* buffer, size_t size, + int fds[], size_t count) const; + status_t unflatten(void const* buffer, size_t size, + int fds[], size_t count); + GraphicBufferMapper& mBufferMapper; ssize_t mInitCheck; |