• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef FLUTTER_LIB_UI_PAINTING_FRAME_INFO_H_
6 #define FLUTTER_LIB_UI_PAINTING_FRAME_INFO_H_
7 
8 #include "flutter/lib/ui/dart_wrapper.h"
9 #include "flutter/lib/ui/painting/image.h"
10 
11 namespace flutter {
12 
13 // A single animation frame.
14 class FrameInfo final : public RefCountedDartWrappable<FrameInfo> {
15   DEFINE_WRAPPERTYPEINFO();
16 
17  public:
durationMillis()18   int durationMillis() { return durationMillis_; }
image()19   fml::RefPtr<CanvasImage> image() { return image_; }
20 
21   static void RegisterNatives(tonic::DartLibraryNatives* natives);
22 
23  private:
24   FrameInfo(fml::RefPtr<CanvasImage> image, int durationMillis);
25 
26   ~FrameInfo() override;
27 
28   const fml::RefPtr<CanvasImage> image_;
29   const int durationMillis_;
30 
31   FML_FRIEND_MAKE_REF_COUNTED(FrameInfo);
32   FML_FRIEND_REF_COUNTED_THREAD_SAFE(FrameInfo);
33 };
34 
35 }  // namespace flutter
36 
37 #endif  // FLUTTER_LIB_UI_PAINTING_FRAME_INFO_H_
38