From f3503c2c30dc0b7eb7603998469f437136497c5c Mon Sep 17 00:00:00 2001 From: Mathias Agopian Date: Mon, 25 Jul 2011 19:56:08 -0700 Subject: remove dead code and member variables. also fix some comments and improve debugging logs. Change-Id: I83e55309f306332b59e1ec46104c4a7fffbf3c97 --- libs/gui/SurfaceTexture.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'libs/gui/SurfaceTexture.cpp') diff --git a/libs/gui/SurfaceTexture.cpp b/libs/gui/SurfaceTexture.cpp index c190195b53d0..8c07d24012f1 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; -- cgit v1.2.3-59-g8ed1b