summaryrefslogtreecommitdiffstats
path: root/libs/gui
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2011-11-15 13:11:19 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2011-11-15 13:11:19 -0800
commit1fea891f0099a554c9402675bf4ce8f9ef2cac13 (patch)
tree73b3f5ee48e7a2833315a397528352df8fffa190 /libs/gui
parentd6ae2ceedf3a44840d3e872ca69380bf92fe430e (diff)
parent556a406cf4dd8a7faa318e0d522d899f8b9da7dc (diff)
downloadframeworks_base-1fea891f0099a554c9402675bf4ce8f9ef2cac13.zip
frameworks_base-1fea891f0099a554c9402675bf4ce8f9ef2cac13.tar.gz
frameworks_base-1fea891f0099a554c9402675bf4ce8f9ef2cac13.tar.bz2
am 556a406c: am 3aa684ec: Merge "enable ALLOW_DEQUEUE_CURRENT_BUFFER for tegra devices" into ics-mr1
* commit '556a406cf4dd8a7faa318e0d522d899f8b9da7dc': enable ALLOW_DEQUEUE_CURRENT_BUFFER for tegra devices
Diffstat (limited to 'libs/gui')
-rw-r--r--libs/gui/Android.mk4
-rw-r--r--libs/gui/SurfaceTexture.cpp10
2 files changed, 11 insertions, 3 deletions
diff --git a/libs/gui/Android.mk b/libs/gui/Android.mk
index 2d716c7..b7e3ee3 100644
--- a/libs/gui/Android.mk
+++ b/libs/gui/Android.mk
@@ -32,6 +32,10 @@ LOCAL_SHARED_LIBRARIES := \
LOCAL_MODULE:= libgui
+ifeq ($(TARGET_BOARD_PLATFORM), tegra)
+ LOCAL_CFLAGS += -DALLOW_DEQUEUE_CURRENT_BUFFER
+endif
+
include $(BUILD_SHARED_LIBRARY)
ifeq (,$(ONE_SHOT_MAKEFILE))
diff --git a/libs/gui/SurfaceTexture.cpp b/libs/gui/SurfaceTexture.cpp
index 6cd6dc5..ba7c35b 100644
--- a/libs/gui/SurfaceTexture.cpp
+++ b/libs/gui/SurfaceTexture.cpp
@@ -36,8 +36,12 @@
#include <utils/Log.h>
#include <utils/String8.h>
-
-#define ALLOW_DEQUEUE_CURRENT_BUFFER false
+#ifdef ALLOW_DEQUEUE_CURRENT_BUFFER
+#define FLAG_ALLOW_DEQUEUE_CURRENT_BUFFER true
+#warning "ALLOW_DEQUEUE_CURRENT_BUFFER enabled"
+#else
+#define FLAG_ALLOW_DEQUEUE_CURRENT_BUFFER false
+#endif
// Macros for including the SurfaceTexture name in log messages
#define ST_LOGV(x, ...) ALOGV("[%s] "x, mName.string(), ##__VA_ARGS__)
@@ -323,7 +327,7 @@ status_t SurfaceTexture::dequeueBuffer(int *outBuf, uint32_t w, uint32_t h,
LOGW_IF((state == BufferSlot::FREE) && (mCurrentTexture==i),
"dequeueBuffer: buffer %d is both FREE and current!", i);
- if (ALLOW_DEQUEUE_CURRENT_BUFFER) {
+ if (FLAG_ALLOW_DEQUEUE_CURRENT_BUFFER) {
if (state == BufferSlot::FREE || i == mCurrentTexture) {
foundSync = i;
if (i != mCurrentTexture) {