OMTAController.h (1280B)
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_layers_OMTAController_h 8 #define mozilla_layers_OMTAController_h 9 10 #include <unordered_map> 11 12 #include "mozilla/layers/LayersTypes.h" // for LayersId 13 #include "nsISerialEventTarget.h" 14 #include "nsISupportsImpl.h" 15 #include "nsTArrayForwardDeclare.h" 16 17 namespace mozilla { 18 namespace layers { 19 20 /** 21 * This class just delegates the jank animations notification to the compositor 22 * thread from the sampler thread. 23 */ 24 class OMTAController final { 25 NS_INLINE_DECL_THREADSAFE_REFCOUNTING(OMTAController) 26 27 public: 28 explicit OMTAController(LayersId aRootLayersId) 29 : mRootLayersId(aRootLayersId) {} 30 31 using JankedAnimations = 32 std::unordered_map<LayersId, nsTArray<uint64_t>, LayersId::HashFn>; 33 void NotifyJankedAnimations(JankedAnimations&& aJankedAnimations) const; 34 35 private: 36 ~OMTAController() = default; 37 38 LayersId mRootLayersId; 39 }; 40 41 } // namespace layers 42 } // namespace mozilla 43 44 #endif // mozilla_layers_OMTAController_h