CompositorWidgetVsyncObserver.h (1270B)
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */ 3 /* This Source Code Form is subject to the terms of the Mozilla Public 4 * License, v. 2.0. If a copy of the MPL was not distributed with this 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 6 7 #ifndef mozilla_gfx_ipc_CompositorWidgetVsyncObserver_h 8 #define mozilla_gfx_ipc_CompositorWidgetVsyncObserver_h 9 10 #include "mozilla/layers/LayersTypes.h" 11 #include "mozilla/VsyncDispatcher.h" 12 13 namespace mozilla { 14 namespace gfx { 15 class VsyncBridgeChild; 16 } // namespace gfx 17 18 namespace widget { 19 20 class CompositorWidgetVsyncObserver : public VsyncObserver { 21 typedef gfx::VsyncBridgeChild VsyncBridgeChild; 22 23 NS_INLINE_DECL_THREADSAFE_REFCOUNTING(CompositorWidgetVsyncObserver, override) 24 25 public: 26 CompositorWidgetVsyncObserver(RefPtr<VsyncBridgeChild> aVsyncBridge, 27 const layers::LayersId& aRootLayerTreeId); 28 29 void NotifyVsync(const VsyncEvent& aVsync) override; 30 31 private: 32 ~CompositorWidgetVsyncObserver() override; 33 34 RefPtr<VsyncBridgeChild> mVsyncBridge; 35 layers::LayersId mRootLayerTreeId; 36 }; 37 38 } // namespace widget 39 } // namespace mozilla 40 41 #endif // mozilla_gfx_ipc_CompositorWidgetVsyncObserver_h