Flutter Engine
 
Loading...
Searching...
No Matches
surface_texture_external_texture_vk_impeller.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_ANDROID_SURFACE_TEXTURE_EXTERNAL_TEXTURE_VK_IMPELLER_H_
6#define FLUTTER_SHELL_PLATFORM_ANDROID_SURFACE_TEXTURE_EXTERNAL_TEXTURE_VK_IMPELLER_H_
7
8#include <memory>
9
17
18namespace flutter {
19
20//------------------------------------------------------------------------------
21/// @brief An external texture implementation for Vulkan that uses OpenGL
22/// to Vulkan texture interop to read SurfaceTexture based image
23/// data and render it into a Vulkan texture.
24///
25/// Unlike other zero-copy implementations, the OpenGL to Vulkan
26/// texture interop has the additional overhead of one device-device
27/// copy and allocates one offscreen texture. For this reason, one
28/// of the "Image" based external texture implementations are a
29/// recommended replacement for this class. For example
30/// `ImageExternalTextureVKImpeller`.
31///
32/// This implementation is used only as a fallback during the
33/// migration away from the SurfaceTexture based plugin APIs. For
34/// more information about the plugin API migration, see
35/// https://docs.flutter.dev/release/breaking-changes/android-surface-plugins.
36///
37/// @see `ImageExternalTextureVKImpeller`
38///
41 public:
43 std::shared_ptr<impeller::ContextVK> context,
44 int64_t id,
45 const fml::jni::ScopedJavaGlobalRef<jobject>& surface_texture,
46 const std::shared_ptr<PlatformViewAndroidJNI>& jni_facade);
47
49
52
55
56 private:
57 std::shared_ptr<impeller::ContextVK> context_;
58 std::shared_ptr<impeller::glvk::Trampoline> trampoline_;
59 std::shared_ptr<impeller::AHBTextureSourceVK> cached_texture_source_;
60 bool is_valid_ = false;
61
62 // |SurfaceTextureExternalTexture|
63 void ProcessFrame(PaintContext& context, const SkRect& bounds) override;
64
65 // |SurfaceTextureExternalTexture|
66 void Detach() override;
67
68 // |SurfaceTextureExternalTexture|
69 void DrawFrame(PaintContext& context,
70 const SkRect& bounds,
71 const DlImageSampling sampling) const override;
72
73 std::shared_ptr<impeller::AHBTextureSourceVK> GetCachedTextureSource(
74 const std::shared_ptr<impeller::Context>& context,
75 const impeller::ISize& size);
76};
77
78} // namespace flutter
79
80#endif // FLUTTER_SHELL_PLATFORM_ANDROID_SURFACE_TEXTURE_EXTERNAL_TEXTURE_VK_IMPELLER_H_
Instances of external textures peered to android.graphics.SurfaceTexture.
An external texture implementation for Vulkan that uses OpenGL to Vulkan texture interop to read Surf...
SurfaceTextureExternalTextureVKImpeller & operator=(const SurfaceTextureExternalTextureVKImpeller &)=delete
SurfaceTextureExternalTextureVKImpeller(const SurfaceTextureExternalTextureVKImpeller &)=delete
it will be possible to load the file into Perfetto s trace viewer use test Running tests that layout and measure text will not yield consistent results across various platforms Enabling this option will make font resolution default to the Ahem test font on all disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size