diff options
author | Jamie Gennis <jgennis@google.com> | 2011-02-27 14:10:20 -0800 |
---|---|---|
committer | Jamie Gennis <jgennis@google.com> | 2011-02-28 12:24:40 -0800 |
commit | 96dcc978430f0daf6d73fee96a01779ed537a0ce (patch) | |
tree | 683c5986dd007030e5a98e57aa6c0764d19da51b /libs/gui/SurfaceTextureClient.cpp | |
parent | 8e79442c4fdabd2f82d0ed8e23d394816edee495 (diff) | |
download | frameworks_base-96dcc978430f0daf6d73fee96a01779ed537a0ce.zip frameworks_base-96dcc978430f0daf6d73fee96a01779ed537a0ce.tar.gz frameworks_base-96dcc978430f0daf6d73fee96a01779ed537a0ce.tar.bz2 |
Add the MIN_UNDEQUEUED_BUFFERS query to ANW.
This change adds a new query to ANativeWindow for getting the minimum
number of buffers that must be left un-dequeued during the steady-state
operation of the ANativeWindow.
Change-Id: Ie8c461fc26b02ecde02ddb4f95bf763662cf1551
Related-Bug: 3356050
Diffstat (limited to 'libs/gui/SurfaceTextureClient.cpp')
-rw-r--r-- | libs/gui/SurfaceTextureClient.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/libs/gui/SurfaceTextureClient.cpp b/libs/gui/SurfaceTextureClient.cpp index ee14ac9..43b330c 100644 --- a/libs/gui/SurfaceTextureClient.cpp +++ b/libs/gui/SurfaceTextureClient.cpp @@ -143,8 +143,21 @@ int SurfaceTextureClient::queueBuffer(android_native_buffer_t* buffer) { int SurfaceTextureClient::query(int what, int* value) { LOGV("SurfaceTextureClient::query"); Mutex::Autolock lock(mMutex); - // XXX: Implement this! - return INVALID_OPERATION; + switch (what) { + case NATIVE_WINDOW_WIDTH: + case NATIVE_WINDOW_HEIGHT: + // XXX: How should SurfaceTexture behave if setBuffersGeometry didn't + // override the size? + *value = 0; + return NO_ERROR; + case NATIVE_WINDOW_FORMAT: + *value = DEFAULT_FORMAT; + return NO_ERROR; + case NATIVE_WINDOW_MIN_UNDEQUEUED_BUFFERS: + *value = MIN_UNDEQUEUED_BUFFERS; + return NO_ERROR; + } + return BAD_VALUE; } int SurfaceTextureClient::perform(int operation, va_list args) |