summaryrefslogtreecommitdiffstats
path: root/services/surfaceflinger/Layer.cpp
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2012-05-23 14:34:07 -0700
committerMathias Agopian <mathias@google.com>2012-05-23 18:01:14 -0700
commit419e196e639c8adb875da2765abcef95017b6d4a (patch)
treee63547ee4c2bd31b37fea0c47eace16c37b5cfff /services/surfaceflinger/Layer.cpp
parente10824965c64663b8878b808206ee382c7ab6af8 (diff)
downloadframeworks_native-419e196e639c8adb875da2765abcef95017b6d4a.zip
frameworks_native-419e196e639c8adb875da2765abcef95017b6d4a.tar.gz
frameworks_native-419e196e639c8adb875da2765abcef95017b6d4a.tar.bz2
Improve debug logs and minor clean-up
Bug: 6498869 Change-Id: I14d1b4d6960b87b5a7c4d7e20b92538edd9331ff
Diffstat (limited to 'services/surfaceflinger/Layer.cpp')
-rw-r--r--services/surfaceflinger/Layer.cpp77
1 files changed, 52 insertions, 25 deletions
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp
index 6ec4f49..fc7c767 100644
--- a/services/surfaceflinger/Layer.cpp
+++ b/services/surfaceflinger/Layer.cpp
@@ -434,26 +434,40 @@ uint32_t Layer::doTransaction(uint32_t flags)
if (sizeChanged) {
// the size changed, we need to ask our client to request a new buffer
ALOGD_IF(DEBUG_RESIZE,
- "doTransaction: "
- "geometry (layer=%p), size: current (%dx%d), drawing (%dx%d), "
- "crop: current (%d,%d,%d,%d [%dx%d]), drawing (%d,%d,%d,%d [%dx%d]), "
- "scalingMode=%d",
- this,
- int(temp.requested.w), int(temp.requested.h),
- int(front.requested.w), int(front.requested.h),
+ "doTransaction: geometry (layer=%p), scalingMode=%d\n"
+ " current={ active ={ wh={%4u,%4u} crop={%4d,%4d,%4d,%4d} (%4d,%4d) }\n"
+ " requested={ wh={%4u,%4u} crop={%4d,%4d,%4d,%4d} (%4d,%4d) }}\n"
+ " drawing={ active ={ wh={%4u,%4u} crop={%4d,%4d,%4d,%4d} (%4d,%4d) }\n"
+ " requested={ wh={%4u,%4u} crop={%4d,%4d,%4d,%4d} (%4d,%4d) }}\n",
+ this, mCurrentScalingMode,
+ temp.active.w, temp.active.h,
+ temp.active.crop.left,
+ temp.active.crop.top,
+ temp.active.crop.right,
+ temp.active.crop.bottom,
+ temp.active.crop.getWidth(),
+ temp.active.crop.getHeight(),
+ temp.requested.w, temp.requested.h,
temp.requested.crop.left,
temp.requested.crop.top,
temp.requested.crop.right,
temp.requested.crop.bottom,
temp.requested.crop.getWidth(),
temp.requested.crop.getHeight(),
+ front.active.w, front.active.h,
+ front.active.crop.left,
+ front.active.crop.top,
+ front.active.crop.right,
+ front.active.crop.bottom,
+ front.active.crop.getWidth(),
+ front.active.crop.getHeight(),
+ front.requested.w, front.requested.h,
front.requested.crop.left,
front.requested.crop.top,
front.requested.crop.right,
front.requested.crop.bottom,
front.requested.crop.getWidth(),
- front.requested.crop.getHeight(),
- mCurrentScalingMode);
+ front.requested.crop.getHeight());
if (!isFixedSize()) {
// this will make sure LayerBase::doTransaction doesn't update
@@ -580,28 +594,41 @@ void Layer::lockPageFlip(bool& recomputeVisibleRegions)
// Here we pretend the transaction happened by updating the
// current and drawing states. Drawing state is only accessed
// in this thread, no need to have it locked
- Layer::State& editDraw(mDrawingState);
- editDraw.active = editDraw.requested;
-
- // We also need to update the current state so that we don't
- // end-up doing too much work during the next transaction.
- // NOTE: We actually don't need hold the transaction lock here
- // because State::w and State::h are only accessed from
- // this thread
- Layer::State& editTemp(currentState());
- editTemp.active = editDraw.active;
+ Layer::State& editFront(mDrawingState);
+ editFront.active = front.requested;
+
+ // We also need to update the current state so that
+ // we don't end-up overwriting the drawing state with
+ // this stale current state during the next transaction
+ //
+ // NOTE: We don't need to hold the transaction lock here
+ // because State::active is only accessed from this thread.
+ Layer::State& editCurrent(currentState());
+ editCurrent.active = front.active;
// recompute visible region
recomputeVisibleRegions = true;
}
ALOGD_IF(DEBUG_RESIZE,
- "lockPageFlip : "
- " (layer=%p), buffer (%ux%u, tr=%02x), "
- "requested (%dx%d)",
- this,
- bufWidth, bufHeight, mCurrentTransform,
- front.requested.w, front.requested.h);
+ "lockPageFlip: (layer=%p), buffer (%ux%u, tr=%02x), scalingMode=%d\n"
+ " drawing={ active ={ wh={%4u,%4u} crop={%4d,%4d,%4d,%4d} (%4d,%4d) }\n"
+ " requested={ wh={%4u,%4u} crop={%4d,%4d,%4d,%4d} (%4d,%4d) }}\n",
+ this, bufWidth, bufHeight, mCurrentTransform, mCurrentScalingMode,
+ front.active.w, front.active.h,
+ front.active.crop.left,
+ front.active.crop.top,
+ front.active.crop.right,
+ front.active.crop.bottom,
+ front.active.crop.getWidth(),
+ front.active.crop.getHeight(),
+ front.requested.w, front.requested.h,
+ front.requested.crop.left,
+ front.requested.crop.top,
+ front.requested.crop.right,
+ front.requested.crop.bottom,
+ front.requested.crop.getWidth(),
+ front.requested.crop.getHeight());
}
}
}