コード例 #1
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();
    }
  }
}
コード例 #2
0
void
OverscrollHandoffChain::SnapBackOverscrolledApzc() const
{
  for (uint32_t 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;
    }
  }
}
コード例 #3
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
}
コード例 #4
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
}
コード例 #5
0
void
OverscrollHandoffChain::RequestSnapOnLock(Layer::ScrollDirection aAxis) const
{
  for (uint32_t i = 0; i < Length(); ++i) {
    AsyncPanZoomController* apzc = mChain[i];
    if (!apzc->IsDestroyed()) {
      switch (aAxis) {
      case Layer::HORIZONTAL:
        if (!apzc->CanScroll(Layer::VERTICAL)) {
          apzc->RequestSnap();
        }
        break;
      case Layer::VERTICAL:
        if (!apzc->CanScroll(Layer::HORIZONTAL)) {
          apzc->RequestSnap();
        }
        break;
      default:
        MOZ_ASSERT(false);
        break;
      }
    }
  }
}