update surfaceflinger, libui and libagl to the new gralloc api
- Currently the lock/unlock path is naive and is done for each drawing operation (glDrawElements and glDrawArrays). this should be improved eventually.
- factor all the lock/unlock code in SurfaceBuffer.
- fixed "showupdate" so it works even when we don't have preserving eglSwapBuffers().
- improved the situation with the dirty-region and fixed a problem that caused GL apps to not update.
- make use of LightRefBase() where needed, instead of duplicating its implementation
- add LightRefBase::getStrongCount()
- renamed EGLNativeWindowSurface.cpp to FramebufferNativeWindow.cpp
- disabled copybits test, since it clashes with the new gralloc api
- Camera/Video will be fixed later when we rework the overlay apis
diff --git a/include/ui/BufferMapper.h b/include/ui/BufferMapper.h
index ff90033..5f084be 100644
--- a/include/ui/BufferMapper.h
+++ b/include/ui/BufferMapper.h
@@ -20,10 +20,7 @@
#include <stdint.h>
#include <sys/types.h>
-#include <utils/CallStack.h>
-#include <utils/threads.h>
#include <utils/Singleton.h>
-#include <utils/KeyedVector.h>
#include <hardware/gralloc.h>
@@ -40,9 +37,14 @@
{
public:
static inline BufferMapper& get() { return getInstance(); }
- status_t map(buffer_handle_t handle, void** addr, const void* id);
- status_t unmap(buffer_handle_t handle, const void* id);
- status_t lock(buffer_handle_t handle, int usage, const Rect& bounds);
+
+ status_t registerBuffer(buffer_handle_t handle);
+
+ status_t unregisterBuffer(buffer_handle_t handle);
+
+ status_t lock(buffer_handle_t handle,
+ int usage, const Rect& bounds, void** vaddr);
+
status_t unlock(buffer_handle_t handle);
// dumps information about the mapping of this handle
@@ -51,16 +53,7 @@
private:
friend class Singleton<BufferMapper>;
BufferMapper();
- mutable Mutex mLock;
gralloc_module_t const *mAllocMod;
-
- void logMapLocked(buffer_handle_t handle, const void* id);
- void logUnmapLocked(buffer_handle_t handle, const void* id);
- struct map_info_t {
- const void* id;
- CallStack stack;
- };
- KeyedVector<buffer_handle_t, Vector<map_info_t> > mMapInfo;
};
// ---------------------------------------------------------------------------