Flutter Engine
embedder_external_texture_gl.h
Go to the documentation of this file.
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_SHELL_PLATFORM_EMBEDDER_EMBEDDER_EXTERNAL_TEXTURE_GL_H_
6 #define FLUTTER_SHELL_PLATFORM_EMBEDDER_EMBEDDER_EXTERNAL_TEXTURE_GL_H_
7 
8 #include "flutter/flow/texture.h"
9 #include "flutter/fml/macros.h"
10 #include "third_party/skia/include/core/SkImage.h"
11 #include "third_party/skia/include/core/SkSize.h"
12 
13 namespace flutter {
14 
16  public:
18  std::function<sk_sp<SkImage>(int64_t texture_identifier,
19  GrDirectContext*,
20  const SkISize&)>;
21 
22  EmbedderExternalTextureGL(int64_t texture_identifier,
23  const ExternalTextureCallback& callback);
24 
26 
27  private:
28  ExternalTextureCallback external_texture_callback_;
29  sk_sp<SkImage> last_image_;
30 
31  // |flutter::Texture|
32  void Paint(SkCanvas& canvas,
33  const SkRect& bounds,
34  bool freeze,
35  GrDirectContext* context,
36  SkFilterQuality filter_quality) override;
37 
38  // |flutter::Texture|
39  void OnGrContextCreated() override;
40 
41  // |flutter::Texture|
42  void OnGrContextDestroyed() override;
43 
44  // |flutter::Texture|
45  void MarkNewFrameAvailable() override;
46 
47  // |flutter::Texture|
48  void OnTextureUnregistered() override;
49 
50  FML_DISALLOW_COPY_AND_ASSIGN(EmbedderExternalTextureGL);
51 };
52 
53 } // namespace flutter
54 
55 #endif // FLUTTER_SHELL_PLATFORM_EMBEDDER_EMBEDDER_EXTERNAL_TEXTURE_GL_H_
EmbedderExternalTextureGL(int64_t texture_identifier, const ExternalTextureCallback &callback)
std::function< sk_sp< SkImage >(int64_t texture_identifier, GrDirectContext *, const SkISize &)> ExternalTextureCallback