Flutter Impeller
IMPELLER_HPP_NAMESPACE::Texture Class Referencefinal

#include <impeller.hpp>

Inheritance diagram for IMPELLER_HPP_NAMESPACE::Texture:
IMPELLER_HPP_NAMESPACE::Object< ImpellerTexture, ImpellerTextureTraits >

Public Member Functions

 Texture (ImpellerTexture texture, AdoptTag adopt)
 
uint64_t GetOpenGLHandle () const
 
- Public Member Functions inherited from IMPELLER_HPP_NAMESPACE::Object< ImpellerTexture, ImpellerTextureTraits >
 Object ()=default
 
 Object (ImpellerTexture object)
 
 Object (ImpellerTexture object, AdoptTag)
 
 Object (Object &&other)
 
 Object (const Object &other)
 
 ~Object ()
 
Objectoperator= (Object &&other)
 
Objectoperator= (const Object &other)
 
ImpellerTexture Get () const
 
 operator bool () const
 

Static Public Member Functions

static Texture WithContents (const Context &context, const ImpellerTextureDescriptor &descriptor, std::unique_ptr< Mapping > mapping=nullptr)
 
static Texture WithOpenGLTexture (const Context &context, const ImpellerTextureDescriptor &descriptor, uint64_t handle)
 

Detailed Description

See also
ImpellerTexture

Definition at line 343 of file impeller.hpp.

Constructor & Destructor Documentation

◆ Texture()

IMPELLER_HPP_NAMESPACE::Texture::Texture ( ImpellerTexture  texture,
AdoptTag  adopt 
)
inline

Definition at line 345 of file impeller.hpp.

Referenced by WithContents(), and WithOpenGLTexture().

Member Function Documentation

◆ GetOpenGLHandle()

uint64_t IMPELLER_HPP_NAMESPACE::Texture::GetOpenGLHandle ( ) const
inline

◆ WithContents()

static Texture IMPELLER_HPP_NAMESPACE::Texture::WithContents ( const Context context,
const ImpellerTextureDescriptor descriptor,
std::unique_ptr< Mapping mapping = nullptr 
)
inlinestatic
See also
ImpellerTextureCreateWithContentsNew

Definition at line 350 of file impeller.hpp.

352  {
353  if (mapping == nullptr) {
354  mapping = std::make_unique<Mapping>(nullptr, 0u, nullptr);
355  }
356  ImpellerMapping c_mapping = {};
357  c_mapping.data = mapping->GetMapping();
358  c_mapping.length = mapping->GetSize();
359  c_mapping.on_release = [](void* user_data) -> void {
360  delete reinterpret_cast<Mapping*>(user_data);
361  };
362  return Texture(gGlobalProcTable.ImpellerTextureCreateWithContentsNew(
363  context.Get(), //
364  &descriptor, //
365  &c_mapping, //
366  mapping.release() //
367  ),
369  }
Texture(ImpellerTexture texture, AdoptTag adopt)
Definition: impeller.hpp:345
ImpellerCallback IMPELLER_NULLABLE on_release
Definition: impeller.h:562
uint64_t length
Definition: impeller.h:561
const uint8_t *IMPELLER_NONNULL data
Definition: impeller.h:560

References ImpellerMapping::data, IMPELLER_HPP_NAMESPACE::Object< T, Traits >::Get(), IMPELLER_HPP_NAMESPACE::gGlobalProcTable, IMPELLER_HPP_NAMESPACE::kAdopt, ImpellerMapping::length, ImpellerMapping::on_release, and Texture().

◆ WithOpenGLTexture()

static Texture IMPELLER_HPP_NAMESPACE::Texture::WithOpenGLTexture ( const Context context,
const ImpellerTextureDescriptor descriptor,
uint64_t  handle 
)
inlinestatic
See also
ImpellerTextureCreateWithOpenGLTextureHandleNew

Definition at line 374 of file impeller.hpp.

376  {
377  return Texture(
378  gGlobalProcTable.ImpellerTextureCreateWithOpenGLTextureHandleNew(
379  context.Get(), //
380  &descriptor, //
381  handle //
382  ),
384  }

References IMPELLER_HPP_NAMESPACE::Object< T, Traits >::Get(), IMPELLER_HPP_NAMESPACE::gGlobalProcTable, IMPELLER_HPP_NAMESPACE::kAdopt, and Texture().


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