Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | List of all members
flutter::ImageExternalTextureGLImpeller Class Reference

#include <image_external_texture_gl.h>

Inheritance diagram for flutter::ImageExternalTextureGLImpeller:
flutter::ImageExternalTextureGL flutter::ImageExternalTexture flutter::Texture flutter::ContextListener

Public Member Functions

 ImageExternalTextureGLImpeller (const std::shared_ptr< impeller::ContextGLES > &context, int64_t id, const fml::jni::ScopedJavaGlobalRef< jobject > &hardware_buffer_texture_entry, const std::shared_ptr< PlatformViewAndroidJNI > &jni_facade)
 
- Public Member Functions inherited from flutter::ImageExternalTextureGL
 ImageExternalTextureGL (int64_t id, const fml::jni::ScopedJavaGlobalRef< jobject > &image_textury_entry, const std::shared_ptr< PlatformViewAndroidJNI > &jni_facade)
 
- Public Member Functions inherited from flutter::ImageExternalTexture
 ImageExternalTexture (int64_t id, const fml::jni::ScopedJavaGlobalRef< jobject > &image_texture_entry, const std::shared_ptr< PlatformViewAndroidJNI > &jni_facade)
 
virtual ~ImageExternalTexture ()=default
 
void Paint (PaintContext &context, const SkRect &bounds, bool freeze, const DlImageSampling sampling) override
 
void MarkNewFrameAvailable () override
 
void OnTextureUnregistered () override
 
void OnGrContextCreated () override
 
void OnGrContextDestroyed () 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 ()
 

Private Member Functions

void Attach (PaintContext &context) override
 
void Detach () override
 
sk_sp< flutter::DlImageCreateDlImage (PaintContext &context, const SkRect &bounds, std::optional< HardwareBufferKey > id, impeller::UniqueEGLImageKHR &&egl_image) override
 

Additional Inherited Members

- Protected Types inherited from flutter::ImageExternalTexture
enum class  AttachmentState { kUninitialized , kAttached , kDetached }
 
- Protected Member Functions inherited from flutter::ImageExternalTextureGL
void ProcessFrame (PaintContext &context, const SkRect &bounds) override
 
void UpdateImage (JavaLocalRef &hardware_buffer, const SkRect &bounds, PaintContext &context)
 
impeller::UniqueEGLImageKHR CreateEGLImage (AHardwareBuffer *buffer)
 
 FML_DISALLOW_COPY_AND_ASSIGN (ImageExternalTextureGL)
 
- Protected Member Functions inherited from flutter::ImageExternalTexture
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)
 
AHardwareBufferAHardwareBufferFor (const fml::jni::JavaRef< jobject > &hardware_buffer)
 
 FML_DISALLOW_COPY_AND_ASSIGN (ImageExternalTexture)
 
- Protected Attributes inherited from flutter::ImageExternalTextureGL
std::unordered_map< HardwareBufferKey, GlEntrygl_entries_
 
- Protected Attributes inherited from flutter::ImageExternalTexture
fml::jni::ScopedJavaGlobalRef< jobject > image_texture_entry_
 
std::shared_ptr< PlatformViewAndroidJNIjni_facade_
 
AttachmentState state_ = AttachmentState::kUninitialized
 
sk_sp< flutter::DlImagedl_image_
 
ImageLRU image_lru_ = ImageLRU()
 

Detailed Description

Definition at line 82 of file image_external_texture_gl.h.

Constructor & Destructor Documentation

◆ ImageExternalTextureGLImpeller()

flutter::ImageExternalTextureGLImpeller::ImageExternalTextureGLImpeller ( const std::shared_ptr< impeller::ContextGLES > &  context,
int64_t  id,
const fml::jni::ScopedJavaGlobalRef< jobject > &  hardware_buffer_texture_entry,
const std::shared_ptr< PlatformViewAndroidJNI > &  jni_facade 
)

Definition at line 164 of file image_external_texture_gl.cc.

169 : ImageExternalTextureGL(id, image_textury_entry, jni_facade),
170 impeller_context_(context) {}
ImageExternalTextureGL(int64_t id, const fml::jni::ScopedJavaGlobalRef< jobject > &image_textury_entry, const std::shared_ptr< PlatformViewAndroidJNI > &jni_facade)

Member Function Documentation

◆ Attach()

void flutter::ImageExternalTextureGLImpeller::Attach ( PaintContext context)
overrideprivatevirtual

◆ CreateDlImage()

sk_sp< flutter::DlImage > flutter::ImageExternalTextureGLImpeller::CreateDlImage ( PaintContext context,
const SkRect bounds,
std::optional< HardwareBufferKey id,
impeller::UniqueEGLImageKHR &&  egl_image 
)
overrideprivatevirtual

Implements flutter::ImageExternalTextureGL.

Definition at line 180 of file image_external_texture_gl.cc.

184 {
189 desc.size = {static_cast<int>(bounds.width()),
190 static_cast<int>(bounds.height())};
191 desc.mip_count = 1;
192 auto texture = std::make_shared<impeller::TextureGLES>(
193 impeller_context_->GetReactor(), desc,
195 texture->SetCoordinateSystem(
197 if (!texture->Bind()) {
198 return nullptr;
199 }
200 // Associate the hardware buffer image with the texture.
201 glEGLImageTargetTexture2DOES(GL_TEXTURE_EXTERNAL_OES,
202 (GLeglImageOES)egl_image.get().image);
203 gl_entries_[id.value_or(0)] = GlEntry{
204 .egl_image = std::move(egl_image),
205 };
207}
std::unordered_map< HardwareBufferKey, GlEntry > gl_entries_
const T & get() const
static sk_sp< DlImageImpeller > Make(std::shared_ptr< Texture > texture, OwningContext owning_context=OwningContext::kIO)
FlTexture * texture
Optional< SkRect > bounds
Definition SkRecords.h:189
A lightweight object that describes the attributes of a texture that can then used an allocator to cr...

◆ Detach()

void flutter::ImageExternalTextureGLImpeller::Detach ( )
overrideprivatevirtual

Reimplemented from flutter::ImageExternalTextureGL.

Definition at line 172 of file image_external_texture_gl.cc.

172{}

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