am 419e196e: Improve debug logs and minor clean-up

* commit '419e196e639c8adb875da2765abcef95017b6d4a':
  Improve debug logs and minor clean-up
This commit is contained in:
Mathias Agopian 2012-05-29 19:50:54 -07:00 committed by Android Git Automerger
commit b18d747ef6

View File

@ -434,26 +434,40 @@ uint32_t Layer::doTransaction(uint32_t flags)
if (sizeChanged) { if (sizeChanged) {
// the size changed, we need to ask our client to request a new buffer // the size changed, we need to ask our client to request a new buffer
ALOGD_IF(DEBUG_RESIZE, ALOGD_IF(DEBUG_RESIZE,
"doTransaction: " "doTransaction: geometry (layer=%p), scalingMode=%d\n"
"geometry (layer=%p), size: current (%dx%d), drawing (%dx%d), " " current={ active ={ wh={%4u,%4u} crop={%4d,%4d,%4d,%4d} (%4d,%4d) }\n"
"crop: current (%d,%d,%d,%d [%dx%d]), drawing (%d,%d,%d,%d [%dx%d]), " " requested={ wh={%4u,%4u} crop={%4d,%4d,%4d,%4d} (%4d,%4d) }}\n"
"scalingMode=%d", " drawing={ active ={ wh={%4u,%4u} crop={%4d,%4d,%4d,%4d} (%4d,%4d) }\n"
this, " requested={ wh={%4u,%4u} crop={%4d,%4d,%4d,%4d} (%4d,%4d) }}\n",
int(temp.requested.w), int(temp.requested.h), this, mCurrentScalingMode,
int(front.requested.w), int(front.requested.h), 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.left,
temp.requested.crop.top, temp.requested.crop.top,
temp.requested.crop.right, temp.requested.crop.right,
temp.requested.crop.bottom, temp.requested.crop.bottom,
temp.requested.crop.getWidth(), temp.requested.crop.getWidth(),
temp.requested.crop.getHeight(), 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.left,
front.requested.crop.top, front.requested.crop.top,
front.requested.crop.right, front.requested.crop.right,
front.requested.crop.bottom, front.requested.crop.bottom,
front.requested.crop.getWidth(), front.requested.crop.getWidth(),
front.requested.crop.getHeight(), front.requested.crop.getHeight());
mCurrentScalingMode);
if (!isFixedSize()) { if (!isFixedSize()) {
// this will make sure LayerBase::doTransaction doesn't update // 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 // Here we pretend the transaction happened by updating the
// current and drawing states. Drawing state is only accessed // current and drawing states. Drawing state is only accessed
// in this thread, no need to have it locked // in this thread, no need to have it locked
Layer::State& editDraw(mDrawingState); Layer::State& editFront(mDrawingState);
editDraw.active = editDraw.requested; editFront.active = front.requested;
// We also need to update the current state so that we don't // We also need to update the current state so that
// end-up doing too much work during the next transaction. // we don't end-up overwriting the drawing state with
// NOTE: We actually don't need hold the transaction lock here // this stale current state during the next transaction
// because State::w and State::h are only accessed from //
// this thread // NOTE: We don't need to hold the transaction lock here
Layer::State& editTemp(currentState()); // because State::active is only accessed from this thread.
editTemp.active = editDraw.active; Layer::State& editCurrent(currentState());
editCurrent.active = front.active;
// recompute visible region // recompute visible region
recomputeVisibleRegions = true; recomputeVisibleRegions = true;
} }
ALOGD_IF(DEBUG_RESIZE, ALOGD_IF(DEBUG_RESIZE,
"lockPageFlip : " "lockPageFlip: (layer=%p), buffer (%ux%u, tr=%02x), scalingMode=%d\n"
" (layer=%p), buffer (%ux%u, tr=%02x), " " drawing={ active ={ wh={%4u,%4u} crop={%4d,%4d,%4d,%4d} (%4d,%4d) }\n"
"requested (%dx%d)", " requested={ wh={%4u,%4u} crop={%4d,%4d,%4d,%4d} (%4d,%4d) }}\n",
this, this, bufWidth, bufHeight, mCurrentTransform, mCurrentScalingMode,
bufWidth, bufHeight, mCurrentTransform, front.active.w, front.active.h,
front.requested.w, front.requested.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());
} }
} }
} }