| Flutter Impeller |

Public Member Functions | Static Public Member Functions | List of all members
IMPELLER_HPP_NAMESPACE::Texture Class Referencefinal

`#include <impeller.hpp>`

Inheritance diagram for IMPELLER_HPP_NAMESPACE::Texture:

## 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 ()
Object & | operator= (Object &&other)
Object & | operator= (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 388 of file impeller.hpp.

## Constructor & Destructor Documentation

## ◆ Texture()

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

Definition at line 390 of file impeller.hpp.

390 : Object(texture, adopt) {}
IMPELLER_HPP_NAMESPACE::Object< ImpellerTexture, ImpellerTextureTraits >::Object
Object()=default

Referenced by WithContents(), and WithOpenGLTexture().

## Member Function Documentation

## ◆ GetOpenGLHandle()

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

Definition at line 431 of file impeller.hpp.

431 {
432 return gGlobalProcTable.ImpellerTextureGetOpenGLHandle(Get());
433 }
IMPELLER_HPP_NAMESPACE::Object< ImpellerTexture, ImpellerTextureTraits >::Get
ImpellerTexture Get() const
Definition: impeller.hpp:269
IMPELLER_HPP_NAMESPACE::gGlobalProcTable
ProcTable gGlobalProcTable
Definition: playground_test.cc:25

References IMPELLER_HPP_NAMESPACE::Object< ImpellerTexture, ImpellerTextureTraits >::Get(), and IMPELLER_HPP_NAMESPACE::gGlobalProcTable.

## ◆ WithContents()

static Texture IMPELLER_HPP_NAMESPACE::Texture::WithContents | ( | const Context & | context,
|  | const ImpellerTextureDescriptor & | descriptor,
|  | std::unique_ptr< Mapping > | mapping = `nullptr`
| ) |  |
| inline static

See also
  ImpellerTextureCreateWithContentsNew

Definition at line 395 of file impeller.hpp.

397 {
398 if (mapping == nullptr) {
399 mapping = std::make_unique<Mapping>(nullptr, 0u, nullptr);
400 }
401 ImpellerMapping c_mapping = {};
402 c_mapping.data = mapping->GetMapping();
403 c_mapping.length = mapping->GetSize();
404 c_mapping.on_release = [](void* user_data) -> void {
405 delete reinterpret_cast<Mapping*>(user_data);
406 };
407 return Texture(gGlobalProcTable.ImpellerTextureCreateWithContentsNew(
408 context.Get(), //
409 &descriptor, //
410 &c_mapping, //
411 mapping.release() //
412 ),
413 AdoptTag::kAdopt);
414 }
IMPELLER_HPP_NAMESPACE::Texture::Texture
Texture(ImpellerTexture texture, AdoptTag adopt)
Definition: impeller.hpp:390
IMPELLER_HPP_NAMESPACE::AdoptTag::kAdopt
@ kAdopt
ImpellerMapping
Definition: impeller.h:602
ImpellerMapping::on_release
ImpellerCallback IMPELLER_NULLABLE on_release
Definition: impeller.h:605
ImpellerMapping::length
uint64_t length
Definition: impeller.h:604
ImpellerMapping::data
const uint8_t *IMPELLER_NONNULL data
Definition: impeller.h:603

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
| ) |  |
| inline static

See also
  ImpellerTextureCreateWithOpenGLTextureHandleNew

Definition at line 419 of file impeller.hpp.

421 {
422 return Texture(
423 gGlobalProcTable.ImpellerTextureCreateWithOpenGLTextureHandleNew(
424 context.Get(), //
425 &descriptor, //
426 handle //
427 ),
428 AdoptTag::kAdopt);
429 }

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:

- impeller/toolkit/interop/impeller.hpp