External texture peered to a sequence of android.hardware.HardwareBuffers. More...
#include <image_external_texture.h>
Public Types | |
| enum class | ImageLifecycle { kReset , kKeepAlive } |
| Whether the last image should be reset when the context is destroyed. More... | |
Public Member Functions | |
| ImageExternalTexture (int64_t id, const fml::jni::ScopedJavaGlobalRef< jobject > &image_texture_entry, const std::shared_ptr< PlatformViewAndroidJNI > &jni_facade, ImageLifecycle lifecycle) | |
| virtual | ~ImageExternalTexture () |
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 () | |
Protected Types | |
| enum class | AttachmentState { kUninitialized , kAttached , kDetached } |
Protected Member Functions | |
| virtual void | ProcessFrame (PaintContext &context, const SkRect &bounds)=0 |
| Subclasses override this method to bind the latest representation of the hardware buffer wrapped by this texture instance to their own graphics package specific texture classes (SkImage, impeller::Texture, etc...). | |
| virtual void | Attach (PaintContext &context)=0 |
| virtual void | Detach ()=0 |
| JavaLocalRef | AcquireLatestImage () |
| void | CloseImage (const fml::jni::JavaRef< jobject > &image) |
| JavaLocalRef | HardwareBufferFor (const fml::jni::JavaRef< jobject > &image) |
| void | CloseHardwareBuffer (const fml::jni::JavaRef< jobject > &hardware_buffer) |
| AHardwareBuffer * | AHardwareBufferFor (const fml::jni::JavaRef< jobject > &hardware_buffer) |
Protected Attributes | |
| fml::jni::ScopedJavaGlobalRef< jobject > | image_texture_entry_ |
| std::shared_ptr< PlatformViewAndroidJNI > | jni_facade_ |
| AttachmentState | state_ = AttachmentState::kUninitialized |
| sk_sp< flutter::DlImage > | dl_image_ |
| ImageLRU | image_lru_ = ImageLRU() |
External texture peered to a sequence of android.hardware.HardwareBuffers.
Android Hardware Buffers are available on newer versions of Android (API 29 and above).
This is an abstract base class and graphics packages provide concrete implementations of this class that bind hardware buffers to their own package-specific implementations of textures (SkImages, impeller::Texture, etc...).
Android Hardware Buffers allow binding to both OpenGL and Vulkan client-rendering APIs in a zero copy manner. Because of this graphics packages that support OpenGL and Vulkan can have multiple subclasses for each supported client-rendering API.
Definition at line 36 of file image_external_texture.h.
|
strongprotected |
| Enumerator | |
|---|---|
| kUninitialized | |
| kAttached | |
| kDetached | |
Definition at line 83 of file image_external_texture.h.
|
strong |
Whether the last image should be reset when the context is destroyed.
| Enumerator | |
|---|---|
| kReset | |
| kKeepAlive | |
Definition at line 39 of file image_external_texture.h.
|
explicit |
Definition at line 16 of file image_external_texture.cc.
|
virtualdefault |
|
protected |
Definition at line 89 of file image_external_texture.cc.
References fml::jni::AttachCurrentThread(), FML_CHECK, image_texture_entry_, and jni_facade_.
Referenced by flutter::ImageExternalTextureGL::ProcessFrame().
|
protected |
Definition at line 124 of file image_external_texture.cc.
References fml::jni::AttachCurrentThread(), FML_CHECK, impeller::android::GetProcTable(), and fml::jni::JavaRef< T >::obj().
Referenced by flutter::ImageExternalTextureGL::UpdateImage().
|
protectedpure virtual |
Implemented in flutter::ImageExternalTextureGL.
|
protected |
Definition at line 107 of file image_external_texture.cc.
References jni_facade_, and fml::jni::JavaRef< T >::obj().
Referenced by flutter::ImageExternalTextureGL::ProcessFrame().
|
protected |
Definition at line 100 of file image_external_texture.cc.
References image, and jni_facade_.
|
protectedpure virtual |
Implemented in flutter::ImageExternalTextureGL.
|
protected |
Definition at line 115 of file image_external_texture.cc.
References image, and jni_facade_.
Referenced by flutter::ImageExternalTextureGL::ProcessFrame().
|
protectedpure virtual |
Subclasses override this method to bind the latest representation of the hardware buffer wrapped by this texture instance to their own graphics package specific texture classes (SkImage, impeller::Texture, etc...).
After a call to this method, attachment state of this instance must be kAttached. That is the responsibility of the subclass.
| context | The context | |
| [in] | bounds | The bounds |
Implemented in flutter::ImageExternalTextureGL.
|
protected |
Definition at line 85 of file image_external_texture.h.
Referenced by flutter::ImageExternalTextureGL::UpdateImage().
Definition at line 86 of file image_external_texture.h.
Referenced by flutter::ImageExternalTextureGL::Detach(), and flutter::ImageExternalTextureGL::UpdateImage().
|
protected |
Definition at line 80 of file image_external_texture.h.
Referenced by AcquireLatestImage().
|
protected |
Definition at line 81 of file image_external_texture.h.
Referenced by AcquireLatestImage(), CloseHardwareBuffer(), CloseImage(), and HardwareBufferFor().
|
protected |
Definition at line 84 of file image_external_texture.h.
Referenced by flutter::ImageExternalTextureGL::Attach().