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/common/graphics/texture.h"
9 #include "flutter/fml/macros.h"
10 #include "flutter/shell/platform/embedder/embedder.h"
11 #include "third_party/skia/include/core/SkImage.h"
12 #include "third_party/skia/include/core/SkSize.h"
13 
14 namespace flutter {
15 
17  public:
19  std::unique_ptr<FlutterOpenGLTexture>(int64_t, size_t, size_t)>;
20 
21  EmbedderExternalTextureGL(int64_t texture_identifier,
23 
25 
26  private:
27  const ExternalTextureCallback& external_texture_callback_;
28  sk_sp<SkImage> last_image_;
29 
30  sk_sp<SkImage> ResolveTexture(int64_t texture_id,
31  GrDirectContext* context,
32  const SkISize& size);
33 
34  // |flutter::Texture|
35  void Paint(SkCanvas& canvas,
36  const SkRect& bounds,
37  bool freeze,
38  GrDirectContext* context,
39  const SkSamplingOptions& sampling) override;
40 
41  // |flutter::Texture|
42  void OnGrContextCreated() override;
43 
44  // |flutter::Texture|
45  void OnGrContextDestroyed() override;
46 
47  // |flutter::Texture|
48  void MarkNewFrameAvailable() override;
49 
50  // |flutter::Texture|
51  void OnTextureUnregistered() override;
52 
53  FML_DISALLOW_COPY_AND_ASSIGN(EmbedderExternalTextureGL);
54 };
55 
56 } // namespace flutter
57 
58 #endif // FLUTTER_SHELL_PLATFORM_EMBEDDER_EMBEDDER_EXTERNAL_TEXTURE_GL_H_
Dart_NativeFunction function
Definition: fuchsia.cc:51
int64_t texture_id
constexpr std::size_t size(T(&array)[N])
Definition: size.h:13
FlKeyEvent FlKeyResponderAsyncCallback callback
EmbedderExternalTextureGL(int64_t texture_identifier, const ExternalTextureCallback &callback)
std::function< std::unique_ptr< FlutterOpenGLTexture >(int64_t, size_t, size_t)> ExternalTextureCallback