summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJamie Gennis <jgennis@google.com>2012-05-10 02:22:33 -0700
committerJamie Gennis <jgennis@google.com>2012-05-10 15:35:22 -0700
commitcd1806e210f2633423f0fb14d39fa00d03974223 (patch)
treedf6a0af43fdda5c17eee343ef28bb7d117435a27
parent3c32e5da5b3f12bd498ae7016604b20ba61f5756 (diff)
downloadframeworks_native-cd1806e210f2633423f0fb14d39fa00d03974223.zip
frameworks_native-cd1806e210f2633423f0fb14d39fa00d03974223.tar.gz
frameworks_native-cd1806e210f2633423f0fb14d39fa00d03974223.tar.bz2
libgui: improve some logging and dumping
This change updates some of the SurfaceTextureClient and BufferQueue logging and dumping to include the crop, transform and scaling mode. It also removes the uses of the NO_SCALE_CROP scaling mode enum, which was added by accident in a previous change. Change-Id: I62912716a1e48885fb22f12b92678aa13f10fcd9 Bug: 6470541
-rw-r--r--libs/gui/BufferQueue.cpp21
-rw-r--r--libs/gui/SurfaceTextureClient.cpp9
2 files changed, 22 insertions, 8 deletions
diff --git a/libs/gui/BufferQueue.cpp b/libs/gui/BufferQueue.cpp
index e53162b..2d7c89b 100644
--- a/libs/gui/BufferQueue.cpp
+++ b/libs/gui/BufferQueue.cpp
@@ -72,6 +72,15 @@ static int32_t createProcessUniqueId() {
return android_atomic_inc(&globalCounter);
}
+static const char* scalingModeName(int scalingMode) {
+ switch (scalingMode) {
+ case NATIVE_WINDOW_SCALING_MODE_FREEZE: return "FREEZE";
+ case NATIVE_WINDOW_SCALING_MODE_SCALE_TO_WINDOW: return "SCALE_TO_WINDOW";
+ case NATIVE_WINDOW_SCALING_MODE_SCALE_CROP: return "SCALE_CROP";
+ default: return "Unknown";
+ }
+}
+
BufferQueue::BufferQueue( bool allowSynchronousMode, int bufferCount ) :
mDefaultWidth(1),
mDefaultHeight(1),
@@ -543,8 +552,10 @@ status_t BufferQueue::queueBuffer(int buf,
input.deflate(&timestamp, &crop, &scalingMode, &transform);
- ST_LOGV("queueBuffer: slot=%d time=%lld crop=[%d,%d,%d,%d]",
- buf, timestamp, crop.left, crop.top, crop.right, crop.bottom);
+ ST_LOGV("queueBuffer: slot=%d time=%#llx crop=[%d,%d,%d,%d] tr=%#x "
+ "scale=%s",
+ buf, timestamp, crop.left, crop.top, crop.right, crop.bottom,
+ transform, scalingModeName(scalingMode));
sp<ConsumerListener> listener;
@@ -611,7 +622,6 @@ status_t BufferQueue::queueBuffer(int buf,
case NATIVE_WINDOW_SCALING_MODE_FREEZE:
case NATIVE_WINDOW_SCALING_MODE_SCALE_TO_WINDOW:
case NATIVE_WINDOW_SCALING_MODE_SCALE_CROP:
- case NATIVE_WINDOW_SCALING_MODE_NO_SCALE_CROP:
break;
default:
ST_LOGE("unknown scaling mode: %d (ignoring)", scalingMode);
@@ -796,11 +806,12 @@ void BufferQueue::dump(String8& result, const char* prefix,
snprintf(buffer, SIZE,
"%s%s[%02d] "
"state=%-8s, crop=[%d,%d,%d,%d], "
- "transform=0x%02x, timestamp=%lld",
+ "xform=0x%02x, time=%#llx, scale=%s",
prefix, (slot.mBufferState == BufferSlot::ACQUIRED)?">":" ", i,
stateName(slot.mBufferState),
slot.mCrop.left, slot.mCrop.top, slot.mCrop.right,
- slot.mCrop.bottom, slot.mTransform, slot.mTimestamp
+ slot.mCrop.bottom, slot.mTransform, slot.mTimestamp,
+ scalingModeName(slot.mScalingMode)
);
result.append(buffer);
diff --git a/libs/gui/SurfaceTextureClient.cpp b/libs/gui/SurfaceTextureClient.cpp
index 9c3e28d..5d3bd1a 100644
--- a/libs/gui/SurfaceTextureClient.cpp
+++ b/libs/gui/SurfaceTextureClient.cpp
@@ -522,7 +522,6 @@ int SurfaceTextureClient::setUsage(uint32_t reqUsage)
int SurfaceTextureClient::setCrop(Rect const* rect)
{
ATRACE_CALL();
- ALOGV("SurfaceTextureClient::setCrop");
Rect realRect;
if (rect == NULL || rect->isEmpty()) {
@@ -531,6 +530,9 @@ int SurfaceTextureClient::setCrop(Rect const* rect)
realRect = *rect;
}
+ ALOGV("SurfaceTextureClient::setCrop rect=[%d %d %d %d]",
+ realRect.left, realRect.top, realRect.right, realRect.bottom);
+
Mutex::Autolock lock(mMutex);
mCrop = realRect;
mCropNeedsTransform = false;
@@ -540,7 +542,6 @@ int SurfaceTextureClient::setCrop(Rect const* rect)
int SurfaceTextureClient::setPostTransformCrop(Rect const* rect)
{
ATRACE_CALL();
- ALOGV("SurfaceTextureClient::setPostTransformCrop");
Rect realRect;
if (rect == NULL || rect->isEmpty()) {
@@ -549,6 +550,9 @@ int SurfaceTextureClient::setPostTransformCrop(Rect const* rect)
realRect = *rect;
}
+ ALOGV("SurfaceTextureClient::setPostTransformCrop rect=[%d %d %d %d]",
+ realRect.left, realRect.top, realRect.right, realRect.bottom);
+
Mutex::Autolock lock(mMutex);
mCrop = realRect;
mCropNeedsTransform = true;
@@ -627,7 +631,6 @@ int SurfaceTextureClient::setScalingMode(int mode)
case NATIVE_WINDOW_SCALING_MODE_FREEZE:
case NATIVE_WINDOW_SCALING_MODE_SCALE_TO_WINDOW:
case NATIVE_WINDOW_SCALING_MODE_SCALE_CROP:
- case NATIVE_WINDOW_SCALING_MODE_NO_SCALE_CROP:
break;
default:
ALOGE("unknown scaling mode: %d", mode);