From 8ddd2c72ee7dd6f45e5375a197774b8671b982b7 Mon Sep 17 00:00:00 2001 From: Mathias Agopian Date: Fri, 1 Oct 2010 16:22:41 -0700 Subject: fix [2835280] Add support for cancelling buffers to ANativeWindow There is a new ANativeWindow::cancelBuffer() API that can be used to cancel any dequeued buffer, BEFORE it's been enqueued. The buffer is returned to the list of availlable buffers. dequeue and cancel are not mutually thread safe, they must be called from the same thread or external synchronization must be used. Change-Id: I86cc7985bace8b6a93ad2c75d2bef5c3c2cb4d61 --- include/surfaceflinger/Surface.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/surfaceflinger') diff --git a/include/surfaceflinger/Surface.h b/include/surfaceflinger/Surface.h index 7c5a39b..22684db 100644 --- a/include/surfaceflinger/Surface.h +++ b/include/surfaceflinger/Surface.h @@ -199,6 +199,7 @@ private: */ static int setSwapInterval(ANativeWindow* window, int interval); static int dequeueBuffer(ANativeWindow* window, android_native_buffer_t** buffer); + static int cancelBuffer(ANativeWindow* window, android_native_buffer_t* buffer); static int lockBuffer(ANativeWindow* window, android_native_buffer_t* buffer); static int queueBuffer(ANativeWindow* window, android_native_buffer_t* buffer); static int query(ANativeWindow* window, int what, int* value); @@ -207,6 +208,7 @@ private: int dequeueBuffer(android_native_buffer_t** buffer); int lockBuffer(android_native_buffer_t* buffer); int queueBuffer(android_native_buffer_t* buffer); + int cancelBuffer(android_native_buffer_t* buffer); int query(int what, int* value); int perform(int operation, va_list args); -- cgit v1.1