Flutter Impeller
impeller::TexImage2DData Struct Reference

Public Member Functions

 TexImage2DData (PixelFormat pixel_format)
 
 TexImage2DData (PixelFormat pixel_format, std::shared_ptr< const fml::Mapping > mapping)
 
bool IsValid () const
 

Public Attributes

GLint internal_format = 0
 
GLenum external_format = GL_NONE
 
GLenum type = GL_NONE
 
std::shared_ptr< const fml::Mapping > data
 

Detailed Description

Definition at line 119 of file texture_gles.cc.

Constructor & Destructor Documentation

◆ TexImage2DData() [1/2]

impeller::TexImage2DData::TexImage2DData ( PixelFormat  pixel_format)
inlineexplicit

Definition at line 125 of file texture_gles.cc.

125  {
126  switch (pixel_format) {
128  internal_format = GL_ALPHA;
129  external_format = GL_ALPHA;
130  type = GL_UNSIGNED_BYTE;
131  break;
133  internal_format = GL_RED;
134  external_format = GL_RED;
135  type = GL_UNSIGNED_BYTE;
136  break;
141  internal_format = GL_RGBA;
142  external_format = GL_RGBA;
143  type = GL_UNSIGNED_BYTE;
144  break;
146  internal_format = GL_RGBA;
147  external_format = GL_RGBA;
148  type = GL_FLOAT;
149  break;
151  internal_format = GL_RGBA;
152  external_format = GL_RGBA;
153  type = GL_HALF_FLOAT;
154  break;
156  // Pure stencil textures are only available in OpenGL 4.4+, which is
157  // ~0% of mobile devices. Instead, we use a depth-stencil texture and
158  // only use the stencil component.
159  //
160  // https://registry.khronos.org/OpenGL-Refpages/gl4/html/glTexImage2D.xhtml
162  internal_format = GL_DEPTH_STENCIL;
163  external_format = GL_DEPTH_STENCIL;
164  type = GL_UNSIGNED_INT_24_8;
165  break;
172  return;
173  }
174  is_valid_ = true;
175  }

References external_format, internal_format, impeller::kA8UNormInt, impeller::kB10G10R10A10XR, impeller::kB10G10R10XR, impeller::kB10G10R10XRSRGB, impeller::kB8G8R8A8UNormInt, impeller::kB8G8R8A8UNormIntSRGB, impeller::kD24UnormS8Uint, impeller::kD32FloatS8UInt, impeller::kR16G16B16A16Float, impeller::kR32G32B32A32Float, impeller::kR8G8B8A8UNormInt, impeller::kR8G8B8A8UNormIntSRGB, impeller::kR8G8UNormInt, impeller::kR8UNormInt, impeller::kS8UInt, impeller::kUnknown, and type.

◆ TexImage2DData() [2/2]

impeller::TexImage2DData::TexImage2DData ( PixelFormat  pixel_format,
std::shared_ptr< const fml::Mapping >  mapping 
)
inline

Definition at line 177 of file texture_gles.cc.

179  : TexImage2DData(pixel_format) {
180  data = std::move(mapping);
181  }

References data.

Member Function Documentation

◆ IsValid()

bool impeller::TexImage2DData::IsValid ( ) const
inline

Definition at line 183 of file texture_gles.cc.

183 { return is_valid_; }

Member Data Documentation

◆ data

std::shared_ptr<const fml::Mapping> impeller::TexImage2DData::data

Definition at line 123 of file texture_gles.cc.

Referenced by TexImage2DData().

◆ external_format

GLenum impeller::TexImage2DData::external_format = GL_NONE

Definition at line 121 of file texture_gles.cc.

Referenced by TexImage2DData().

◆ internal_format

GLint impeller::TexImage2DData::internal_format = 0

Definition at line 120 of file texture_gles.cc.

Referenced by TexImage2DData().

◆ type

GLenum impeller::TexImage2DData::type = GL_NONE

Definition at line 122 of file texture_gles.cc.

Referenced by TexImage2DData().


The documentation for this struct was generated from the following file:
impeller::PixelFormat::kS8UInt
@ kS8UInt
impeller::TexImage2DData::TexImage2DData
TexImage2DData(PixelFormat pixel_format)
Definition: texture_gles.cc:125
impeller::PixelFormat::kB10G10R10A10XR
@ kB10G10R10A10XR
impeller::PixelFormat::kB8G8R8A8UNormIntSRGB
@ kB8G8R8A8UNormIntSRGB
impeller::PixelFormat::kA8UNormInt
@ kA8UNormInt
impeller::PixelFormat::kR8UNormInt
@ kR8UNormInt
impeller::PixelFormat::kR8G8B8A8UNormInt
@ kR8G8B8A8UNormInt
impeller::TexImage2DData::internal_format
GLint internal_format
Definition: texture_gles.cc:120
impeller::PixelFormat::kD32FloatS8UInt
@ kD32FloatS8UInt
impeller::PixelFormat::kR8G8UNormInt
@ kR8G8UNormInt
impeller::PixelFormat::kB10G10R10XR
@ kB10G10R10XR
impeller::PixelFormat::kD24UnormS8Uint
@ kD24UnormS8Uint
impeller::PixelFormat::kR16G16B16A16Float
@ kR16G16B16A16Float
impeller::PixelFormat::kR32G32B32A32Float
@ kR32G32B32A32Float
impeller::PixelFormat::kUnknown
@ kUnknown
impeller::PixelFormat::kR8G8B8A8UNormIntSRGB
@ kR8G8B8A8UNormIntSRGB
impeller::TexImage2DData::type
GLenum type
Definition: texture_gles.cc:122
impeller::PixelFormat::kB10G10R10XRSRGB
@ kB10G10R10XRSRGB
impeller::PixelFormat::kB8G8R8A8UNormInt
@ kB8G8R8A8UNormInt
impeller::TexImage2DData::data
std::shared_ptr< const fml::Mapping > data
Definition: texture_gles.cc:123
impeller::TexImage2DData::external_format
GLenum external_format
Definition: texture_gles.cc:121