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_CODEC_H_
6#define FLUTTER_LIB_UI_PAINTING_CODEC_H_
7
8#include "flutter/lib/ui/dart_wrapper.h"
9#include "flutter/lib/ui/painting/frame_info.h"
10#include "third_party/skia/include/codec/SkCodec.h"
11#include "third_party/skia/include/core/SkBitmap.h"
12#include "third_party/skia/include/core/SkImage.h"
13
14using tonic::DartPersistentValue;
15
16namespace tonic {
17class DartLibraryNatives;
18} // namespace tonic
19
20namespace flutter {
21
22// A handle to an SkCodec object.
23//
24// Doesn't mirror SkCodec's API but provides a simple sequential access API.
25class Codec : public RefCountedDartWrappable<Codec> {
26 DEFINE_WRAPPERTYPEINFO();
27
28 public:
29 virtual int frameCount() const = 0;
30
31 virtual int repetitionCount() const = 0;
32
33 virtual Dart_Handle getNextFrame(Dart_Handle callback_handle) = 0;
34
35 void dispose();
36
37 static void RegisterNatives(tonic::DartLibraryNatives* natives);
38};
39
40} // namespace flutter
41
42#endif // FLUTTER_LIB_UI_PAINTING_CODEC_H_
43