gfx/layers/apz/src/AutoscrollAnimation.h
author Botond Ballo <botond@mozilla.com>
Fri, 28 Jul 2017 15:04:00 -0400
changeset 420741 6b28c83f4ef4af43076a93e177aabc2d412c3c4c
child 421866 7e558ba2e9a6d5b17b593b0dc9daa69df0dff23a
permissions -rw-r--r--
Bug 1105109 - Add autoscrolling support to AsyncPanZoomController. r=kats This involves adding a new type of AsyncPanZoomAnimation, a new APZC state, and methods to start and stop autoscrolling. MozReview-Commit-ID: BEYPJIR30Lw

/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set sw=2 ts=8 et tw=80 : */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_layers_AutocrollAnimation_h_
#define mozilla_layers_AutocrollAnimation_h_

#include "AsyncPanZoomAnimation.h"

namespace mozilla {
namespace layers {

class AsyncPanZoomController;

class AutoscrollAnimation : public AsyncPanZoomAnimation
{
public:
  AutoscrollAnimation(AsyncPanZoomController& aApzc,
                      const ScreenPoint& aAnchorLocation);

  bool DoSample(FrameMetrics& aFrameMetrics, const TimeDuration& aDelta) override;

private:
  AsyncPanZoomController& mApzc;
  ScreenPoint mAnchorLocation;
};

} // namespace layers
} // namespace mozilla

#endif // mozilla_layers_AutoscrollAnimation_h_