Flutter Engine
The Flutter Engine
Public Member Functions | Private Member Functions | List of all members
flutter::SurfaceTextureExternalTextureImpellerGL Class Reference

#include <surface_texture_external_texture_gl.h>

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

Public Member Functions

 SurfaceTextureExternalTextureImpellerGL (const std::shared_ptr< impeller::ContextGLES > &context, int64_t id, const fml::jni::ScopedJavaGlobalRef< jobject > &surface_texture, const std::shared_ptr< PlatformViewAndroidJNI > &jni_facade)
 
 ~SurfaceTextureExternalTextureImpellerGL () override
 
- 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
 
void Paint (PaintContext &context, const SkRect &bounds, bool freeze, const DlImageSampling sampling) override
 
void OnGrContextCreated () override
 
void OnGrContextDestroyed () override
 
void MarkNewFrameAvailable () override
 
void OnTextureUnregistered () override
 
- Public Member Functions inherited from flutter::Texture
 Texture (int64_t id)
 
virtual ~Texture ()
 
virtual void Paint (PaintContext &context, const SkRect &bounds, bool freeze, const DlImageSampling sampling)=0
 
virtual void MarkNewFrameAvailable ()=0
 
virtual void OnTextureUnregistered ()=0
 
int64_t Id ()
 
- Public Member Functions inherited from flutter::ContextListener
 ContextListener ()
 
 ~ContextListener ()
 
virtual void OnGrContextCreated ()=0
 
virtual void OnGrContextDestroyed ()=0
 

Private Member Functions

virtual void ProcessFrame (PaintContext &context, const SkRect &bounds) override
 
virtual void Detach () override
 

Additional Inherited Members

- Protected Types inherited from flutter::SurfaceTextureExternalTexture
enum class  AttachmentState { kUninitialized , kAttached , kDetached }
 
- Protected Member Functions inherited from flutter::SurfaceTextureExternalTexture
virtual void ProcessFrame (PaintContext &context, const SkRect &bounds)=0
 
virtual void Detach ()
 
void Attach (int gl_tex_id)
 
bool ShouldUpdate ()
 
void Update ()
 
 FML_DISALLOW_COPY_AND_ASSIGN (SurfaceTextureExternalTexture)
 
- Protected Attributes inherited from flutter::SurfaceTextureExternalTexture
std::shared_ptr< PlatformViewAndroidJNIjni_facade_
 
fml::jni::ScopedJavaGlobalRef< jobject > surface_texture_
 
AttachmentState state_ = AttachmentState::kUninitialized
 
SkMatrix transform_
 
sk_sp< flutter::DlImagedl_image_
 

Detailed Description

Definition at line 40 of file surface_texture_external_texture_gl.h.

Constructor & Destructor Documentation

◆ SurfaceTextureExternalTextureImpellerGL()

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

Definition at line 66 of file surface_texture_external_texture_gl.cc.

72 : SurfaceTextureExternalTexture(id, surface_texture, jni_facade),
73 impeller_context_(context) {}
SurfaceTextureExternalTexture(int64_t id, const fml::jni::ScopedJavaGlobalRef< jobject > &surface_texture, const std::shared_ptr< PlatformViewAndroidJNI > &jni_facade)

◆ ~SurfaceTextureExternalTextureImpellerGL()

flutter::SurfaceTextureExternalTextureImpellerGL::~SurfaceTextureExternalTextureImpellerGL ( )
override

Definition at line 75 of file surface_texture_external_texture_gl.cc.

76{}

Member Function Documentation

◆ Detach()

void flutter::SurfaceTextureExternalTextureImpellerGL::Detach ( )
overrideprivatevirtual

◆ ProcessFrame()

void flutter::SurfaceTextureExternalTextureImpellerGL::ProcessFrame ( PaintContext context,
const SkRect bounds 
)
overrideprivatevirtual

Implements flutter::SurfaceTextureExternalTexture.

Definition at line 78 of file surface_texture_external_texture_gl.cc.

80 {
82 // Generate the texture handle.
87 desc.size = {static_cast<int>(bounds.width()),
88 static_cast<int>(bounds.height())};
89 desc.mip_count = 1;
90 texture_ = std::make_shared<impeller::TextureGLES>(
91 impeller_context_->GetReactor(), desc,
93 texture_->SetCoordinateSystem(
95 auto maybe_handle = texture_->GetGLHandle();
96 if (!maybe_handle.has_value()) {
97 FML_LOG(ERROR) << "Could not get GL handle from impeller::TextureGLES!";
98 return;
99 }
100 Attach(maybe_handle.value());
101 }
103
104 // Updates the texture contents and transformation matrix.
105 Update();
106
108}
static sk_sp< DlImageImpeller > Make(std::shared_ptr< Texture > texture, OwningContext owning_context=OwningContext::kIO)
#define FML_LOG(severity)
Definition: logging.h:82
#define FML_CHECK(condition)
Definition: logging.h:85
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...
#define ERROR(message)
Definition: elf_loader.cc:260

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