コード例 #1
0
void
OverscrollHandoffChain::SnapBackOverscrolledApzc() const
{
  uint32_t i = 0;
  for (i = 0; i < Length(); ++i) {
    AsyncPanZoomController* apzc = mChain[i];
    if (!apzc->IsDestroyed() && apzc->SnapBackIfOverscrolled()) {
      // At most one APZC along the hand-off chain can be overscrolled.
      break;
    }
  }

  // In debug builds, verify our assumption that only one APZC is overscrolled.
#ifdef DEBUG
  ++i;
  for (; i < Length(); ++i) {
    AsyncPanZoomController* apzc = mChain[i];
    if (!apzc->IsDestroyed()) {
      MOZ_ASSERT(!apzc->IsOverscrolled());
    }
  }
#endif
}
コード例 #2
0
void
OverscrollHandoffChain::SnapBackOverscrolledApzc(const AsyncPanZoomController* aStart) const
{
  uint32_t i = IndexOf(aStart);
  for (; i < Length(); ++i) {
    AsyncPanZoomController* apzc = mChain[i];
    if (!apzc->IsDestroyed() && apzc->SnapBackIfOverscrolled()) {
      // At most one APZC from |aStart| onwards can be overscrolled.
      break;
    }
  }

  // In debug builds, verify our assumption that only one APZC from |aStart|
  // onwards is overscrolled.
#ifdef DEBUG
  ++i;
  for (; i < Length(); ++i) {
    AsyncPanZoomController* apzc = mChain[i];
    if (!apzc->IsDestroyed()) {
      MOZ_ASSERT(!apzc->IsOverscrolled());
    }
  }
#endif
}