diff options
author | Mathias Agopian <mathias@google.com> | 2011-07-25 19:56:08 -0700 |
---|---|---|
committer | Mathias Agopian <mathias@google.com> | 2011-07-25 20:03:43 -0700 |
commit | f3503c2c30dc0b7eb7603998469f437136497c5c (patch) | |
tree | 934ebd5f0c8da99a02cb7a4df77d908c54d34f02 /libs | |
parent | 9a817a35f11cb118209a3238451603258ae7f105 (diff) | |
download | frameworks_base-f3503c2c30dc0b7eb7603998469f437136497c5c.zip frameworks_base-f3503c2c30dc0b7eb7603998469f437136497c5c.tar.gz frameworks_base-f3503c2c30dc0b7eb7603998469f437136497c5c.tar.bz2 |
remove dead code and member variables.
also fix some comments and improve debugging logs.
Change-Id: I83e55309f306332b59e1ec46104c4a7fffbf3c97
Diffstat (limited to 'libs')
-rw-r--r-- | libs/gui/SurfaceTexture.cpp | 15 | ||||
-rw-r--r-- | libs/gui/SurfaceTextureClient.cpp | 6 |
2 files changed, 7 insertions, 14 deletions
diff --git a/libs/gui/SurfaceTexture.cpp b/libs/gui/SurfaceTexture.cpp index c190195..8c07d24 100644 --- a/libs/gui/SurfaceTexture.cpp +++ b/libs/gui/SurfaceTexture.cpp @@ -197,11 +197,14 @@ status_t SurfaceTexture::setBufferCount(int bufferCount) { status_t SurfaceTexture::setDefaultBufferSize(uint32_t w, uint32_t h) { - Mutex::Autolock lock(mMutex); - if ((w != mDefaultWidth) || (h != mDefaultHeight)) { - mDefaultWidth = w; - mDefaultHeight = h; + if (!w || !h) { + LOGE("setDefaultBufferSize: dimensions cannot be 0 (w=%d, h=%d)", w, h); + return BAD_VALUE; } + + Mutex::Autolock lock(mMutex); + mDefaultWidth = w; + mDefaultHeight = h; return OK; } @@ -903,13 +906,9 @@ int SurfaceTexture::query(int what, int* outValue) switch (what) { case NATIVE_WINDOW_WIDTH: value = mDefaultWidth; - if (!mDefaultWidth && !mDefaultHeight && mCurrentTextureBuf!=0) - value = mCurrentTextureBuf->width; break; case NATIVE_WINDOW_HEIGHT: value = mDefaultHeight; - if (!mDefaultWidth && !mDefaultHeight && mCurrentTextureBuf!=0) - value = mCurrentTextureBuf->height; break; case NATIVE_WINDOW_FORMAT: value = mPixelFormat; diff --git a/libs/gui/SurfaceTextureClient.cpp b/libs/gui/SurfaceTextureClient.cpp index df0ad5a..e6837ea 100644 --- a/libs/gui/SurfaceTextureClient.cpp +++ b/libs/gui/SurfaceTextureClient.cpp @@ -52,9 +52,6 @@ void SurfaceTextureClient::init() { mReqFormat = 0; mReqUsage = 0; mTimestamp = NATIVE_WINDOW_TIMESTAMP_AUTO; - mQueryWidth = 0; - mQueryHeight = 0; - mQueryFormat = 0; mDefaultWidth = 0; mDefaultHeight = 0; mTransformHint = 0; @@ -154,9 +151,6 @@ int SurfaceTextureClient::dequeueBuffer(android_native_buffer_t** buffer) { result); return result; } - mQueryWidth = gbuf->width; - mQueryHeight = gbuf->height; - mQueryFormat = gbuf->format; } *buffer = gbuf.get(); return OK; |