Flutter Impeller
impeller::DlImageImpellerTexture Class Referencefinal

#include <dl_image_impeller.h>

Inheritance diagram for impeller::DlImageImpellerTexture:
impeller::DlImageImpeller

Public Member Functions

 DlImageImpellerTexture (std::shared_ptr< Texture > texture, OwningContext owning_context)
 
 ~DlImageImpellerTexture () override
 
std::shared_ptr< Texture > GetImpellerTexture (const std::shared_ptr< Context > &context) const override
 
flutter::DlColorSpace GetColorSpace () const override
 
bool isOpaque () const override
 
bool isUIThreadSafe () const override
 
flutter::DlISize GetSize () const override
 
size_t GetApproximateByteSize () const override
 
OwningContext owning_context () const override
 
- Public Member Functions inherited from impeller::DlImageImpeller
Type GetImageType () const override
 
const DlImageImpeller * asImpellerImage () const override
 
bool isTextureBacked () const override
 
std::shared_ptr< Texture > GetCachedTexture (const ContentContext &renderer) const
 

Additional Inherited Members

- Static Public Member Functions inherited from impeller::DlImageImpeller
static sk_sp< DlImageImpeller > Make (std::shared_ptr< Texture > texture, OwningContext owning_context=OwningContext::kIO)
 
static sk_sp< DlImageImpeller > MakeFromYUVTextures (AiksContext *aiks_context, std::shared_ptr< Texture > y_texture, std::shared_ptr< Texture > uv_texture, YUVColorSpace yuv_color_space)
 

Detailed Description

Definition at line 45 of file dl_image_impeller.h.

Constructor & Destructor Documentation

◆ DlImageImpellerTexture()

impeller::DlImageImpellerTexture::DlImageImpellerTexture ( std::shared_ptr< Texture >  texture,
OwningContext  owning_context 
)

Definition at line 65 of file dl_image_impeller.cc.

67  : texture_(std::move(texture)), owning_context_(owning_context) {}
OwningContext owning_context() const override

◆ ~DlImageImpellerTexture()

impeller::DlImageImpellerTexture::~DlImageImpellerTexture ( )
overridedefault

Member Function Documentation

◆ GetApproximateByteSize()

size_t impeller::DlImageImpellerTexture::GetApproximateByteSize ( ) const
override

Definition at line 112 of file dl_image_impeller.cc.

112  {
113  auto size = sizeof(*this);
114  if (texture_) {
115  size += texture_->GetTextureDescriptor().GetByteSizeOfBaseMipLevel();
116  }
117  return size;
118 }

◆ GetColorSpace()

flutter::DlColorSpace impeller::DlImageImpellerTexture::GetColorSpace ( ) const
override

Definition at line 79 of file dl_image_impeller.cc.

79  {
80  if (!texture_) {
81  return flutter::DlColorSpace::kSRGB;
82  }
83  switch (texture_->GetTextureDescriptor().format) {
86  return flutter::DlColorSpace::kExtendedSRGB;
87  default:
88  return flutter::DlColorSpace::kSRGB;
89  }
90 }

References impeller::kB10G10R10XR, and impeller::kR16G16B16A16Float.

◆ GetImpellerTexture()

std::shared_ptr< impeller::Texture > impeller::DlImageImpellerTexture::GetImpellerTexture ( const std::shared_ptr< Context > &  context) const
overridevirtual

Implements impeller::DlImageImpeller.

Definition at line 73 of file dl_image_impeller.cc.

74  {
75  return texture_;
76 }

◆ GetSize()

flutter::DlISize impeller::DlImageImpellerTexture::GetSize ( ) const
override

Definition at line 105 of file dl_image_impeller.cc.

105  {
106  // texture |GetSize()| returns a 64-bit size, but we need a 32-bit size,
107  // so we need to convert to DlISize (the 32-bit variant) either way.
108  return texture_ ? flutter::DlISize(texture_->GetSize()) : flutter::DlISize();
109 }

◆ isOpaque()

bool impeller::DlImageImpellerTexture::isOpaque ( ) const
override

Definition at line 93 of file dl_image_impeller.cc.

93  {
94  // Impeller doesn't currently implement opaque alpha types.
95  return false;
96 }

◆ isUIThreadSafe()

bool impeller::DlImageImpellerTexture::isUIThreadSafe ( ) const
override

Definition at line 99 of file dl_image_impeller.cc.

99  {
100  // Impeller textures are always thread-safe
101  return true;
102 }

◆ owning_context()

OwningContext impeller::DlImageImpellerTexture::owning_context ( ) const
inlineoverride

Definition at line 61 of file dl_image_impeller.h.

61 { return owning_context_; }

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