author Mason Chang <mchang@mozilla.com>
Thu, 23 Oct 2014 10:16:47 -0700
changeset 236315 ccd53912eb4ce6cf469d6042b02f8090aecebee8
parent 236073 widget/shared/VsyncDispatcher.h@c4b63beb3d765a26fa4c75695f5c340fdc793daa
child 236378 3a72e359110a92cada24fe8d4620433a7e3786f9
permissions -rw-r--r--
Bug 1085696. Part 2 Move widget/shared to /widget. r=roc

/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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_widget_VsyncDispatcher_h
#define mozilla_widget_VsyncDispatcher_h

#include "nsISupportsImpl.h"

namespace mozilla {
class TimeStamp;

class VsyncObserver
  // The method called when a vsync occurs. Return true if some work was done.
  // Vsync notifications will occur on the hardware vsync thread
  virtual bool NotifyVsync(TimeStamp aVsyncTimestamp) = 0;

  virtual ~VsyncObserver() { }

// VsyncDispatcher is used to dispatch vsync events to the registered observers.
class VsyncDispatcher

  static VsyncDispatcher* GetInstance();

  // Compositor vsync observers must be added/removed on the compositor thread
  void AddCompositorVsyncObserver(VsyncObserver* aVsyncObserver);
  void RemoveCompositorVsyncObserver(VsyncObserver* aVsyncObserver);

  virtual ~VsyncDispatcher();

} // namespace mozilla

#endif // __mozilla_widget_VsyncDispatcher_h