Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
 
Loading...
Searching...
No Matches
Skwasm::DlWimpImageFromTexture Class Reference
Inheritance diagram for Skwasm::DlWimpImageFromTexture:
Skwasm::DlWimpImageBase impeller::DlImageImpeller flutter::DlImage

Public Member Functions

 DlWimpImageFromTexture (int width, int height, SkwasmObject texture_source, Skwasm::Surface *surface)
 
std::shared_ptr< impeller::TextureGetImpellerTexture (const std::shared_ptr< impeller::Context > &context) const override
 
- Public Member Functions inherited from Skwasm::DlWimpImageBase
 DlWimpImageBase (int width, int height)
 
bool isOpaque () const override
 If the pixel format of this image ignores alpha, this returns true. This method might conservatively return false when it cannot guarnatee an opaque image, for example when the pixel format of the image supports alpha but the image is made up of entirely opaque pixels.
 
bool isUIThreadSafe () const override
 If the underlying platform image held by this object has no threading requirements for the release of that image (or if arrangements have already been made to forward that image to the correct thread upon deletion), this method returns true.
 
flutter::DlColorSpace GetColorSpace () const override
 Gets the color space of the image.
 
virtual ~DlWimpImageBase ()
 
flutter::DlISize GetSize () const override
 
size_t GetApproximateByteSize () const override
 
- Public Member Functions inherited from impeller::DlImageImpeller
Type GetImageType () const override
 Returns the backend type of this image.
 
const DlImageImpellerasImpellerImage () const override
 Safe downcast to DlImageImpeller.
 
bool isTextureBacked () const override
 Returns true if the image is backed by a GPU texture.
 
std::shared_ptr< TextureGetCachedTexture (const ContentContext &renderer) const
 
- Public Member Functions inherited from flutter::DlImage
virtual ~DlImage ()
 
virtual const DlImageSkiaasSkiaImage () const
 Safe downcast to DlImageSkia.
 
int width () const
 
int height () const
 
DlIRect GetBounds () const
 
virtual OwningContext owning_context () const
 
virtual std::optional< std::string > get_error () const
 
bool Equals (const DlImage *other) const
 
bool Equals (const DlImage &other) const
 
bool Equals (const sk_sp< const DlImage > &other) const
 

Additional Inherited Members

- Public Types inherited from flutter::DlImage
enum class  OwningContext {
  kRaster ,
  kIO
}
 
enum class  Type {
  kSkia ,
  kImpeller
}
 The backend type of this image. More...
 
- Static Public Member Functions inherited from impeller::DlImageImpeller
static sk_sp< DlImageImpellerMake (std::shared_ptr< Texture > texture, OwningContext owning_context=OwningContext::kIO)
 
static sk_sp< DlImageImpellerMakeFromYUVTextures (AiksContext *aiks_context, std::shared_ptr< Texture > y_texture, std::shared_ptr< Texture > uv_texture, YUVColorSpace yuv_color_space)
 
- Protected Member Functions inherited from flutter::DlImage
 DlImage ()
 
- Protected Attributes inherited from Skwasm::DlWimpImageBase
int width_
 
int height_
 

Detailed Description

Definition at line 69 of file images_impeller.cc.

Constructor & Destructor Documentation

◆ DlWimpImageFromTexture()

Skwasm::DlWimpImageFromTexture::DlWimpImageFromTexture ( int  width,
int  height,
SkwasmObject  texture_source,
Skwasm::Surface surface 
)
inline

Definition at line 71 of file images_impeller.cc.

76 texture_source_wrapper_(
77 surface->CreateTextureSourceWrapper(texture_source)) {}
DlWimpImageBase(int width, int height)
int height() const
Definition dl_image.cc:19
int width() const
Definition dl_image.cc:15
VkSurfaceKHR surface
Definition main.cc:65

References surface.

Member Function Documentation

◆ GetImpellerTexture()

std::shared_ptr< impeller::Texture > Skwasm::DlWimpImageFromTexture::GetImpellerTexture ( const std::shared_ptr< impeller::Context > &  context) const
inlineoverridevirtual

Reimplemented from Skwasm::DlWimpImageBase.

Definition at line 79 of file images_impeller.cc.

80 {
81 auto* gles_context = impeller::ContextGLES::Cast(context.get());
82 GLuint gl_texture_id = skwasm_createGlTextureFromTextureSource(
83 texture_source_wrapper_->GetTextureSource(), width_, height_);
84
88 desc.mip_count = 1;
90 desc.usage = static_cast<impeller::TextureUsageMask>(
92
93 impeller::HandleGLES external_handle =
94 gles_context->GetReactor()->CreateHandle(impeller::HandleType::kTexture,
95 gl_texture_id);
96
98 gles_context->GetReactor(), desc, std::move(external_handle));
99 if (texture) {
100 texture->SetCoordinateSystem(
102 }
103 return texture;
104 }
static ContextGLES & Cast(Context &base)
Represents a handle to an underlying OpenGL object. Unlike OpenGL object handles, these handles can b...
Definition handle_gles.h:42
static std::shared_ptr< TextureGLES > WrapTexture(std::shared_ptr< ReactorGLES > reactor, TextureDescriptor desc, HandleGLES external_handle)
Create a texture by wrapping an external OpenGL texture handle. Ownership of the texture handle is as...
FlTexture * texture
ISize64 ISize
Definition size.h:162
unsigned int skwasm_createGlTextureFromTextureSource(SkwasmObject texture_source, int width, int height)
A lightweight object that describes the attributes of a texture that can then used an allocator to cr...

References impeller::BackendCast< ContextGLES, Context >::Cast(), impeller::TextureDescriptor::format, Skwasm::DlWimpImageBase::height_, impeller::kR8G8B8A8UNormInt, impeller::kShaderRead, impeller::kTexture, impeller::kTexture2D, impeller::kUploadFromHost, impeller::TextureDescriptor::mip_count, impeller::TextureDescriptor::size, skwasm_createGlTextureFromTextureSource(), texture, impeller::TextureDescriptor::type, impeller::TextureDescriptor::usage, Skwasm::DlWimpImageBase::width_, and impeller::TextureGLES::WrapTexture().


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