Flutter Engine
 
Loading...
Searching...
No Matches
flutter::SurfaceTextureExternalTextureVKImpeller Class Referencefinal

An external texture implementation for Vulkan that uses OpenGL to Vulkan texture interop to read SurfaceTexture based image data and render it into a Vulkan texture. More...

#include <surface_texture_external_texture_vk_impeller.h>

Inheritance diagram for flutter::SurfaceTextureExternalTextureVKImpeller:
flutter::SurfaceTextureExternalTexture flutter::Texture flutter::ContextListener

Public Member Functions

 SurfaceTextureExternalTextureVKImpeller (std::shared_ptr< impeller::ContextVK > context, int64_t id, const fml::jni::ScopedJavaGlobalRef< jobject > &surface_texture, const std::shared_ptr< PlatformViewAndroidJNI > &jni_facade)
 
 ~SurfaceTextureExternalTextureVKImpeller () override
 
 SurfaceTextureExternalTextureVKImpeller (const SurfaceTextureExternalTextureVKImpeller &)=delete
 
SurfaceTextureExternalTextureVKImpelleroperator= (const SurfaceTextureExternalTextureVKImpeller &)=delete
 
- Public Member Functions inherited from flutter::SurfaceTextureExternalTexture
 SurfaceTextureExternalTexture (int64_t id, const fml::jni::ScopedJavaGlobalRef< jobject > &surface_texture, const std::shared_ptr< PlatformViewAndroidJNI > &jni_facade)
 
 ~SurfaceTextureExternalTexture () override
 
- Public Member Functions inherited from flutter::Texture
 Texture (int64_t id)
 
virtual ~Texture ()
 
int64_t Id ()
 
- Public Member Functions inherited from flutter::ContextListener
 ContextListener ()
 
 ~ContextListener ()
 

Additional Inherited Members

- Protected Types inherited from flutter::SurfaceTextureExternalTexture
enum class  AttachmentState {
  kUninitialized ,
  kAttached ,
  kDetached
}
 Specifies how this instance is bound to the underlying surface texture. More...
 
- Protected Member Functions inherited from flutter::SurfaceTextureExternalTexture
const SkM44 & GetCurrentUVTransformation () const
 Get the transformation that should be applied to the UV texture coordinates when sampling from this texture.
 
void Attach (int gl_tex_id)
 Attaches the given OpenGL texture handle to the surface texture via a bind operation.
 
bool ShouldUpdate ()
 
void Update ()
 Update the surface texture contents and transformation matrix.
 
- Protected Attributes inherited from flutter::SurfaceTextureExternalTexture
std::shared_ptr< PlatformViewAndroidJNIjni_facade_
 
fml::jni::ScopedJavaGlobalRef< jobject > surface_texture_
 
AttachmentState state_ = AttachmentState::kUninitialized
 
sk_sp< flutter::DlImagedl_image_
 

Detailed Description

An external texture implementation for Vulkan that uses OpenGL to Vulkan texture interop to read SurfaceTexture based image data and render it into a Vulkan texture.

Unlike other zero-copy implementations, the OpenGL to Vulkan texture interop has the additional overhead of one device-device copy and allocates one offscreen texture. For this reason, one of the "Image" based external texture implementations are a recommended replacement for this class. For example ImageExternalTextureVKImpeller.

This implementation is used only as a fallback during the migration away from the SurfaceTexture based plugin APIs. For more information about the plugin API migration, see https://docs.flutter.dev/release/breaking-changes/android-surface-plugins.

See also
ImageExternalTextureVKImpeller

Definition at line 39 of file surface_texture_external_texture_vk_impeller.h.

Constructor & Destructor Documentation

◆ SurfaceTextureExternalTextureVKImpeller() [1/2]

flutter::SurfaceTextureExternalTextureVKImpeller::SurfaceTextureExternalTextureVKImpeller ( std::shared_ptr< impeller::ContextVK context,
int64_t  id,
const fml::jni::ScopedJavaGlobalRef< jobject > &  surface_texture,
const std::shared_ptr< PlatformViewAndroidJNI > &  jni_facade 
)

Definition at line 24 of file surface_texture_external_texture_vk_impeller.cc.

30 : SurfaceTextureExternalTexture(id, surface_texture, jni_facade),
31 context_(std::move(context)),
32 trampoline_(std::make_shared<glvk::Trampoline>()) {
33 is_valid_ = trampoline_->IsValid();
34}
SurfaceTextureExternalTexture(int64_t id, const fml::jni::ScopedJavaGlobalRef< jobject > &surface_texture, const std::shared_ptr< PlatformViewAndroidJNI > &jni_facade)

◆ ~SurfaceTextureExternalTextureVKImpeller()

flutter::SurfaceTextureExternalTextureVKImpeller::~SurfaceTextureExternalTextureVKImpeller ( )
overridedefault

◆ SurfaceTextureExternalTextureVKImpeller() [2/2]

flutter::SurfaceTextureExternalTextureVKImpeller::SurfaceTextureExternalTextureVKImpeller ( const SurfaceTextureExternalTextureVKImpeller )
delete

Member Function Documentation

◆ operator=()

SurfaceTextureExternalTextureVKImpeller & flutter::SurfaceTextureExternalTextureVKImpeller::operator= ( const SurfaceTextureExternalTextureVKImpeller )
delete

The documentation for this class was generated from the following files: