diff options
| author | Jesse Hall <jessehall@google.com> | 2011-12-13 12:25:10 -0800 |
|---|---|---|
| committer | Android Git Automerger <android-git-automerger@android.com> | 2011-12-13 12:25:10 -0800 |
| commit | e565492c6c2807f5952bc51a309e98b204350616 (patch) | |
| tree | 741d78f0153a476b52dd4b2f258b8d1183e246de /include/system | |
| parent | ea36579f77c2ae3553e6208cc49758c180c7e98b (diff) | |
| parent | 3bc5e452808514c48cdb5d2c3ca14c022aeecf6f (diff) | |
| download | system_core-e565492c6c2807f5952bc51a309e98b204350616.tar.gz system_core-e565492c6c2807f5952bc51a309e98b204350616.tar.bz2 system_core-e565492c6c2807f5952bc51a309e98b204350616.zip | |
am 3bc5e452: am 7cd3e0a3: Document ANativeWindow\'s buffer refcounting
* commit '3bc5e452808514c48cdb5d2c3ca14c022aeecf6f':
Document ANativeWindow's buffer refcounting
Diffstat (limited to 'include/system')
| -rw-r--r-- | include/system/window.h | 42 |
1 files changed, 30 insertions, 12 deletions
diff --git a/include/system/window.h b/include/system/window.h index 959bd23f..1cc4a0a1 100644 --- a/include/system/window.h +++ b/include/system/window.h @@ -340,9 +340,15 @@ struct ANativeWindow int interval); /* - * hook called by EGL to acquire a buffer. After this call, the buffer - * is not locked, so its content cannot be modified. - * this call may block if no buffers are available. + * Hook called by EGL to acquire a buffer. After this call, the buffer + * is not locked, so its content cannot be modified. This call may block if + * no buffers are available. + * + * The window holds a reference to the buffer between dequeueBuffer and + * either queueBuffer or cancelBuffer, so clients only need their own + * reference if they might use the buffer after queueing or canceling it. + * Holding a reference to a buffer after queueing or canceling it is only + * allowed if a specific buffer count has been set. * * Returns 0 on success or -errno on error. */ @@ -358,14 +364,20 @@ struct ANativeWindow */ int (*lockBuffer)(struct ANativeWindow* window, struct ANativeWindowBuffer* buffer); - /* - * hook called by EGL when modifications to the render buffer are done. - * This unlocks and post the buffer. - * - * Buffers MUST be queued in the same order than they were dequeued. - * - * Returns 0 on success or -errno on error. - */ + /* + * Hook called by EGL when modifications to the render buffer are done. + * This unlocks and post the buffer. + * + * The window holds a reference to the buffer between dequeueBuffer and + * either queueBuffer or cancelBuffer, so clients only need their own + * reference if they might use the buffer after queueing or canceling it. + * Holding a reference to a buffer after queueing or canceling it is only + * allowed if a specific buffer count has been set. + * + * Buffers MUST be queued in the same order than they were dequeued. + * + * Returns 0 on success or -errno on error. + */ int (*queueBuffer)(struct ANativeWindow* window, struct ANativeWindowBuffer* buffer); @@ -411,10 +423,16 @@ struct ANativeWindow int operation, ... ); /* - * hook used to cancel a buffer that has been dequeued. + * Hook used to cancel a buffer that has been dequeued. * No synchronization is performed between dequeue() and cancel(), so * either external synchronization is needed, or these functions must be * called from the same thread. + * + * The window holds a reference to the buffer between dequeueBuffer and + * either queueBuffer or cancelBuffer, so clients only need their own + * reference if they might use the buffer after queueing or canceling it. + * Holding a reference to a buffer after queueing or canceling it is only + * allowed if a specific buffer count has been set. */ int (*cancelBuffer)(struct ANativeWindow* window, struct ANativeWindowBuffer* buffer); |
